MongoDB
 sql >> Database >  >> NoSQL >> MongoDB

Rimuovi _Id da mangusta Risposta aggregata

Così

Contacts.aggregate( [
    { $group: { "_id": { name: "$name",  city: "$city", state: "$state" } } },
    { $project: {_id: 0, name: '$_id.name', city: '$_id.city', state: '$_id.state'} },
    { $sort: { AgencyTranslation: 1 } },
    { $limit: req.query.limit | limit }
], function () {

});