So I have these mongo fields
"username" : "aaaaaa",
"emails" : [
{
"address" : "[email protected]",
"verified" : false
}
],
"profile" : {
"firstname" : "a",
"lastname" : "a"
}
I can do
db.users.find({username:'aaaaaa'});
My question is, how about if I want to use the email address or profile's firstname?
It seems like this
db.users.find({email:{firstname:'[email protected]'}});
but it doesn't work. and I can't use
email['address']:'[email protected]'
or even
profile:{firstname:'a'} // profile.firstname:'a';
How can I get only their value?