[JAVA-3835] $set aggregation function is missing Created: 09/Sep/20 Updated: 28/Oct/23 Resolved: 17/Jun/21 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Builders |
| Affects Version/s: | None |
| Fix Version/s: | 4.3.0 |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Matthew Shaylor | Assignee: | Jeffrey Yemin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Documentation Changes: | Needed |
| Description |
|
I'm trying to do a $set from java, I'd expect to be able to write something like:
Am I missing something? Could this be added? Thanks! |
| Comments |
| Comment by Githook User [ 17/Jun/21 ] |
|
Author: {'name': 'Matthew', 'email': 'github@shaylor.co.uk', 'username': 'Gaff'}Message: Add $set method to Aggregates (#574) Co-authored-by: mshaylor <mshaylor@mercuria.com> |
| Comment by Jeffrey Yemin [ 09/Sep/20 ] |
|
Currently we only have helpers for aggregation stages, not the operators, of which there are a lot more. |
| Comment by Matthew Shaylor [ 09/Sep/20 ] |
|
Aha - I guess that's what I was missing! I will use the workaround - but would be great if there was some more obvious clue about what's going on. @Jeffrey Yemin: I also can't find $map, is there a workaround for that or do I just need to build up the documents by hand? |
| Comment by Jeffrey Yemin [ 09/Sep/20 ] |
|
I think we didn't add it because, as stated in the documentation, it's an alias for $addFields, for which there is already a helper. So for now can you use that as a workaround? |
| Comment by Matthew Shaylor [ 09/Sep/20 ] |
|
Have create a simple PR for this: https://github.com/mongodb/mongo-java-driver/pull/574 |