You can use below aggregation query.
$$ROOT to keep the whole document per each name followed by $replaceRoot to promote the document to the top.
db.col.aggregate([
{"$group":{"_id":"$name","doc":{"$first":"$$ROOT"}}},
{"$replaceRoot":{"newRoot":"$doc"}}
])