[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:
Duplicate
duplicates SERVER-8088 $unwind of non-array should be allowed Closed
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.


Generated at Thu Feb 08 03:26:34 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.