-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Aggregation Framework
-
None
-
Fully Compatible
-
Quint Iteration 4, Quint Iteration 5
I need to count the number of duplicate IDs that occur across all documents in a collection. However, this very simple aggregation is complicated by the fact that the IDs in question may appear in multiple fields in the input document.
Suppose I have input documents like the one below:
{ a : [1, 2, 3], b : [2, 4, 5] }
I'd like to transform this to a document that looks like:
{ c : [1, 2, 3, 2, 4, 5] }
From this point, it is straightforward to unwind and group on c to get to the desired result.
The above transformation is similar to what would be achieved using the $setUnion operator, but here I do not want to filter out duplicate values.
Therefore, this request is for an operator similar to $setUnion but which does not filter out duplicate values.
- is duplicated by
-
SERVER-5919 Add set/array operations to $unwind in new aggregation framework
- Closed
- is related to
-
SERVER-17258 Add $reduce expression operator for rollup of arrays
- Closed
- related to
-
CSHARP-1364 Aggregation pipeline project expression operator to concatenate multiple arrays into one
- Closed
-
DRIVERS-234 Aggregation Builder Support for 3.2
- Closed