I have this collection in my mongo db, here is the code that I have
> db.getCollection("[email protected]_shareds").find();
{
"_id":ObjectId("56479a5c37863e6c20000029"),
"uuid":{
"[email protected]":{
"collectionPermission":{
"buys":{
"read":true,
"write":true
},
"shops":{
"read":true,
"write":false
},
"buyers":{
"read":true,
"write":true
}
}
}
}
},
{
"_id":ObjectId("56479b6637863e6c2000002d"),
"uuid":{
"[email protected]":{
"collectionPermission":{
"buys":{
"read":true,
"write":true
},
"shops":{
"read":true,
"write":false
},
"buyers":{
"read":true,
"write":true
}
}
}
}
},
{
"_id":ObjectId("56479b7437863e6c20000030"),
"uuid":{
"[email protected]":{
"collectionPermission":{
"buys":{
"read":true,
"write":true
},
"shops":{
"read":true,
"write":false
},
"buyers":{
"read":true,
"write":true
}
}
}
}
}
I want to find the uuid equal to [email protected]
, these my test (failed)
db.getCollection("[email protected]_shareds").find({"uuid":{$eq:"[email protected]"}});
db.getCollection("[email protected]_shareds").find({uuid:{$eq:"[email protected]"}});
db.getCollection("[email protected]_shareds").find({"uuid":{"$eq":"[email protected]"}});
db.getCollection("[email protected]_shareds").find({"uuid":{$eq:[email protected]}});
and others....
always i have zero result...why?what is the correct find?