I'm new to asking questions in Stack overflow.
I'm implementing an application that it's using Firebase Auth for users login, logout and delete account and mongodb with python (pymongo) to manage the database.
When a user signs in, a new user is created in Firebase Auth so the new user is given a new UID which is a 28 characters id (it is a string). My idea is to set the value of the _id from mongodb collection to the uid but it seems that the uid is longer than what it is expected:
Here you can see the output in the python console (An exception occurred :: 'g2CgrpStaOUwEFBpLzuJWme3OMR2' is not a valid ObjectId, it must be a 12-byte input or a 24-character hex string)
Do you have any idea to solve this problem? I tried
"_id": ObjectId(str.encode(id)) when creating the document but it says
An exception occurred :: id must be an instance of (bytes, str, ObjectId), not <class 'bytes'> and I'm running out of ideas.
I hope you can help me, I'm glad to hear your questions. Thanks in advance.