passport-local-mongoose icon indicating copy to clipboard operation
passport-local-mongoose copied to clipboard

Depriciation Warning

Open KanikaBakshi opened this issue 4 years ago • 3 comments

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

KanikaBakshi avatar Oct 05 '20 07:10 KanikaBakshi

I have getting the same issue

asimimamabdullah avatar Jan 09 '21 07:01 asimimamabdullah

add mongoose.set("useCreateIndex", true)

BhaskarPaul avatar Jan 22 '21 13:01 BhaskarPaul

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 })

hichamabboud avatar Mar 09 '21 12:03 hichamabboud