Node.js 节点mongodb fixtures不适用于mongodb版本4

Node.js 节点mongodb fixtures不适用于mongodb版本4,node.js,mongodb,Node.js,Mongodb,我正在将mongodb版本从3.14.4升级到4.0 我已经将node mongodb fixture从2.2.1升级到3.0.0 const fixture = new Fixtures({ dir: 'fixtures/all', mute: true }); fixture.connect("mongodb://localhost:27017/testDb") .then(() => fixtur

我正在将mongodb版本从3.14.4升级到4.0 我已经将node mongodb fixture从2.2.1升级到3.0.0

const fixture = new Fixtures({
                dir: 'fixtures/all',
                mute: true
            });
fixture.connect("mongodb://localhost:27017/testDb")
.then(() => fixture.unload())
.then(() => fixture.load())
.then(() => fixture.disconnect())

获取此错误时,mongodb数据库名称必须是字符串,而不是在连接字符串中传递dbName,而是将其作为选项传递

fixtures.connect('mongodb://localhost:27017',options, dbName)
连接(uri、选项、数据库名)

有关更多信息,请查看最新软件包: