nodejs使用connect-mongodb报错(Please ensure that you set the default write concern)
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了nodejs使用connect-mongodb报错(Please ensure that you set the default write concern),小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2247字,纯文字阅读大概需要4分钟。
内容图文
============ = 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 acknowledgement = = journal: true/false, wait for flush to journal before acknowledgement = = fsync: true/false, wait for flush to file system before acknowledgemen t = = = = For backward compatibility safe is still supported and = = allows values of [true | false | {j:true} | {w:n, wtimeout:n} | {fsync:t rue}] = = 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 acknowledgement will change in the very near future = = = = This message will disappear when the default safe is set on the driver Db = ============================================================================ ============ Sat, 27 Jun 2015 12:49:12 GMT express-session deprecated undefined resave option ; provide resave option at app.js:20:9 Sat, 27 Jun 2015 12:49:12 GMT express-session deprecated undefined saveUninitial ized option; provide saveUninitialized option at app.js:20:9 moviesite started on port 3000下边的警告在session中添加两个属性值restart和saveUninitialized即可解决。
Sat, 27 Jun 2015 12:49:12 GMT express-session deprecated undefined resave option
; provide resave option at app.js:20:9
Sat, 27 Jun 2015 12:49:12 GMT express-session deprecated undefined saveUninitial
ized option; provide saveUninitialized option at app.js:20:9
如:
app.use(session({
resave: false,//重新保存:强制会话保存即使是未修改的。(默认值ture)
saveUninitialized: true,//强制保存未初始化的会话到存储器
cookie: {maxAge:3600000},
secret:‘imooc‘,
store:new mongoStore({
url:dbUrl,
collection:‘sessions‘
})
}))
剩下的警告应该是数据库不是安全连接,还未能解决,知道的朋友告诉一下
nodejs使用connect-mongodb报错(Please ensure that you set the default write concern)
标签:mongodb nodejs
本文系统来源:http://blog.csdn.net/allgis/article/details/46664243
内容总结
以上是互联网集市为您收集整理的nodejs使用connect-mongodb报错(Please ensure that you set the default write concern)全部内容,希望文章能够帮你解决nodejs使用connect-mongodb报错(Please ensure that you set the default write concern)所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。