-
Notifications
You must be signed in to change notification settings - Fork 68
Open
Labels
Description
I want to use UUID for the _id value, but I can't get Mongo to recognise the value.
I start by setting uuidRepresentation='standard' parameter when initiating the MongoClient connection.
In my schema I declare a UUID attribute; this seemed to have no effect:
uuid = fields.UUIDField(
attribute='_id',
default=uuid.uuid4,
unique=True,
)
Result:
{
"_id": {
"$oid": "625aadba5d4a05bfa5c6b26b"
},
}
Declaring the attribute as a string, the result is the same:
uuid = fields.StringField(
attribute='_id',
default=str(uuid.uuid4()),
unique=True,
)
Result:
{
"_id": {
"$oid": "625aaad798ceb63062a2c15c"
},
}
What am I doing wrong?