su
# mount -o rw,remount /
# mount -o rw,remount /system
# mount -o rw,remount /system/xbin
但我收到该消息错误:
db.hello.aggregate([
{ $match: { "name": "btb" } },
{ $where: function() {
today = new Date();
today.setHours(0,0,0,0);
return (this.date.getTimestamp() >= today)
}},
{ $group: {
_id: { articles: "$articles" },
total: { $sum: 1 }
}},
{ $project: {
"articles": 1,
"total": 1
}},
{ $sort: { "total":-1 } }
])
答案 0 :(得分:1)
尝试
db.collection.find({ createdAt: { $lte: new Date() , $gte: new Date(ISODate().getTime() - 1000 * 60 * 18)} })`
18分钟前(从现在开始)
答案 1 :(得分:0)
我通常会这样获取数据:
db.mycollection.find(
{ "createdAt" :
{
"$gte" : new Date("2013-10-01T00:00:00Z"),
"$lt" : new Date("2013-10-02T00:00:00Z") }
})
$gte
更大
$lt
的花费少于