Example first:
{ "_id" : ObjectId("4f086809bf28fd7bb56e6059"), "admins" : [ "4ef8e785b2694c3649000001" ], "pages" : [
{
"pagename" : "home",
"title" : "homepage",
"default" : true
},
{
"pagename" : "people",
"title" : "Staff",
"default" : false
}
], "sitename" : "Site", "sitenameLower" : "site" }
So that's the document I'm querying, now what I want is to return the 'page' where pagename = 'home'.
I've tried various queries but it always returns the whole document and not the individual object inside the pages array - which is not much use to me.
Including:
db.sites.find({'pages.pagename' : 'home'});
I can see, why this is wrong, but getting it right, is perplexing me.