不支持选项[useMongoClient]

不支持选项[useMongoClient]

问题描述:

我正在使用mongodb-3.6.0.

I am using mongodb-3.6.0.

我的快递代码是

var promise = mongoose.connect('mongodb://localhost/myapp', {
  useMongoClient: true
});

在运行该应用程序时,我得到的是the options [useMongoClient] is not supported.我在^5.0.0-rc0中的猫鼬版本.

On running the app I am getting the options [useMongoClient] is not supported. My mongoose version in ^5.0.0-rc0.

请帮助.

由于Mongoose 5处于候选发布阶段,因此没有太多相关文档,但是对于Mongoose 5,您不需要提供useMongoClient选项. Mongoose 5默认使用Mongo客户端.因此,只需删除此选项即可.

There is not much documentation about this yet as Mongoose 5 is in release candidate stage but with mongoose 5 you don't need to provide useMongoClient option. Mongoose 5 is using Mongo client by default. So just remove this option.