Thuta Learning
MongoDB
IntermediateData & Databasesintermediate

Update Operators

Update လုပ်ရာတွင် အသုံးများသော operators များ:

• $set: field ၏တန်ဖိုးကို အသစ်သတ်မှတ်ရန်/ထပ်တိုးရန်

• $inc: number field ၏တန်ဖိုးကို တိုး/လျှော့ ရန်

• $unset: field တစ်ခုကို ဖယ်ရှားရန်

• $push: array field ထဲသို့ item အသစ်ထည့်ရန်

javascript
// Increment the quantity of "journal" by 5
db.inventory.updateOne(
   { item: "journal" },
   { $inc: { qty: 5 } }
)
You should see
("journal" ၏ qty မှာ 25 မှ 30 သို့ တိုးသွားမည်)
Update Operators | Thuta Learning