[CSHARP-1173] Aggregation Framework needs to support $addToSet and $push inside a Group expression tree Created: 28/Jan/15 Updated: 02/Apr/15 Resolved: 28/Jan/15 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 2.0 |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Craig Wilson | Assignee: | Craig Wilson |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
Currently, the only 2 accumulators we do not support are $push and $addToSet. We could implement these in a simple manner with the following syntax. For $push:
And for $addToSet:
|
| Comments |
| Comment by Githook User [ 28/Jan/15 ] | ||||||
|
Author: {u'username': u'craiggwilson', u'name': u'Craig Wilson', u'email': u'craiggwilson@gmail.com'}Message: | ||||||
| Comment by Githook User [ 28/Jan/15 ] | ||||||
|
Author: {u'username': u'craiggwilson', u'name': u'Craig Wilson', u'email': u'craiggwilson@gmail.com'}Message: | ||||||
| Comment by Craig Wilson [ 28/Jan/15 ] | ||||||
|
An alternative for the first one is that if it's just g.Select(x => x.City), then we know use a $push implicitly without any extra direction. It would certainly lower the error rate by just doing what they think they want anyway. For $push:
|