在打开mongoose时发现一个报错问题
DeprecationWarning: open()
is deprecated in mongoose >= 4.11.0, use openUri()
instead, or set the useMongoClient
option if using connect()
or createConnection()
. See http://mongoosejs.com/docs/connections.html#use-mongo-client
opened
这上面虽然指出了解决问题的方法,但为什么要这样做呢?
于是google一下,果然找出了答案
This warning comes from the MongoDB Node.js driver. Currently, connecting and authenticating are distinct operations in MongoDB. You can connect to your database and then authenticate later, which is what mongoose 4.x does by default. You can even authenticate as multiple different users on the same connection.
As far as I understand, MongoDB is planning on removing this functionality in 3.6 and consolidating connecting and aut