Nested select in Mongoose Query
You want to use something like this:
db.collection.aggregate([ { $match: { $expr: { $gte: [ "$pickup_date", { "$subtract": [ "$$NOW", 604800000 ] } ] } } }, { $group: { _id: { year: { $year: "$pickup_date" }, month: { $month: "$pickup_date" }, day: { "$dayOfMonth": "$pickup_date" } }, count: { $sum: 1 } } }, { $project: { count: 1, _id: 0, event_date: { "$concat": [ { "$toString": "$_id.day" }, "/", { "$toString": "$_id.month" }, "/", { "$toString": "$_id.year" } ] } } }])