[SERVER-14340] Option for $addToSet to work on array members Created: 24/Jun/14 Updated: 03/Feb/16 Resolved: 04/Nov/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | 2.6.3 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Martin Skøtt | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Participants: | |||||||||
| Description |
|
It would be very usefull if $addToSet in $group had an option to add members of an array to the set similar to the $each modifier to the $addToSet update modifier. Something like $group: {..., mySet: {$addToSet: {$each: "$myArrar"}}} |
| Comments |
| Comment by Charlie Swanson [ 04/Nov/15 ] |
|
I'm closing this ticket as it appears to be a duplicate of SERVER-16284. Feel free to re-open and clarify the difference(s) if you disagree. |
| Comment by Asya Kamsky [ 08/Apr/15 ] |
|
ms@addwish.com is this so you can avoid $unwind (you have mixed arrays and non-arrays? Normally this could be handled via $unwind followed by $group with $addToSet. Can you describe your use case - there be a different way to accomplish this. |