Hi
I’ve been answering the practice questions for Associate Developer Node.js from https://learn.mongodb.com/learn/course/associate-developer-node-practice-questions/prep-questions/practice-questions
There is a question:
Given the following sample documents:
{_id:1, name: "Quesedillas Inc.", active: true },
{_id:2, name: "Pasta Inc.", active: true },
{_id:3, name: "Tacos Inc.", active: false },
{_id:4, name: "Cubanos Inc.", active: false },
{_id:5, name: "Chicken Parm Inc.", active: false },
A company wants to create a mobile app for users to find restaurants by name. The developer wants to show the user restaurants that match their search. An Atlas Search index has already been created to support this query.
What query satisfies these requirements?
A. db.restaurants.aggregate([{ "$search": { "text": { "path": "name", "synonym": "cuban"} } }])Your Answer
B. db.restaurants.aggregate([{ "$search": { "text": { "path": "name", "query": "cuban"} } }])
C. db.restaurants.aggregate([{ "$search": { "text": { "field": "name", "query": "cuban"} } }])
D. db.restaurants.aggregate([{ "$search": { "text": { "field": "name", "synonym": "cuban"} } }])
So I’ve tried all 4 and have been told all 4 are wrong… see screen shots (attached)
annoying - means you can’t get 100% on the practice