[GODRIVER-710] Unmarshaling to a interface{} fails Created: 17/Dec/18  Updated: 28/Oct/23  Resolved: 19/Dec/18

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

Type: Bug Priority: Major - P3
Reporter: Eric Daniels (Inactive) Assignee: Kristofer Brandow (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

It fails with an invalid type being specified which in this case is 0x00 when using the empty interface decoder. It seems like a good default would be to instead do ReadDocument and set the interface{} to a bson.D



 Comments   
Comment by Githook User [ 19/Dec/18 ]

Author:

{'username': 'skriptble', 'email': 'kris@mongodb.com', 'name': 'Kris Brandow'}

Message: Allow decoding top level into interface{}

GODRIVER-710

Change-Id: Id67ea6d4e8a6ee2968dc8b6acf282618715d1e03
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/f43e26706b8bc1597b9a2180c4a90c0af912a847

Comment by Kristofer Brandow (Inactive) [ 18/Dec/18 ]

Code Review: https://review.gerrithub.io/c/mongodb/mongo-go-driver/+/437723.

Comment by Kristofer Brandow (Inactive) [ 17/Dec/18 ]

To fix this, we need to register primitive.D as the Go type for BSON type 0 in the type map.

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