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

Allow $cond to accept longer arrays

    XMLWordPrintable

Details

    • New Feature
    • Status: Backlog
    • Minor - P4
    • Resolution: Unresolved
    • None
    • None
    • Aggregation Framework

    Description

      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.

      Attachments

        Activity

          People

            backlog-query-optimization Backlog - Query Optimization
            kperry Kevin Perry
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: