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

Add IndentExtJSON and MarshalExtJSONIndent functions

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 1.8.0
    • None
    • BSON

    Description

      Add functions to marshal to pretty printed Extended JSON and to directly marshal to pretty printed Extended JSON.


      Original Issue:

      Currently, trying to call json.Marshal on a bson.D results in the document being marshalled as a standard array of structs; i.e. you end up with a JSON array of documents containing "Key" and "Value".

      I'm aware that the go driver also supports encoding to extended JSON, and that does work, but it's not as usable because it doesn't support indenting/pretty-printing.

      Attachments

        Activity

          People

            gabriela.asuncion@mongodb.com Gabby Asuncion
            bartle David Bartley
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: