MongoDB基于当前时间的操作

减数单位为毫秒

db.getCollection("Manifest").find({
"IsSuccess": true,
$and:[{"UpdateOn":{$gte:new Date(new Date()-7*24*60*60000)}},{"UpdateOn":{$lte:new Date(new Date()-3*24*60*60000)}}]
}).sort({ "UpdateOn": -1 })

原文地址:https://www.cnblogs.com/jeffhong99/p/10900866.html