CNode

为什么在node启动的时候会报这个?

Bbao2dan发布于13 年前最后回复13 年前2 回复5262 浏览0 收藏

======================================================================================== = 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)

Y
yimity#1·13 年前

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

看到这句了没?

按他说的来做就好了。

B
bao2dan#2·13 年前

谢谢,加上这个:safe: false 后,的确好了,但mongo默认的应该就是 safe = false 吧?

参与回复
登录后即可参与回复。登录