[Feature] Possibility of Document.set/Document.update based on customized query? #1256
Unanswered
chhsiao1981
asked this question in
Question
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
https://github.com/BeanieODM/beanie/blob/main/beanie/odm/documents.py#L721
Currently
Document.updateis based on_id.Furthermore, instead of doing update directly,
it seems like currently beanie does
find_onefirst before doing update.However, we may just want to update some partial info based on some other query (ex: username in the User class).
Furthermore, due to performance concern, we may even just want to get the UpdateResult and not the full document.
Is it possible for beanie to achieve this?
Or this violates odm and I should just directly use
pymongo?~Beta Was this translation helpful? Give feedback.
All reactions