[GODRIVER-611] UnmarshalExtJSON array fail Created: 25/Oct/18  Updated: 28/Oct/23  Resolved: 30/Nov/18

Status: Closed
Project: Go Driver
Component/s: BSON
Affects Version/s: 0.0.15
Fix Version/s: 0.1.0

Type: Bug Priority: Major - P3
Reporter: Liu Xiangchao Assignee: Isabella Siu (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

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
 

 



 Comments   
Comment by Githook User [ 30/Nov/18 ]

Author:

{'name': 'Isabella Siu', 'email': 'isabella.siu@10gen.com', 'username': 'iwysiu'}

Message: GODRIVER-611 Fix extJSONParser.advanceState() for string in array

Change-Id: Iab003ef689dab676c15353e93b747c1d75fd2d12
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/284ed29349f8d1e65dfeb2609f3e34d71cfd71ff

Comment by Jeffrey Yemin [ 28/Nov/18 ]

Hi liuxiangchao, sorry for the late response.  We agree that this is a bug and plan to fix it prior to the 1.0 release.  Many thanks for the report.

Comment by Liu Xiangchao [ 29/Oct/18 ]

Anybody here? no response in past three days...

Comment by Liu Xiangchao [ 26/Oct/18 ]

Ok, version should be v0.0.17

Generated at Thu Feb 08 08:34:34 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.