Anyone knows a way to get all documents ids updated during a ‘collection.update’ with the multi: true ?
Right now, (following what the doc says) it’s only sending back the number of document modified during the query which isn’t useful for what i need.
Do i have to do some ‘collection.find’ in order to get those ?
Notice that sometimes you might be able to optimize your update with the result of the find (depending on your query and indexes). Something like this:
var ids = MyCollection.find({ complex query }).map(function(e) { return e._id; });
MyCollection.update({ _id: { $in: ids } }, { $set: whatever });
// Now use the ids ...