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

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.

  1. A. db.inventory.updateOne({product: “laptop”}, {$set: {unitsInStock: 25}}, {upsert: True})
  2. B. db.inventory.insertOne({product: “laptop”}, {$set: {unitsInStock: 25}}, {upsert: True})
  3. C. db.inventory.updateOne({product: “laptop”}, {$set: {unitsInStock: 25}}, {upsert: true}) — đáp án hiện tại
  4. 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.

Câu hỏi liền kề