Answer the question
In order to leave comments, you need to log in
How to remove duplicate fields in MongoDb?
Hello.
The names collection contains shortname documents, they contain arrays, and they contain double lines, how can I remove them?
Looks like this:
db.names.shortname.0.uid: 100
db.names.shortname.1.uid: 101
db.names.shortname.2.uid: 102
db.names.shortname.3.uid: 100
db.names .shortname.4.uid: 101
db.names.shortname.5.uid: 102
The array is large, inside several documents, how can I remove duplicates from the array?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question