Reputation: 14997
{
"_id": ObjectId("502626aad4ebdf600b000000"),
"created_at": ISODate("2012-08-11T09: 32: 26.0Z"),
"excerpt": "lotto results for August 11, 2012",
"results": {
"1-digit" : {
"0" : "1",
},
"2-digit" : {
"0" : "1",
"1" : "2",
},
"3-digit" : {
"0" : "1",
"1" : "2",
"2" : "3",
}
}
}
How should I check if results.1-digit
exists?
Upvotes: 2
Views: 5713
Reputation: 1288
Adding quotes are as important in shell I believe
{"results.1-digit" : {$exists : true }}
Upvotes: 1
Reputation: 2916
You can run query {results.1-digit : {$exists : true }}
Hope it helps.
Upvotes: 9