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

UnmarshalExtJSON array fail

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 0.1.0
    • 0.0.15
    • BSON
    • None
    • Golang 1.10.4 / Golang 1.11
      macOS

    Description

      UnmarshalExtJSON fail:

      ~~~
      data := `[ "201810", "201811" ]`

      arr := bson.NewArray()
      err := bson.UnmarshalExtJSON([]byte(data), true, &arr)
      if err != nil

      {     t.Fatal(err) }

      t.Log(arr)
      ~~~

       
      output:
      ~~~
      Cannot read unknown BSON type invalid
      ~~~

      but if data = 'data := `[ "201810" ]` works well
       

       

      Attachments

        Activity

          People

            isabella.siu@mongodb.com Isabella Siu (Inactive)
            liuxiangchao Liu Xiangchao
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: