Câu 48: C100DBA: MongoDB Associate Database Administrator
A coffee shop stores its sales in an orders collection. The orders collection contains several thousands of documents. A sample document from the orders collection looks like this:{item: “latte”,size: “S”,price: 4.12}The following query returns orders where the size is “M”:db.orders.find(“size”: “M”})Which two indexes…
Nội dung câu hỏi
A coffee shop stores its sales in an orders collection. The orders collection contains several thousands of documents. A sample document from the orders collection looks like this:{item: “latte”,size: “S”,price: 4.12}The following query returns orders where the size is “M”:db.orders.find(“size”: “M”})Which two indexes would improve performance for this query? (Choose two.)
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.orders.createindex({item: 1, size: -1})
- B. db.orders.createindex({price: 1, item: -1, size: 1})
- C. db.orders.createindex({size: 1}) — đáp án hiện tại
- D. db.orders.createindex({size: -1, item: 1}) — đá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.