Created
July 1, 2023 15:46
-
-
Save mehdishahdoost/60cf5cdb2f74523bbb77ea4f050b24ef to your computer and use it in GitHub Desktop.
MongoDB Bulk update script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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