users where each document has an embedded address object with fields city and zip, which query returns all users living in the city 'Springfield'?db.users.find({"address.city": "Springfield"})Option C uses dot notation correctly to access the nested city field inside the address embedded document. Options B and C try to match the entire embedded document exactly, which will fail if other fields exist. Option C looks for a top-level city field, which does not exist.
orders where each document has an embedded array items with objects containing product and quantity. Which query returns all orders that include an item with product equal to 'Pen'?db.orders.find({"items.product": "Pen"})Option D correctly uses dot notation to find documents where the items array contains an object with product equal to 'Pen'. Options B and C try to match the entire array or object exactly, which will fail if there are multiple items. Option D looks for a top-level product field, which does not exist.
profile.contact.email to 'user@example.com' for the document with _id 1?db.users.updateOne({_id: 1}, {$set: {"profile.contact.email": "user@example.com"}})Option B correctly uses quotes around the nested field path in dot notation. Option B is valid syntax but is duplicated here; the original Option B was invalid because keys with dots must be quoted. Options C and D replace the entire profile object, which may overwrite other fields unintentionally.
products with embedded documents specs containing weight and color. Which index will best optimize queries filtering by specs.color?Option A creates an index on the nested field specs.color, which directly supports queries filtering by that field. Option A indexes the entire specs object, which is less efficient. Option A indexes a top-level color field that does not exist. Option A indexes a different nested field specs.weight.
Option A is correct because the entire document, including embedded documents, counts towards the 16MB limit. Large nested data should be stored separately and referenced. Options B and D are false because embedded documents count fully towards the size limit. Option A is false because MongoDB does not split documents automatically.