Allow $cond to accept longer arrays

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Unresolved
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Aggregation Framework
    • Query Optimization
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      Why not allow the array form of $cond to accept longer arrays of if-then-elseif-then conditions? Instead of restricting it to only accepting arrays of length 3, it could accept any array of length 2*n + 1, with obvious interpretation:

      { "$cond": [ if, then, elseif, then, elseif, then, ..., else ] }

      . This is clearer and simpler than having to nest multiple $cond terms.

            Assignee:
            [DO NOT USE] Backlog - Query Optimization
            Reporter:
            Kevin Perry
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: