运行正常,但是终端输出这串提示,怎么调试呢?
发布于 1年前 作者 manihome 757 次浏览
node app

运行正常,但是终端输出这串提示,怎么调试呢?

Please ensure that you set the default write concern for the database by setting =
= one of the options =
= =
= w: (value of > -1 or the string 'majority'), where < 1 means =
= no write acknowlegement =
= journal: true/false, wait for flush to journal before acknowlegement =
= fsync: true/false, wait for flush to file system before acknowlegement =
= =
= For backward compatibility safe is still supported and =
= allows values of [true | false | {j:true} | {w:n, wtimeout:n} | {fsync:true}] =
= the default value is false which means the driver receives does not =
= return the information of the success/error of the insert/update/remove =
= =
= ex: new Db(new Server('localhost', 27017), {safe:false}) =
= =
= http://www.mongodb.org/display/DOCS/getLastError+Command =
= =
= The default of no acknowlegement will change in the very near future =
= =
= This message will disappear when the default safe is set on the driver Db =
2 回复

这个只是mongo数据库的连接配置警告而已,好像是将w设置为-1后就不会有这个了,具体的忘了,可以google一下。

new Db(new Server('localhost’, 27017), {safe:true})

回到顶部