[SERVER-10086] Set operations for Aggregation Framework $project Created: 03/Jul/13 Updated: 02/Aug/18 Resolved: 09/Aug/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | None |
| Fix Version/s: | 2.5.2 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Stennie Steneker (Inactive) | Assignee: | Gregory McKeon (Inactive) |
| Resolution: | Done | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Participants: | |||||||||||||
| Description |
|
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 |
| Comments |
| Comment by auto [ 09/Sep/13 ] |
|
Author: {u'username': u'dannenberg', u'name': u'matt dannenberg', u'email': u'matt.dannenberg@10gen.com'}Message: |
| Comment by auto [ 26/Aug/13 ] |
|
Author: {u'username': u'dannenberg', u'name': u'matt dannenberg', u'email': u'matt.dannenberg@10gen.com'}Message: |
| Comment by auto [ 13/Aug/13 ] |
|
Author: {u'username': u'dannenberg', u'name': u'matt dannenberg', u'email': u'matt.dannenberg@10gen.com'}Message: also may fix SERVER 10496 |
| Comment by auto [ 09/Aug/13 ] |
|
Author: {u'username': u'dannenberg', u'name': u'matt dannenberg', u'email': u'matt.dannenberg@10gen.com'}Message: |
| Comment by Scott Roberts [ 17/Jul/13 ] |
|
One utility feature that could be useful is to transform a list (which I am assuming is being treated as a multiset/bag) to a set. This would prevent me from having to explode and combine a list into a set. If something was already a set and you performed the $distinct/$asSet/etc then it would just be a no-op. Another way to look at this is adding a $distinct to projection rather than unwind->group. This could be useful outside of just set operation as well. |