Thuta Learning
MongoDB
IntermediateData & Databasesintermediate

Update Many Documents

Filter နှင့်ကိုက်ညီသော documents အားလုံးကို update လုပ်ရန် updateMany() method ကိုသုံးသည်။

javascript
db.inventory.updateMany(
   { qty: { $lt: 50 } },
   {
     $set: { "status": "low" }
   }
)
You should see
(qty 50 အောက်နည်းသော documents အားလုံးတွင် status: "low" ဆိုသော field အသစ်တစ်ခု ထပ်တိုးသွားမည်)
Update Many Documents | Thuta Learning