Closed amijalis closed 4 years ago
Thinking about this some more... a JSON or BSON object shouldn't have an object as a key... so this is probably the desired behavior.
You're correct that this is desired behaviour.
If you want to use a Car
as a key, you need to be explicit about how you want to serialize it.
For example:
BSONSerializer.register_serializer(Car, lambda car: car.name)
Code to reproduce:
Thanks for developing this awesome module!