我需要更改以下mongodb查询的输出格式。
查询
db.Response.aggregate([{
"$match": {
"$and": [{
"job_details.owner_id" : 482,
}, {
"job_details.owner_type" : 'searches',
}],
},
},
{
"$group": {
"_id": "$candidate_sublocation_name_string",
"count": {
"$sum": 1,
},
},
}])
实际输出
{ "_id" : "Central Delhi ", "count" : 1 }
{ "_id" : "Adyar ", "count" : 1 }
{ "_id" : "Bommanahalli", "count" : 2 }
{ "_id" : "DLF Phase 3 ", "count" : 2 }
{ "_id" : "Aai Colony", "count" : 1 }
需要出局
{ "Central Delhi" : 1 }
{ "Adyar" : 1 }
{ "Bommanahalli" : 2 }
{ "DLF Phase 3 ": 2 }
{ "Aai Colony": 1 }
是否可以更改这样的输出格式..?