ExportXMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Unresolved
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: BSON
    • None
    • None
    • Go Drivers
    • None
    • None
    • None
    • None
    • None
    • None

      This library contains a RawValueTo() generic function that simplifies the work of converting a RawValue to a Go value.

      It’d be sweet if the driver had the same thing for Go 1.27+, e.g.:

      ts, err := rv.As[bson.Timestamp]()
      

      The same file contains a ToRawValue() function that could nicely be a static `bson.RawValue.From()` generic function.

      Like GODRIVER-4175, this assumes a set of types established as easily-convertible.

      Build tags would avoid breaking Go 1.26 & prior. (Though the From() static function would work for pre-1.27.)

            Assignee:
            Unassigned
            Reporter:
            Felipe Gasper
            None
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: