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

Provide a Symmetric Difference operator to new set operators in aggregation framework

    XMLWordPrintable

    Details

    • Case:

      Description

      In the new set operators, there is not a symmetric difference operator. This is one of the 4 main operators (in addition to intersection, union, and relative complement) on sets that it seems should be part of the new set operators.

      It probably would make sense to call this operator $setSymmetricDifference in order to follow the C++ naming convention of these operators.

      There is currently a work around, but it is much slower than implementing in code:

      db.colors.aggregate([
      {'$project': { 
      diff:{$setUnion:[{$setDifference:["$left","$right"]}, {$setDifference:["$right","$left"]}]}
      }
      }
      ]);
      

        Attachments

          Activity

            People

            Assignee:
            backlog-query-execution Backlog - Query Execution
            Reporter:
            jacob.ribnik Jacob Ribnik
            Participants:
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

              Dates

              Created:
              Updated: