[09:15:47] <jokke> the balancer has been running since yesterday and the distribution of chunks looks much better but the index size is still unchanged across the shards. I would've thought that it would decrease/increase proportionally to the chunks.
[09:16:16] <jokke> does it require an additional step to balance out the index?
[13:24:09] <cubud> I have a document with a "data" node, that is an array of complex objects. In a single document I want to iterate all elements of the array and if the value of a specific attribute is "X" I want to change it to Y. Do I have to write a JS loop for this, or is there a query I could use?
[13:32:57] <GothAlice> cubud: If there is only one element to replace, you can use $elemMatch, then $set the "$" field to replace that array element, I believe.
[13:33:18] <GothAlice> If there is more than one array element to update, you're pooched and need to pull in the record and figure out the transformations to apply, or re-set the whole list.
[13:40:10] <cubud> GothAlice - Thanks, I think though that only matches the first element. I've written a forEach loop
[14:10:30] <GothAlice> As I mentioned. $ works for updating single array elements. More than that, you'll need to pull in, and either determine the individual $pull operations to perform, or in-memory modify the array then re-$set the whole thing.