[GODRIVER-1846] Have bsoncore.Array marshal into an array type instead of an embedded document Created: 21/Jan/21 Updated: 28/Oct/23 Resolved: 10/Feb/21 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 1.5.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Kevin Albertson | Assignee: | Benji Rewis (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
Currently bsoncore.Array marshals into an embedded document instead of an array. An example:
Marshaling CursorDocs to BSON, then unmarshaling it back to Cursor, and marshaling it to BSON again results in "firstBatch" being BSON type 03 embedded document instead of the expected 04. This is due to bsoncore.Array being a type alias of bsoncore.Document. One suggestion is to change the type alias to be type Array Document and having a separate codec for the Array type. |
| Comments |
| Comment by Kevin Albertson [ 11/Feb/21 ] |
|
Cherry-picked onto release/1.5 with https://github.com/mongodb/mongo-go-driver/commit/fda5d252856ea9eb101422b00f9756f2e11ab45b |
| Comment by Githook User [ 10/Feb/21 ] |
|
Author: {'name': 'Benjamin Rewis', 'email': '32186188+benjirewis@users.noreply.github.com', 'username': 'benjirewis'}Message: |
| Comment by Benji Rewis (Inactive) [ 01/Feb/21 ] |