Thuta Learning
MongoDB
IntermediateData & Databasesအလယ်အလတ်

Update Operators

MongoDBသင်ခန်းစာ 13

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 သို့ တိုးသွားမည်)

နောက်ဆုံးပြင်ဆင်ရက်

Progress ကို ဤ browser (ဤစက်) တွင်သာ သိမ်းထားပါသည်။ အခြားစက်များနှင့် sync မလုပ်ပါ။

ဤသင်ခန်းစာတွင် အမှားတွေ့ပါက အကြောင်းကြားရန်သင့် email app ကို ဤသင်ခန်းစာလိပ်စာ ဖြည့်ပြီးသားဖြင့် ဖွင့်ပေးပါမည် — သင်ကိုယ်တိုင် ပို့မှသာ ပို့မည်ဖြစ်သည်။

Update Operators | Thuta Learning