Open ansenlong opened 6 months ago
Hi @ansenlong, Once I have tried it to provide support for the Set. But if we add that support we need to check each of the field types before inserting and updating which will degrade the performance of the ODM.
Also, MongoDB does not support Set out of the box. It would be better to add a save and update method for that specific model to do some pre-validation.
Other than that, you are very welcome to come up with a great solution. I will appreciate your contribution.
When my model has it need to convert my tags to a list before it tries to insert/update it to MongoDB.
class Video(Document): tags: Set[str]
I have a workaround with "field_serializer" but it would be nice if it could support sets out of the box.