MongoDB
 sql >> Base de Dados >  >> NoSQL >> MongoDB

Remover _Id da resposta agregada do mangusto


Assim
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 () {

});