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

rollbackRemoveOrUpdate using viaSave #55

Open
yamila-fraiman opened this issue Mar 20, 2018 · 3 comments
Open

rollbackRemoveOrUpdate using viaSave #55

yamila-fraiman opened this issue Mar 20, 2018 · 3 comments

Comments

@yamila-fraiman
Copy link

yamila-fraiman commented Mar 20, 2018

When using viaSave if there is a validation in the database and it fails, I get "MongoError: the update operation document must contain atomic operators.".

Eg:
mySchema.pre('validate', function(next) { let self = this; if (self.socialNetworks.length > 1) { self.invalidate('socialNetworks', 'Up to 1 social network can be saved.', self.socialNetworks); } next(); });

and

user.socialNetworks = ["www.facebook.com", "www.twitter.com"]; transaction.update(doc.user, doc.user.toObject()).options({viaSave: true});

@e-oj
Copy link
Owner

e-oj commented Mar 20, 2018

I'll look into it. Might be related to #53

@e-oj
Copy link
Owner

e-oj commented Feb 3, 2019

After much digging, this is actually related to #74

@yamila-fraiman
Copy link
Author

Hi I'm still having this problem with version 2.1.5. Any update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants