我想要deliveryDate大于等于当前日期但在mongodb中不起作用的数据。我的deliveryDate以这种格式存储在“ 11.8.2018”中。
collection.aggregate([
{
$match: {"deliveryDate" : { $gte: new Date(new Date().setDate(new. Date().getDate()-2)) }
},{
$group: {
_id:{
year: { $year: "$createdDate" },
month: { $month: "$createdDate" },
day: { $dayOfMonth: "$createdDate" },
time: { $dateToString: { format: "%H:%M:%S:%L", date: "$createdDate" }},
partialAmount : "$partialAmount",
balanceAmount : "$balanceAmount"
}
}
},
])}
但是如果我指定创建日期而不是deliveryDate,则此方法不起作用,那么它正在起作用,但我要根据deliveryDate要求。
我想要deliveryDate大于等于当前日期但在mongodb中不起作用的数据。我的deliveryDate以这种格式存储在“ 11.8.2018”中。 collection.aggregate([{$ match:{“ ...
请考虑以下两个输入文档: