假設我有以下文件中蒙戈:搜索在複雜的文件在蒙戈DB
{
"_id" : ObjectId("57e36c34eb2832aa68b39b26"),
"ap_domain" : "root",
"average_down" : 123,
"average_up" : 234,
"peak_down" : 123,
"peak_up" : 456,
"ssid_shaper_list" :
{
"SSID1" : {
"ssid_domain" : "root",
"peak_up" : 456,
"peak_down" : 456
},
"SSID2" : {
"ssid_domain" : "root",
"average_up" : 567,
"average_down" : 567,
"peak_up" : 456,
"peak_down" : 456
}
}
}
我需要檢查SSID2
存在於本文件。在這裏,我有3個鍵:
1. ap_domain = root
2. ssid_shaper_list = SSID2 and in it:
3. ssid_domain = root
我應該如何撰寫我的搜索條件在java中使用BasicDBObject來檢查需要SSIDi存在?
感謝您的回覆!但我必須考慮'ssid_domain'作爲第三個搜索參數。 – user1053031
@ user1053031:更新了答案。 – 4J41