Unify BSON null/undefined decoding to nil for Raw, bsoncore.Document, and bsoncore.Array

XMLWordPrintableJSON

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

      Context

      Decoding a BSON null (or undefined) into the slice-backed raw types is inconsistent with how every other nullable target is decoded, and we should resolve this in V3 where a breaking change is acceptable.

      It was decided by the team that fixing this bug in v2.x would not align with semver. See GODRIVER-3969 for more details.

      Definition of done

      Decoding {"foo": null/undefined} into a struct field of type bson.Raw, bsoncore.Document, or bsoncore.Array yield nil with no error. The behavior needs to be consistent with null for bson.D/bson.M/map/slice/pointer. We should also update the migration guide.

      Pitfalls

      Not investigated

            Assignee:
            Unassigned
            Reporter:
            Preston Vasquez
            None
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: