Skip to content

Instantly share code, notes, and snippets.

@mehdishahdoost
Created July 1, 2023 15:46
Show Gist options
  • Select an option

  • Save mehdishahdoost/60cf5cdb2f74523bbb77ea4f050b24ef to your computer and use it in GitHub Desktop.

Select an option

Save mehdishahdoost/60cf5cdb2f74523bbb77ea4f050b24ef to your computer and use it in GitHub Desktop.
MongoDB Bulk update script
db = db.getSiblingDB('dilmachi');
insertBulk = function() {
var bulk = db.books.initializeOrderedBulkOp();
bulk.find({name: 'Moon'}).update({$set: {price: 300}});
bulk.execute();
}
insertBulk();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment