Is there any way that will only return the field of the store that has grade B?
I tried: db.restaurant.find( {"Result.Grade" : "B"} )
But it will return back all document content with grade B.
Thanks!!
Is there any way that will only return the field of the store that has grade B?
I tried: db.restaurant.find( {"Result.Grade" : "B"} )
But it will return back all document content with grade B.
Thanks!!
First argument in the
find
query is for filter. Use second argument and pass the fields you want to retrieve.With the mongodb node driver use
.project()
cursor method