[英]Mongodb extract documents if the time of element A is less than the time of element B in the same document
[英]MongoDB selecting documents where the maximum time is less than a constant
我正在尝试从最大时间少于超时的MongoDB中选择一组文档。
所以像这样的SQL
select distinct item_id where max(time) < 140034857
基本上,这是设备成功的comms操作的集合,我正在寻找在最近一小时内没有进行过的操作。
您可以使用$lt
运算符查找time
键的值小于指定值的文档。
db.Collection.find({"time" : {$lt: 140034857}})
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.