-
Type: Improvement
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: BSON
-
None
Currently the standard string representation of the bson.D and bson.M types is not overridden and simply uses the formatter default representation. However, printing extended JSON would be much more useful because it doesn't lose type information and is human-readable and standardized.
This is a backward-breaking change so cannot be completed in the v1.x Go Driver.
See a Go playground example of the default string representations, JSON, and extended JSON representations.
Definition of done:
- The bson.D.String and bson.M.String functions should return a relaxed Extended JSON representation of the document.
- All Go types that implement BSON types (e.g. Regex, ObjectID, etc) have a String function that returns valid relaxed Extended JSON representation of the value.
- depends on
-
GODRIVER-2618 Create an "extjson" package for the Extended JSON marshaler/unmarshaler
- Closed
- is related to
-
GODRIVER-1765 Add MarshalJSON/UnmarshalJSON functions for bson.D
- Closed
- related to
-
GODRIVER-2790 Make "bson.D" implement "json.Marshaler" and "json.Unmarshaler"
- Closed