[GODRIVER-2232] bsoncore.Array not recognized as a valid type for aggregation pipelines Created: 15/Nov/21 Updated: 28/Oct/23 Resolved: 18/Nov/21 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 1.8.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Divjot Arora (Inactive) | Assignee: | Benji Rewis (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Documentation Changes: | Not Needed |
| Description |
|
The transformAggregatePipeline function treats bsoncore.Array as a simple []byte and tries to marshal each value in the slice as a document, which fails. It should have a special case to recognize that bsoncore.Array actually represents a single BSON array. This gist repros the issue. Executing it fails with this error:
|
| Comments |
| Comment by Githook User [ 17/Nov/21 ] |
|
Author: {'name': 'Benjamin Rewis', 'email': '32186188+benjirewis@users.noreply.github.com', 'username': 'benjirewis'}Message: |
| Comment by Benji Rewis (Inactive) [ 16/Nov/21 ] |
|
Good catch! Here's a fix: https://github.com/mongodb/mongo-go-driver/pull/807 |