I get duplicates of fields and subfield using aggregation. Searching for duplicated sub field "k01.v" works fine:
db.table_0.aggregate({"$group" : { _id: "$k01.v", "count": { "$sum": 1 } } }
{"$match": {"count" : {"$gt": 1} } }
{"$project": {"k01.v" : "$_id", "_id" : 0} });
Unfortunately, this doesnt work when searching for sub field "a1.0" (field "a1" is an array):
db.table_0.aggregate({"$group" : { _id: "$a1.0", "count": { "$sum": 1 } } }
{"$match": {"count" : {"$gt": 1} } }
{"$project": {"a1.0" : "$_id", "_id" : 0} });
Any workaround ?