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
Support duplicate key validation on 'index: { unique: true} }' #58
Comments
Yeap, also expecting it to validate it but it doesn't :( Same version (7.3.3) |
also having this issue! please implement 🙏🏻 |
can someone provide a working or not working sample that I can copy and paste, or better yet a test case? I don't anticipate that this issue is coming from mockgoose, because it is actually using a real instance of mongodb and just mocking a connection string. I vaguely remember someone talking about this several times before, and I think the issue was identified that indexes were not recreated. |
For me it was happening because I was dropping the database between tests using As a quick workaround I found a way of regenerating the indexes for the specific mongoose model I was testing: I assume there is a better way of fixing this issue. At the very least perhaps there should be a note in the docs for |
after reset, call below to reset the indexes will fix this problem:
|
This is still an issue mccormicka/Mockgoose#58
I'm running Mockgoose 7.3.3
The text was updated successfully, but these errors were encountered: