Database
[{"id":1,"empName":"emp1","emp_city":"city1"},{"id":2,"empName":"emp2","emp_city":"city1"},{"id":3,"empName":"emp1","emp_city":"city1"},{"id":4,"empName":"emp1","emp_city":"city2"}]
Query
db.collection.aggregate([{$group:{_id:{empName:"$empName",emp_city:"$emp_city"}}},{"$replaceRoot":{"newRoot":"$_id"}}])