Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bson.errors.InvalidDocument: cannot encode object: frozenset()/set() #11

Open
art049 opened this issue Oct 23, 2020 · 0 comments
Open
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@art049
Copy link
Owner

art049 commented Oct 23, 2020

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")) 
@art049 art049 added the bug Something isn't working label Oct 23, 2020
@art049 art049 added the good first issue Good for newcomers label Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant