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

(node:1124) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead. #8506

Closed
lucio-oliveira opened this issue Jan 14, 2020 · 2 comments

Comments

@lucio-oliveira
Copy link

I solved this Issue in my application using this value in my mongoose connection:

mongoose.connect('mongodb+srv://lucio:@cluster0-6izqv.mongodb.net/test?retryWrites=true&w=majority',{
useCreateIndex:true,
} );

@AbdelrahmanHafez
Copy link
Collaborator

AbdelrahmanHafez commented Jan 15, 2020

Duplicate of #6880
TL;DR: Just add useCreateIndex: true the way you currently are doing in order to avoid the deprecation warning.

@vkarpov15
Copy link
Collaborator

@Automattic Automattic locked as resolved and limited conversation to collaborators Jan 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants