mongodb - MongoDB - 仅在日期时间中使用 $lte 数小时
问题描述
我的数据如下所示:
/* 1 */
{
"_id" : ObjectId("5b62f97e3c2094eefa912aba"),
"FietsID" : 1267,
"Stad" : "Antwerpen",
"Accelerometer" : 1.0,
"Decibel" : null,
"Datum" : ISODate("2017-06-06T05:45:06.000Z"),
"Location" : {
"type" : "Point",
"coordinates" : [
22.50891,
48.54121
]
}
}
/* 2 */
{
"_id" : ObjectId("5b62f97e3c2094eefa9128cc"),
"FietsID" : 1971,
"Stad" : "Antwerpen",
"Accelerometer" : 1.0,
"Decibel" : 55,
"Datum" : ISODate("2017-06-11T18:17:21.000Z"),
"Location" : {
"type" : "Point",
"coordinates" : [
-38.23146,
-6.75194
]
}
}
我想获取时间低于 06:00:00、分贝高于 90 且仅安特卫普“Stad”的所有数据
我尝试使用聚合$dateToString
,但似乎我只能使用 1 个参数进行匹配。
解决方案
推荐阅读
- python - 如何使用 Python2.7 使用请求将 JSON 作为文件发送而不将文件写入磁盘?
- python-3.x - 边界和海岸线干扰 Python Cartopy
- python - 创建一个刽子手游戏
- html - 为什么背景没有覆盖整个 html 页面?
- php - php格式化中的数组
- scala - 如果Actor在一段时间内没有收到消息,如何关闭它?
- c# - 通过使用 c# Visual Studio 的 API 调用来遍历 JSON 数据
- css - 居中筛选具有最大高度和最大宽度的图像
- reactjs - 在生产中使用 nohup 是一种不好的做法吗?(如何永远运行服务器)
- sqlite - SQLite 多个左连接查询返回重复项