I'm just started to create my MongoDB schema (im newbie on mongo), my schema looks like this example:
users : [
{
_id : 11,
name : "jhon",
mail : "jhon@mail.com"
},
{
_id : 12,
name : "smith",
mail: "smith@mail.com"
}
]
I want to retrieve certain user information, bsaed on a _id
...
For example:
db.users.find({"users._id" : 11})
And then my result should be:
_id : 11,
name : "jhon",
mail : "jhon@mail.com"
but the result i get is all the users of the users
document, i just one one, the one who have certaint _id
.
How can i write a query for that?. And just in case, my schema is designed properly?
Thanks for the help! :)