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