Database
[{"id":"1","emp_name":"emp1","data":{"emp_country":"country1","emp_city":"city1"}},{"id":"2","emp_name":"emp2","data":{"emp_country":"country2","emp_city":"city2"}},{"id":"3","emp_name":"emp3","data":{"emp_country":"country1","emp_city":"city1"}}]
Query
db.collection.aggregate([{"$group":{"_id":"$data"}},{"$replaceRoot":{"newRoot":"$_id"}}])