Thuta Learning
ရှာဖွေရန်
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