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

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Aggregation Framework
    • Query Execution
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      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"]}]}
      }
      }
      ]);
      

            Assignee:
            [DO NOT USE] Backlog - Query Execution
            Reporter:
            Jacob Ribnik
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: