CertyRush
Đang tải...
C CertyRush
Câu hỏi free preview

Câu 7: C100DEV: MongoDB Associate Developer

A products collection needs to update the value of the qty field to 100 for a document with a “card” item value. It should insert a new document if it does not exist. What command should be used?

Nội dung câu hỏi

A products collection needs to update the value of the qty field to 100 for a document with a “card” item value. It should insert a new document if it does not exist. What command should be used?

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.

  1. A. db.products.updateOne({ item: “card”} , { $set: { qty: 100 } }, { $upsert: true })
  2. B. db.products.insertOne( { item: “card”} , { $set: { qty: 100 } }, { $upsert: true })
  3. C. db.products.insertOne( { item: “card”} , { $set: { qty: 100 } }, { upsert: true })
  4. D. db.products.updateOne({ item: “card”} , { $set: { qty: 100 } }, { upsert: true }) — đáp án hiện tại

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.

Câu hỏi liền kề