-
Type:
New Feature
-
Resolution: Won't Do
-
Priority:
Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
None
-
Go Drivers
-
None
-
None
-
None
-
None
-
None
-
None
Go Driver v2 changed the default decoding for documents to bson.D from map[string]any, which was the default in v1. You can get close to the old behavior by creating a new decoder and setting DefaultDocumentM() on it. That's not quite the same, though, because it decodes to bson.M and not map[string]any. (bson.M has map[string]any as its underlying type, but it isn't strictly an alias.)
This short program demonstrates the difference. Upgrading to v2 causes some mongosync tests to fail because they expect a map[string]any and are now getting a bson.M. (I can plausibly update the failing tests, but we prohibit bson.M in general in mongosync, so that linting rule will require an update.)
- related to
-
GODRIVER-2819 Make BSON decode to bson.D if there is no type information
-
- Closed
-