"user_crawls": {
"0": {
"_id": ObjectId("4e4b5e1c151c0d0336000093"),
"rand_id": "kPxMuXOY8Jfh6nXt",
"network": "tw",
"sourcenetwork": "874777",
"sourceName": "Krishna",
},
"1": {
"_id": ObjectId("4e4b5e1c151c0d0336000094"),
"rand_id": "kPxMuXOY8Jfh6nXt",
"network": "fb",
"sourcenetwork": "145875",
"sourceName": "Krishna",
},
"2": {
"_id": ObjectId("4e4b5e1c151c0d0336000095"),
"rand_id": "kPxMuXOY8Jfh6nXt",
"network": "fb",
"sourcenetwork": "145875",
"sourceName": "Ram",
}
我想選擇網絡爲fb且sourcename爲Krishna的文檔。從abouve數據通常我想獲得結果的第二文檔id爲Mongo mapper(Mongo DB)嵌入式文檔多字段搜索
4e4b5e1c151c0d0336000094
但我得到的所有記錄
我用下面的代碼來收集數據
DdNetworkCrawlLink.limit(10).all(:conditions => {'user_crawls.network' => "fb",'user_crawls.sourceName' => "Krishna")
感謝您的時間
Sreeraj
這不會產生任何問題,我的問題不是 – Sreeraj