You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, i just wanted to say your code saved me from a nightmare, and i was hoping you could help me explain a bit. The issue is with the lesson 4 project find:
The official docs state that i can use collection.find with a query and a projection https://docs.mongodb.com/manual/reference/method/db.collection.find/#explicitly-exclude-the-id-field collection.find({ age: { $gt: +age } }, { _id: 0 })
but the code doesnt apply the projection unless i do it like in your solution wrapping the projection in fields: .find({ age: { $gt: +age } }, { fields: { _id: 0 } })
So i guess my question is? How did you know to apply the fields: in the projection, i cant find it in the official docs
Again thank you very much i was stuck on this problem for so long, just hoping for a bit of clarification
The text was updated successfully, but these errors were encountered:
Hi, i just wanted to say your code saved me from a nightmare, and i was hoping you could help me explain a bit. The issue is with the lesson 4 project find:
The official docs state that i can use collection.find with a query and a projection
https://docs.mongodb.com/manual/reference/method/db.collection.find/#explicitly-exclude-the-id-field
collection.find({ age: { $gt: +age } }, { _id: 0 })
but the code doesnt apply the projection unless i do it like in your solution wrapping the projection in fields:
.find({ age: { $gt: +age } }, { fields: { _id: 0 } })
So i guess my question is? How did you know to apply the
fields:
in the projection, i cant find it in the official docsAgain thank you very much i was stuck on this problem for so long, just hoping for a bit of clarification
The text was updated successfully, but these errors were encountered: