我被卡住了,不知道该怎么做我有一个 mongodb 服务器,它存储来自 pandas 数据帧的打开高低关闭量我试图弄清楚如何在不指定日期时间的情况下查询每个文档并仅获取值邮票。我是 mongodb 的新手,不完全确定该怎么做
"_id" : ObjectId("5d7d5aa984323fa67c2e9002"),
"exchange" : "binance",
"instrument" : "XRPUSDT",
"timeframe" : "1d",
"candles" : {
"2019-09-06:0000" : {
"open" : 0.25616,
"high" : 0.25868,
"low" : 0.24692,
"close" : 0.2511,
"volume" : 63377736.0
},
"2019-09-07:0000" : {
"open" : 0.25115,
"high" : 0.26285,
"low" : 0.25009,
"close" : 0.25993,
"volume" : 53971229.0
},
"2019-09-08:0000" : {
"open" : 0.25989,
"high" : 0.26591,
"low" : 0.2555,
"close" : 0.26205,
"volume" : 65033003.0
}
"_id" : ObjectId("5d7d74925bff7734c6c348a0"),
"exchange" : "binance",
"instrument" : "XRPUSDT",
"timeframe" : "1d",
"candles" : {
"2019-09-06:0000" : {
"open" : 0.25616,
"high" : 0.25868,
"low" : 0.24692,
"close" : 0.2511,
"volume" : 63377736.0
},
"2019-09-07:0000" : {
"open" : 0.25115,
"high" : 0.26285,
"low" : 0.25009,
"close" : 0.25993,
"volume" : 53971229.0
},
"2019-09-08:0000" : {
"open" : 0.25989,
"high" : 0.26591,
"low" : 0.2555,
"close" : 0.26205,
"volume" : 65033003.0
}
例如,我希望每个文档中的 close 值如何在 python3 中查询 mongodb 以返回类似 ["close": 0.2511, 0.25993, 0.26205, 0.2511, 0.25993, 0.26205]
并从每个文档中获取所有时间戳,例如 [2019-09-06:0000, 2019-09-07:0000, 2019-09-08:0000, 2019-09-06:0000,2019-09-06:0000, 2019-09-07:0000, 2019-09-08:0000]