3 回答

TA貢獻(xiàn)1876條經(jīng)驗(yàn) 獲得超6個(gè)贊
Date
$add
:
db.collection.aggregate([ { "$group": { "_id": { "$add": [ { "$subtract": [ { "$subtract": [ "$current_date", new Date(0) ] }, { "$mod": [ { "$subtract": [ "$current_date", new Date(0) ] }, 1000 * 60 * 15 ]} ] }, new Date(0) ] }, "count": { "$sum": 1 } }}])
Date(0)
Date
.
Date

TA貢獻(xiàn)1802條經(jīng)驗(yàn) 獲得超5個(gè)贊
db.collection.aggregate([ {$match: {created_at:{$exists:1}}}, {$group: { _id: {$add:[ {$dayOfYear: "$created_at" }, {$multiply: [{$year: "$created_at"}, 1000]} ]}, count: {$sum: 1 } }}, {$sort:{_id:-1}}])
- 3 回答
- 0 關(guān)注
- 1806 瀏覽
添加回答
舉報(bào)