Skip to content

Add MarshalJSON methods to *Document / *Array #49

@AlekSi

Description

@AlekSi

Blocked by https://jira.mongodb.org/browse/GODRIVER-3476. After that is resolved, we should re-enable fuzzing; see references to this issue.

In some cases, we need JSON representation of Document/Array, not JSON-like like we currently have. For example, extension functions accept BSON or JSON, and logging their parameters in JSON would make it easier to copy and paste them from logs to the psql console.

Let's implement encoding/json.Marshaler on *Document and *Array.
Let's do the basic JSON for now, but document the fact that the exact JSON representation may change. For example, we might use Extended JSON v2 in the future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    code/featureSome user-visible feature is not implemented yet

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions