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

Modify does not return an error on duplicate key #128

Open
Kozaky opened this issue Feb 13, 2022 · 1 comment
Open

Modify does not return an error on duplicate key #128

Kozaky opened this issue Feb 13, 2022 · 1 comment

Comments

@Kozaky
Copy link

Kozaky commented Feb 13, 2022

I have noticed that modify does not produce a duplicate key error when I try to update the field 'email' for an already in-use email. However, I see that the same query does produce an error in MongoDB if I do it manually.

Is this behaviour expected?

@VictorDenisov
Copy link
Member

This driver uses whatever logic is built into OPS_UPDATE operation. There is a chance that operations implemented through OPS_MSG have the behavior that you describe.

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