Câu 19: C100DEV: MongoDB Associate Developer
Given the following sample documents:{ _id: 1, firstName: “Person1”, company: “CompanyA”, active: false }{ _id: 2, firstName: “Person2”, company: “CompanyB”, active: false }{ _id: 3, firstName: “Person3”, company: “CompanyC”, active: true }{ _id: 4, firstName: “Person4”, company: “CompanyD”, active: true }What code bl…
Nội dung câu hỏi
Given the following sample documents:{ _id: 1, firstName: “Person1”, company: “CompanyA”, active: false }{ _id: 2, firstName: “Person2”, company: “CompanyB”, active: false }{ _id: 3, firstName: “Person3”, company: “CompanyC”, active: true }{ _id: 4, firstName: “Person4”, company: “CompanyD”, active: true }What code block should be used to delete the third document from a MongoDB collection in Java?
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. collection.DeleteOne(eq(“_id”, new ObjectID(3))));
- B. collection.Delete(eq(“_id”, new ObjectID(3))));
- C. collection.Delete(eq(“_id”, 3));
- D. collection.DeleteOne(eq(“_id”, 3)); — đá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.