I have a record in my collection and I want to fetch the details of the person whose id is 1. But I am getting the details for 2times instead of 1.
db.m
person is an array. If you want to get first element of this array you should use $slice
person
db.mycollection.findOne({"person.id":1},{"person":{$slice:[0,1]},"_id":0})