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

Allow BSON undefined to decode to Go types

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: 1.3.1
    • Fix Version/s: 1.4.0
    • Component/s: BSON
    • Security Level: Public
    • Labels:
      None

      Description

      The driver already allows decoding BSON Null as an integer type and it should do the same for the BSON Undefined type.

      This caused an error in ADL because the shell's `db.stats()` command sends the `scale` parameter as BSON undefined, which was not coerced to an integer but failed decoding instead:

      > db.stats()
      {
              "ok" : 0,
              "errmsg" : "failed to parse command: cannot decode undefined into an integer type, correlationID = 16025a5ab6004ec18d14584f",
              "code" : 9,
              "codeName" : "FailedToParse"
      }
      

        Attachments

          Activity

            People

            Assignee:
            divjot.arora Divjot Arora
            Reporter:
            david.golden David Golden
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: