我总是连接到"管理员"数据库,这是一个fixed bug.
使用Mongoose 5.0.6 MongoDb 3.6并try 连接Atlas.
- 我的问题是,Mongoose 5.0.6依赖于什么驱动程序?
- 我怎么才能知道mongoose 什么时候能修好呢?
- 在另一个方向上,是否有一种方法可以连接MongoDB,然后将此连接用于
干杯
我总是连接到"管理员"数据库,这是一个fixed bug.
使用Mongoose 5.0.6 MongoDb 3.6并try 连接Atlas.
干杯
基本上,您应该try 使用url链接进行连接,并在mongoose connect方法中指定DB名称
mongodb+srv://userName:Passwrod@clustor.mongodb.net/
您的数据库名是:
testDB
那你应该给mongoose 打电话.连接方法如下:
mongoose.connect('mongodb+srv://userName:Passwrod@cluster.mongodb.net/', {dbName: 'testDB'});