-
Type: Improvement
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.5.3
-
Component/s: Aggregation Framework
-
None
Apparently there are cases where fields can be single values or they can be arrays of values.
There's cases where you want to normalize it and since there is no way to turn a single element into array of one in aggregation (if there was that would help this use case) then maybe there can be a way to call $unwind on arrays without non-array documents causing an error "Value at end of $unwind field path '$a' must be an Array".
To not change current behavior maybe it can be an optional parameter to $unwind $ignoreNonArrays:true or something like that.
- duplicates
-
SERVER-8088 $unwind of non-array should be allowed
- Closed