Updating Pricing In MongoDB Shell (mongosh) - wizhaaa/chinad GitHub Wiki

Connect to mongo

In the terminal:

mongosh "mongodb+srv://chinadelightcluster.nhxro.mongodb.net/testChina" --username macwz

Will be prompted for password. This is viewable and changable on the MongoDB website.

(password hint: s-p@i)

CLI Commands

Basic structure: db.category.updateMany( {params/filter} , { $set: {price changing } } )

db.collectionName.updateMany( {name: "Dish Name"}, { $set: {price: 1.5, priceSm: 1.5, priceLg: 2.5 } } )

Examples

db.lunches.updateMany( {price:8.25} , {$set: {price: 8.75 } } )