mongo-go-driver-protobuf icon indicating copy to clipboard operation
mongo-go-driver-protobuf copied to clipboard

Decoding objectId

Open cadaxapy opened this issue 5 years ago • 3 comments

giving this error: cannot decode objectID into a pmongo.ObjectId

cadaxapy avatar Mar 15 '19 11:03 cadaxapy

Hi,

I am sorry for the answer delay. Could you please provide me details how I can reproduce error.

Thanks

amsokol avatar Mar 27 '19 12:03 amsokol

I got this behavior too, because I did not register your codecs. Adding this solved my issue:

reg := codecs.Register(bson.NewRegistryBuilder()).Build()
clientOptions := options.Client().ApplyURI("mongodb://localhost:27017").SetRegistry(reg)

Firenox89 avatar Jul 01 '19 21:07 Firenox89

Same issue here although i registered the codecs

hyperxpizza avatar Feb 04 '21 13:02 hyperxpizza