求助: database name must be a string
发布于 11 年前 作者 sureleo 5928 次浏览 最后一次编辑是 8 年前

我的DB是mongoDB

我的Settings如下: module.exports = { cookieSecret: ‘microblogbyvoid’, db: ‘microblog’, host: ‘localhost’, };

如果根据书上所说 db:后面的就是database的名字了 可是这怎么可能不是一个string呢? 万分感谢

2 回复

module.exports = { cookieSecret: ‘microblogbyvoid’, db: ‘microblog’, host: ‘localhost’, };

host: ‘localhost’, 多了 一个 ’ ,‘ 取消看看,或者打印你这个export的对象出来,看是否正确

你好,

刚刚找到的错误 module.exports=new Db(settings.db, new Server(settings.host, Connection.DEFAULT_PORT, {}));

只写了settings没有写settings.db

3q all the same

回到顶部