Câu 24: C100DBA: MongoDB Associate Database Administrator
What operation updates the value of the unitsInStock field to 25 for a document with an “laptop” product, and inserts a new document if it does not exist?
Nội dung câu hỏi
What operation updates the value of the unitsInStock field to 25 for a document with an “laptop” product, and inserts a new document if it does not exist?
Các lựa chọn
Đáp án được giữ gọn theo nhãn A, B, C, D trong phần bình chọn tương tác.
- A. db.inventory.updateOne({product: “laptop”}, {$set: {unitsInStock: 25}}, {upsert: True})
- B. db.inventory.insertOne({product: “laptop”}, {$set: {unitsInStock: 25}}, {upsert: True})
- C. db.inventory.updateOne({product: “laptop”}, {$set: {unitsInStock: 25}}, {upsert: true}) — đáp án hiện tại
- D. db.inventory.insertOne({product: “laptop”}, {$set: {unitsInStock: 25}}, {upsert: true})
Cộng đồng
0 bình luận công khai. Tên thành viên được ẩn một phần.
Chưa có bình luận. Mở giao diện tương tác để bắt đầu thảo luận.