I don't know exactly in which alpha version this issue started, but when decoding the *DocumentResult into my Go struct, it always throws an error if I have
"myIdAttribute": null in database.
- If struct is defined as *objectid.ObjectID, decoding fails. The error contains this relevant info: "github.com/mongodb/mongo-go-driver/bson/objectid.ObjectID.IsZero called using nil *ObjectID pointer"
- If struct is defined using objectid.ObjectID (no pointer here), it also fails. The error message contains: "cannot decode null into an ObjectID"
So basically in case any field in my database represents an ObjectID, and its value is null in the database, my entire decode operation fails.
- depends on
-
GODRIVER-535 Add support for pointers to reflect.Kind types
- Closed
- related to
-
GODRIVER-535 Add support for pointers to reflect.Kind types
- Closed