У меня есть следующая структура документа
{
"model" : {
},
"_id" : ObjectId("538df963d1c3f82329000257"),
"email" : "[email protected]",
"name" : "sam",
"endpointarn" : "arn:aws:sns:us-east-1:284585229836:endpoint/GCM/Positivethinking/59eb7c66-c13c-3e44-af80-0b1f4f7ea9fd",
"devregidtoken" : "APA91bFMOBo6ZWemMAG5clKEd5VYVvbeDOM5zNXjbbl3faSE0FZt3gtJYv0hpjdWuOY-mvr-k3sCcq0dEveCM6jx5mOh1u6JEubuUmKb2zU64dn_A4gJ4pCBG7AGQJ8DnkO83Ca4wgzsoJcio9T-TtA",
"topicsubs" : [
{
"topicsubid" : "arn:aws:sns:us-east-1:284585229836:Wealth-ProsperityQuotes:5f3e8060-48fa-4a8e-bdc3-e9596747da1a",
"topicname" : "Wealth-Prosperity",
"topicno" : 0
}
],
"timecreated" : ISODate("2014-06-03T16:35:47.442Z"),
"purchasedata" : {
"orderid" : "111",
"packagename" : "",
"productid" : "",
"purchasetime" : "",
"purchasestate" : "",
"developerpayload" : "",
"purchasetoken" : ""
},
"ccode" : "",
"ccodestat" : ""
}
Я хочу получить все документы, где purchaseata.orderid не является NULL. Я пробовал
db.User.find({"purchasedata.orderid" : {$ne : ""}});