0
我有一個Bson,其中嵌入文檔遵循以下結構。我想知道如何在特定日期獲取變量的值(「2014-08-09」:53.0)或庫存值(「2014-08-09」:0.0) 。在MongoDB中查詢嵌入文檔
{
"_id" : ,
"last_modified" : "",
"client" : "",
"credentials" : [],
"tags" : [],
"variables" : [
{
"name" : "sales",
"_values" : {
"2014-08-09" : 53.0,
...
},
"tags" : [],
"is_target" : true,
"method1" : "",
"method2" : "",
"vtype" : ,
"index_type" :
},
{
"name" : "inventory",
"_values" : {
"2014-08-09" : 0.0,
...
},
"tags" : [],
"is_target" : ,
"method1" : "",
"method2" : "",
"vtype" : ,
"index_type" :
},
{
"name" : "price",
"_values" : {},
"tags" : [],
"is_target" : ,
"method2" : "",
"method1" : "",
"vtype" : ,
"index_type" :
}
}
}