Reputation: 15180
If I have a mongodb containing this:
{ _id:ObjectId(0), name:"foo", hits:5 }
Will it get returned by this query:
find({name:"foo"}, {hits:1, flow:1})
If so, what will the returned object look like?
Upvotes: 1
Views: 314
Reputation: 311975
Yes it will, and it will look like this:
{ "_id": ObjectId("000000000000000000000000"), "hits": 5 }
name
is omitted because it's not included in the projection, but _id
is included by default.
Upvotes: 3