-
-
Notifications
You must be signed in to change notification settings - Fork 135
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
Error: Index already exist #931
Comments
the error is |
did you already try clearing the collections after adding your explicit name index? also note that if your problem still continues after deleting the initial collection (from before having added the explicit index name) consider disabling finally, also note that the following code will not recompile the model on something like a hot-reload: const model =
mongoose.models.BetaCandidate ||
typegoose.getModelForClass(BetaCandidateSchema); it will continue to use the old version (if the model / class was changed before the reload) |
@hasezoey great answer from you, thanks. I have just implemented a method to check indexes by looping over them with Nevertheless I will investigate your solution thoroughly to learn more... |
Please leave the issue open for now, I will come back to it and close it very soon if it's resolved ! thank you ! |
Marking Issue as stale, will be closed in 7 days if no more activity is seen |
Hi,
I have always an issue of index generation with conflicts. I try to define explicitly the name of the index, but it seems mongoose doesn't take that into account.
My code:
Versions
I am using version ^12.2.0
transpileOnly is not used
The text was updated successfully, but these errors were encountered: