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

Embedded Model Removal Question #112

Closed
Caindrac opened this issue Mar 2, 2021 · 1 comment
Closed

Embedded Model Removal Question #112

Caindrac opened this issue Mar 2, 2021 · 1 comment

Comments

@Caindrac
Copy link

Caindrac commented Mar 2, 2021

I have been having a hard time connecting odmantic with raw mongo. I have a value that I know exists in some of my embedded models. What I would like to to give issue a query to remove all instances of those embedded models that include that value in a specific filed of the object. I know with base mongo you can do $pull to accomplish this how would you go about doing this in odmantic. If I just need to get the underlying engine that is fine I was just wandering.

@Caindrac Caindrac changed the title Embedded Model Removal Embedded Model Removal Question Mar 2, 2021
@art049
Copy link
Owner

art049 commented Sep 1, 2022

For now the only way to do this with ODMantic would be to fetch all the instances and do the filtering locally. However, this is highly suboptimal and as you mentioned the best way is to use the engine directly.

#248 should add some atomic update operators. Could you precise your use case, maybe with a little example, so I can make sure the feature will cover it

@art049 art049 closed this as completed Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants