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

Add function to marshal generic BSON values

    • Type: Icon: New Feature New Feature
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.2.0
    • Affects Version/s: None
    • Component/s: BSON
    • None

      Our BSON library has bson.Marshal which will take interface{} and create a BSON document. We do not have a function like bson.MarshalValue to take interface{} and create an arbitrary BSON value (not necessarily a document). This is something that could be useful as part of an implementation for MarshalBSONValue for a struct type. See GODRIVER-1340 for a use case.

      I wrote up a code sample to show a use of this and how it's handled now: https://gist.github.com/divjotarora/5bc3b6f85ef1030df6db83648c91dea6

      CC craiggwilson may.hoque Craig mentioned that this could be useful for Data Lake (something about marshalling aggregation pipelines, which are arrays). Can you elaborate on the use case?

            Assignee:
            divjot.arora@mongodb.com Divjot Arora (Inactive)
            Reporter:
            divjot.arora@mongodb.com Divjot Arora (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: