我有一些日期相似的数据:
2013-03-26 05:33:15
2013-03-26 16:48:39
...
我不想用默认的Date()方式将它们与我的查询进行比较。因为我只想知道白天是否匹配(小时:分钟+/-10分钟)。你知道吗
例如,如果我查询05:28:15
,它应该返回包含“2013-03-26 05:33:15
”的条目
我一直在尝试使用关键字“customizemongodb query”查找一些提示,但没有得到任何结果。你知道吗
我想知道这是可能的还是有其他选择。你知道吗
Tags:
我会花你想要的时间来查找和减去/添加你的公差,并使用范围进行搜索:
输出:
您可以使用
$where
子句查找小时和分钟范围内的所有匹配项。例如,我们要匹配05:28+/-10分钟:相关问题 更多 >
编程相关推荐