|
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.
|