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

Add function to marshal generic BSON values

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 1.2.0
    • BSON
    • None

    Description

      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?

      Attachments

        Activity

          People

            divjot.arora@mongodb.com Divjot Arora
            divjot.arora@mongodb.com Divjot Arora
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: