Request support for UUID in mongo go driver

Hi! I’ve been using the Go MongoDB driver for quite some time, but I’ve always encountered the limitation of not being able to store UUID objects directly. To work around this, I’ve been using this excellent decoder & encoder (https://gist.github.com/SupaHam/3afe982dc75039356723600ccc91ff77).

However, with the new v2 version of the driver, I can no longer use this due to the removal of some packages like bsoncodec, bsonrw, and bsontype.

So, I was wondering if there are any plans to include support for UUID object serialization in the new version of the driver? That would be amazing!

1 Like

Hi @Angelsc, thanks for the question! bson.NewRegistryBuilder was deprecated in 1.x by bson.NewRegistry(). Otherwise, for v2 bsoncodec, bsonrw, and bsontype have been merged into the bson package to simplify imports. Here is the updated version of your gist:

1 Like