Skip to content

Modify does not return an error on duplicate key #128

New issue

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

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

Already on GitHub? # to your account

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants