不支持选项[useMongoClient] [英] The options [useMongoClient] is not supported

查看:577
本文介绍了不支持选项[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.

这篇关于不支持选项[useMongoClient]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆