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

Add function to marshal generic BSON values

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2.0
    • Component/s: BSON
    • Labels:
      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 Craig Wilson 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

            Assignee:
            divjot.arora Divjot Arora
            Reporter:
            divjot.arora Divjot Arora
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: