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

Improve usability of BSON binary types' "DebugString" output

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • 2.1.0
    • Affects Version/s: None
    • Component/s: BSON
    • None

      The DebugString methods in the bson package can be extremely useful for inspecting the structure of BSON documents in human-readable form. However, the output format could be better and the bson.Raw type is missing a DebugString method.

      Definition of done:

      • Change DebugString output format to something like
        document(len=length){ [type] "key" value, [type2] "key2" value2, ... }
        

        E.g. output:

        document(len=76){ [string] "key1" value, [64-bit integer] "key2" 1234, [UTC datetime] "key3" 1675282389, [embedded document] "key4" document(len=24){ [string] "nested" "value2" } }
        
      • Recursively convert nested values to DebugString format if it defines DebugString.
      • Add a DebugString method to the bson.Raw type.

            Assignee:
            Unassigned Unassigned
            Reporter:
            matt.dale@mongodb.com Matt Dale
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: