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

Insert Documents

MongoDBသင်ခန်းစာ 6

Collection ထဲသို့ document အသစ်များထည့်ရန် insertOne() သို့မဟုတ် insertMany() methods များကိုသုံးသည်။

javascript
// Insert a single document
db.inventory.insertOne(
   { item: "canvas", qty: 100, tags: ["cotton"], size: { h: 28, w: 35.5, uom: "cm" } }
)

// Insert multiple documents
db.inventory.insertMany([
   { item: "mat", qty: 85, tags: ["gray"] },
   { item: "mousepad", qty: 25, tags: ["gel", "blue"] }
])
You should see
{ "acknowledged": true, "insertedId": ObjectId("...") } ...

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

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

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

Insert Documents | Thuta Learning