-
Type:
Bug
-
Resolution: Done
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Aggregation Framework
-
None
-
ALL
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
-
None
I have below users collectionI have below users collection
[{ "_id": 1, "adds": ["111", "222", "333", "111"] }, { "_id": 2, "adds": ["555", "666", "777", "555"] }, { "_id": 3, "adds": ["888", "999", "000", "888"] }]
I need to find the duplicates inside the `adds` array
The expected output should be
[{ "_id": 1, "adds": ["111"] }, { "_id": 2, "adds": [ "555"] }, { "_id": 3, "adds": ["888"] }]
I have tried using many operators `$setUnion`, `$setDifference` but none of the did the trick.