Details
-
Task
-
Resolution: Done
-
Major - P3
-
None
-
1.0.0
-
None
-
go1.12 linux/amd64
Description
Is there a way to make ObjectIDs with own methods that can be decoded from a BSON?
I made me a simple custom ObjectID with a valid function:
package primitive
|
|
|
import (
|
primitive "go.mongodb.org/mongo-driver/bson/primitive"
|
)
|
|
|
type ObjectID struct {
|
primitive.ObjectID
|
}
|
|
|
func (o ObjectID) Validate() error {
|
return nil
|
}
|
But when I use that type instead of the original in a struct and try to decode a BSON I get the following error message:
cannot decode objectID into a primitive.ObjectID
|