odmantic
odmantic copied to clipboard
bson.errors.InvalidDocument: cannot encode object: frozenset()/set()
Exception while saving an object containing either a frozenset or a set:
from odmantic import Model, AIOEngine
from odmantic.bson import ObjectId
class UserModel(Model):
username: str
favorites_article_ids: FrozenSet[ObjectId] = frozenset()
engine = AIOEngine()
await engine.save(UserModel(username="jean"))