Having this structure:
/* 0 */
{
"_id" : ObjectId("53f1f19a477aa5da607b20a4"),
"name" : "Anna"
}
/* 1 */
{
"_id" : ObjectId("53f1f192477aa5da607b20a3"),
"name" : "Josh",
"mother" : ObjectId("53f1f19a477aa5da607b20a4")
}
Is it possible get the complete document of mother instead get the ObjectId
. I mean, if i do this query:
db.tree.find({"name" : "Josh"})
i get the document of Josh, but i am not able to get the name of Anna because i should do another query. It's possible in mongodb get the complete tree/json of the documents when one of the field is refering to another document to avoid multiple queries?