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

Set operations for Aggregation Framework $project

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.5.2
    • Affects Version/s: None
    • Component/s: Aggregation Framework
    • Labels:

      Currently set operations require several steps of pipeline manipulation to produce the desired result. For example, see StackOverflow: How to use MongoDB aggregation for general purpose set operations (union, intersection, difference).

      This is a feature request to add some new operations for more efficient processing in a $project pipeline stage:

      1) $seq - similar to $eq, takes two sets and returns true if equal, false if not. If two lists are passed in, treat as multi-set
      2) $ssub - is the first set a subet of the second, returns true if so
      3) $sint - takes in two sets and provides the intersection of the two
      4) $sdiff - provides the symetric difference between two sets
      5) $sunion - provides the union of two sets

            greg.mckeon@mongodb.com Gregory McKeon (Inactive)
            stephen.steneker@mongodb.com Stennie Steneker (Inactive)
            1 Vote for this issue
            9 Start watching this issue