How to perform $out in an aggregation in mongoose?
问题 I looked for documentation of how to perform $out in an aggregation but I didn't find. This is my query: Top.aggregate([ {$sort: {created: -1}}, {$group: {_id:'$location', title:{$push: '$title'}}}, {$project: {location: '$location', mostRecentTitle: '$title'}}, {$out: "aggr_out"} ]).exec(function(err, docs) { console.log(docs); console.log(err) }); Schema: var schema = mongoose.Schema({ location: {type: String}, title: {type: String}, created: {type: Number, default: Math.floor(new Date() /