MongoDB Certified DBA Associate (C100DBA) — Question 2

Consider a contacts collection that contains these documents:
{“_id”: 1, “name”: “Poppy”, “birthday”: “03-09-1984”}
{“_id”: 2, “name”: “Ashley”, “birthday”: “08-12-1990”}
{“_id”: 3, “name”: “Cleo”, “birthday”: “11-02-1976”}
What query returns the document where the field name is “Poppy”?

Answer options

Correct answer: C

Explanation

The correct answer is C, which incorrectly attempts to check for the existence of the key 'Poppy' instead of the value. Options A and B are not valid because they either use a lowercase 'p' or the proper casing, which would normally return the document if the query was correct. Options D uses dot notation incorrectly and does not match the intended query structure.