I have a simplified collection structure below for simplicity's sake. I am unable to query the specific sub-documents under the profile field.
For example, I want to find the sub-document "profiles.Bernie". Is there a find() query that will allow me to only retrieve the document for Bernie (i.e. category and id for Bernie)? Apologies if this is a duplicate, but I was unable to find solutions that catered the way this collection is structured below
{
"_id" : ObjectId("56aec822ceb6e9dc23d32271"),
"sm_user" : "user1",
"profiles" : {
"Bernie" : {
"category" : "Politics",
"id" : "bernie"
},
"Hilary" : {
"category" : "Politics",
"id" : "hilary"
}
}
}