[JAVA-3801] Updates nesting when using Combine Created: 28/Jul/20 Updated: 27/Oct/23 Resolved: 28/Jul/20 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Barron Anderson | Assignee: | Ross Lawley |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Java 1.8, Driver 3.12.5, MongoDB 3.6.14. |
||
| Description |
|
When using Updates.combine() on an existing Bson update object it seems to nest the updates in the driver. Is there a better way to combine (tack-on) additional update commands to an existing update Bson object?
Example Code:
Example output:
|
| Comments |
| Comment by Ross Lawley [ 28/Jul/20 ] | ||||||||||||||
|
Thanks barron.anderson, Looks like I jumped the gun, asking you to add this ticket, the toString just outputs the updates, which in this case causes some recursion. As the Bson data is created as expected:
So closing as works as designed. An alternative way to use the API which produces a less scary toString() result would be:
|