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

Depriciation Warning #309

Open
KanikaBakshi opened this issue Oct 5, 2020 · 3 comments
Open

Depriciation Warning #309

KanikaBakshi opened this issue Oct 5, 2020 · 3 comments

Comments

@KanikaBakshi
Copy link

DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead.

@asimimamabdullah
Copy link

I have getting the same issue

@BhaskarPaul
Copy link

add mongoose.set("useCreateIndex", true)

@hichamabboud
Copy link

hichamabboud commented Mar 9, 2021

When you connect your mongoose.connect() add useCreateIndex : true,
so your code should look like this.

mongoose.connect('mongodb URL goes here' , {
useCreateIndex : true,
useFindAndModify:true,
useNewUrlParser :true,
useUnifiedTopology : true
})

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

4 participants