-
Type: New Feature
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Aggregation Framework
-
None
-
Fully Compatible
-
Quint 9 09/18/15
There may be times when the index of an array element is interesting. $unwind
could provide an option to emit this. For example
instead of just
db.runCommand({ aggregate:"c", pipeline:[ { $unwind: "$arrayField"} ]});
consider also supporting something like this:
db.runCommand({ aggregate:"c", pipeline:[ { $unwind: { path: "$arrayField", includeArrayIndex: boolean }} ]});
The effect of this is the same except that it also adds a new field index
to the output which is assigned the index of the array element.
- depends on
-
DRIVERS-234 Aggregation Builder Support for 3.2
- Closed
- is depended on by
-
CSHARP-1433 Add option to $unwind to emit array index
- Closed
-
JAVA-1995 Add option to $unwind to emit array index
- Closed
- is duplicated by
-
SERVER-14565 New aggregation operators
- Closed
- is related to
-
SERVER-20595 Unwind with includeArrayIndex produces different structure results for arrays and non-arrays
- Closed