MongoDB
 sql >> Base de données >  >> NoSQL >> MongoDB

Supprimer _Id de la réponse globale de la mangouste

Comme ça

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

});