Here's my mongodb document:
{ "FRIENDS" : [
{ "LOC" : "13.039064033333332,77.5547927", "NAME" : "A1", "PHONE_NUMBER" : "817361155" } ],
"MYID" : "349512956",
"MYLOCATION" : "13.0389541,77.5549799",
"OCCASION" : "cafe",
"_id" : ObjectId("503d87150f43159357000001"),
"average" : "13.0389541,77.5549799" }
Here's my query
> db.test_collection.find({"MYID":"349512956"},{"FRIENDS.PHONE_NUMBER":"817361155"});
and the output
{ "FRIENDS" : [ { "PHONE_NUMBER" : "817361155" } ], "_id" : ObjectId("503d87150f43159357000001") }
However, I want the entire friend document included in the result. LOC, NAME, PHONE_NUMBER. How do I get these ? Any help will be greatly appreciated. I'm searching through the monogo docs but am unable to find my answer.