-
Type: Bug
-
Resolution: Gone away
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: BSON
-
None
As part of mgo->go driver migration, I found weird failures in evg:
https://evergreen.mongodb.com/version/5c75aecd2fbabe2eb0b55062 .
more specifically the error:
Err: cannot transform type bson.D to a BSON Document: WriteArray can only write a Array while positioned on a Element or Value but is positioned on a TopLevel
The code caused this error:
session.Database("admin").RunCommand(context.Background(), bson.D{{"buildInfo", int32(1)}}).Decode(&result)
(https://github.com/10gen/mms-backup/pull/317/commits/7b5323541e89a0fb77609ecdea9c99469f31e3af)
By changing bson.D{{"buildInfo", int32(1)}} to bson.M
{"buildInfo" : int32(1)}the error went away.
Can you please take a look? thanks!
Note: no mgo imported nor deps installed
- is related to
-
GODRIVER-1194 Confusing error using uninitialized bson.D as a document
- Closed