[GODRIVER-580] Need to be able to unmarshall to bson.D field within a struct Created: 20/Sep/18  Updated: 28/Oct/23  Resolved: 15/Jan/20

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.3.0

Type: New Feature Priority: Major - P3
Reporter: David Golden Assignee: Isabella Siu (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on GODRIVER-413 Implement Improved BSON Design Closed
Related
is related to GODRIVER-1216 mgo compatible bson registry Closed

 Description   

One of the data types in the tools resembles this:

noformat
type foo struct

{ Bar *bson.D }

noformat

Even with the Stitch-based patches to mgo/bson, this fails unmarshaling with the error "reflect.MakeSlice of non-slice type".

(N.B. Changing the Bar field to *bson.M works.)

This ticket is a reminder that after the planned changes to the BSON encoder and mgobson, we need this particular use case to work to help users who want to use mgobson as a stepping stone converting to the Go driver.



 Comments   
Comment by Isabella Siu (Inactive) [ 15/Jan/20 ]

Fixed as part of the mgo compatible bson epic

Generated at Thu Feb 08 08:34:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.