I've this collections
{
"name" : "montalto",
"users" : [
{
"username" : "ciccio",
"email" : "aaaaaaaa",
"password" : "aaaaaaaa",
"money" : 0
}
],
"numers" : "8",
"_id" : ObjectId("5040d3fded299bf03a000002")
}
If I want to search for a collection with the name of montalto and a user named ciccio I'm using the following query:
db.coll.find({name:'montalto', users:{username:'ciccio'}}).count()
But it does not work. Where I went wrong?