[GODRIVER-2260] UpdateMany doesn't support links to existing fields Created: 28/Dec/21 Updated: 27/Oct/23 Resolved: 20/Jan/22 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | Core API |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Unknown |
| Reporter: | Apocalypsy . | Assignee: | Benji Rewis (Inactive) |
| Resolution: | Gone away | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Description |
| Comments |
| Comment by PM Bot [ 20/Jan/22 ] |
|
There hasn't been any recent activity on this ticket, so we're resolving it. Thanks for reaching out! Please feel free to comment on this if you're able to provide more information. |
| Comment by Benji Rewis (Inactive) [ 05/Jan/22 ] |
|
Hello again, slavik-undead@mail.ru. As of MongoDB 4.4, update functions (such as the UpdateMany you're using), can now be used with aggregation pipelines and their associated stages. To use $set with UpdateMany as you've done above, you'll have to make sure the "update" parameter to UpdateMany is actually an aggregation pipeline. In other words, the "update" parameter must be an array not a single document. You should get the behavior you're looking for if you encase the bson.D containing the $set with a bson.A. I've attached an example of how that might look given your example code. Let me know if that works! |
| Comment by Benji Rewis (Inactive) [ 04/Jan/22 ] |
|
Thanks for your bug report, slavik-undead@mail.ru! We're taking a look now. |