Update many documents in mongoDB with different values
问题 I am trying to update two documents in mongoDB, with two different values. I made it with two different callbacks, but is it possible to do it with only one request? My solution: mongo.financeCollection.update( { 'reference': 10 }, { $push: { history: history1 } }, function (err){ if (err){ callback (err); } else { mongo.financeCollection.update( { 'reference': 20 }, { $push: { history: history2 } }, function (err){ if (err){ callback(err); } else { callback(null); } }); } }); Sorry if it is