[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{} Change-Id: Id67ea6d4e8a6ee2968dc8b6acf282618715d1e03 |
| 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. |