If you read the problem:
Using the video.movieDetails collection, which of the queries below would produce output documents that resemble the following. Check all that apply.
You can easily understand that you must check all the answers that would throw results like the shown in the problem. Let’s go to the pattern:
{ "title" : "P.S. I Love You" }
{ "title" : "Love Actually" }
{ "title" : "Shakespeare in Love" }
So the query should return this kind of output. Now let’s check the options:
db.movieDetails.find({title: “Muppets from Space”}, {title: 1})
This solution would bring the _id with it, so we don’t check it.
db.movieDetails.find({year: 1964}, {title: 1, _id: 0})
Although the filter could make it seem strange, it’s important to focus on the problem. Would this query bring the data in the given pattern? If you check in your Mongo console or in Compass, then you would see that this answer is correct. Let’s keep moving.
db.movieDetails.find({title: “”}, {title: 1})
Again, brings the _id. Don’t check this one.
db.movieDetails.find({}, {title: 1, _id: 0})
This one doesn’t have a filter, but still, the format accomplishes the given pattern. You selected this one, right?
db.movieDetails.find({}, {title})
Right now I am away from my computer so I can’t give a proper info but I think this will bring a syntax error. Anyway, it doesn’t block the _id.
db.movieDetails.find({}, {title: 1})
We have a lot missing the _id block. This one is the same as the other ones. It brings the title but doesn’t block the _id.
That’s all! Hope it helps! Your mistake was in the second one. But don’t worry! Take this as an opportunity to grow and keep learning!