Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-11718

Allow aggregation framework to optionally pass through non-arrays through $unwind

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 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.

            Assignee:
            Unassigned Unassigned
            Reporter:
            asya.kamsky@mongodb.com Asya Kamsky
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: