I am trying to update bulk of documents in collection using mongodbwith different values for field. I have unique Id for each document. I need to update bulk of records in single update command. How do we update bulk of documents.
Please suggest the approaches to solve this.
1 Answer
You can update multiple records with below command,
db.getCollection('collectionName').update({'condition if any'},{$set: { field:value}}, {multi:true})
1 Comment
mukund shelke
It's right . But each documents having changes in different fields not the same field. Not same field for all documents . I need to update whole documents with different values for different fields. Is the mentioned way is feasible way to do so ?
bulkWrite(). Is there actually a question other than "Please search the documentation for me"?