Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-2591

Make all BSON types (bson.D, bson.M, bson.Regex, etc) default string representation Extended JSON

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • 2.0.0
    • Affects Version/s: None
    • Component/s: BSON
    • Labels:
      None
    • Major Change
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      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.

            Assignee:
            qingyang.hu@mongodb.com Qingyang Hu
            Reporter:
            matt.dale@mongodb.com Matt Dale
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated: