Commit Graph

3 Commits

Author SHA1 Message Date
Charlie Swanson
c7ddaa120d SERVER-20168 Empty array should not be present in document after $unwind 2015-10-07 16:11:46 -04:00
Charlie Swanson
9c46f95145 SERVER-20595 The includeArrayIndex option to $unwind should specify a path 2015-10-07 16:11:45 -04:00
Charlie Swanson
522f5a2bff SERVER-4588 Add option to $unwind stage to include array index in output
Adds a includeArrayIndex option to the $unwind stage. If this option is
specified, the $unwind stage will output values with the structure {index:
<array index>, value: <array value>} instead of just the array value.

Note this does not affect the behavior non-arrays or empty arrays. If
includeArrayIndex and preserveNullAndEmptyArrays are both specified, values
from a non-empty array will have an index attached, and all other values will
pass through unchanged.
2015-09-11 15:30:11 -04:00