Link documents with UUIDs #598
Mark90
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, thanks @roman-right for a wonderful library and documentation!
Apologies if this isn't worth a 'Show and tell' discussion, but it took me some time to figure out and thought it might be helpful for others.
I wanted to
Link
Documents together using UUIDs as document id's, instead of mongo's object ID. My first implementation looked something like this:Running the
test()
coroutine gives an error;One (the?) solution is to configure 'standard' UUID Representation.
There are 2 different methods to configure this;
AsyncIOMotorClient
(orpymongo.MongoClient
)bson.CodecOptions
(if you already pass any other codec options, this overrides the previous method and you'll be wondering why it isn't working :) )Now I can have a door in my house!
Beta Was this translation helpful? Give feedback.
All reactions