When I query my mongodb collection with a query I get multiple documents found.
According to the documentation , "the update() method updates a single document". And I cannot use the multi:true option, since I want to update the different documents found with different values so:
I would like to do the following:
- Update the first document with :
db.collection('foo').update(query,{$set : {'qux':'bar'}})
- Update the second document with
db.collection('foo').update(query,{$set : {'qux':'blep'}})
Close to this, but not quite getting there MongoDB: How to update multiple documents with a single command?