[SERVER-11718] Allow aggregation framework to optionally pass through non-arrays through $unwind Created: 15/Nov/13 Updated: 15/Nov/13 Resolved: 15/Nov/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | 2.5.3 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Asya Kamsky | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Participants: | |||||||||
| Description |
|
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. |