|
Our bson.D type doesn't support converting to/from JSON via the stdlib json.Marshal and json.Unmarshal functions. This causes issues for users with interface{} in their structs because the driver decodes BSON documents as bson.D when the target type is interface{}. If the user then tries to marshal the struct as JSON, the resulting JSON is an array of documents because bson.D is internally represented as a slice of structs.
Definition of done:
- bson.D implements the json.Marshaler and json.Unmarshaler interfaces and output a key-value representation of the bson.D in "regular" (i.e. non-Extended) JSON.
|