-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Suppressing: DeprecationWarning: 'ensureIndex()' is deprecated in Mongoose >= 4.12.0, use 'createIndex() #5692
Comments
This arrives with a mongoDB 3.4.7 on my machine. |
I have the same issue with:
|
That's strange. Are you calling |
I'm not using
|
I'm not using or calling ensureIndex() anywhere in my code. See below:var mongoose = require('mongoose'); mongoose.connect(uri, connectionOptions, function(err)
|
encounter the same problem store: new MongoStore({ |
I've tested things out. MongoStore causes this notice. |
I use also MongoStore. It seems to be an issue with the combination mongoose/MongoStore Nodejs 6.11.14 |
There's an open pull request in connect-mongo to fix this issue. |
I can also confirm that the warning message is from the mongo "store" module that I am using for session management, which is connect-mongo. So replacing connect-mongo with another "store" management module that calls createIndex() should eliminate the warning. In the alternative, I think there is an open pull request in connect-mongo to fix the issue as mentioned by CivFactions. Thank you all. |
same here people but... this MongoStore thing is in my react project also... i mean, its built in... not my code. so... id be glad to hear solution... please. thanks. |
ac1dr3d, If you want to replace your mongoStore with another module, check the links below for recommended modules:
|
Hi, I use express-session-mongo and I have the warning......... |
In fact, express-session + connect-mongodb-session: session = require('express-session'), |
amihailes, |
Working on this! |
Published |
Thanks @jdesboeufs |
Thank you jdesboeufs. |
How can we suppress the following warning in Mongoose 4.12.0, when connecting MongoDB with mongoose. This warning message only appears when I upgraded to 4.12.0.
DeprecationWarning: 'ensureIndex()' is deprecated in Mongoose >= 4.12.0, use 'createIndex()' instead
The text was updated successfully, but these errors were encountered: