nodejs使用connect-mongodb报错(Please ensure that you set the default write concern)
来源:互联网 发布:淘宝买了假货怎么索赔 编辑:程序博客网 时间:2024/05/22 18:30
原本是使用connect-mongo
的,可能是express版本的升级报错了,改用connect-mongodb
,但是使用后出现了如下的警告:
G:\nodejs\moviesite>gruntRunning "concurrent:tasks" (concurrent) task Running "nodemon:dev" (nodemon) task Running "watch" task Waiting... [nodemon] v1.3.7 [nodemon] to restart at any time, enter `rs` [nodemon] watching: *.* [nodemon] starting `node app.js` ======================================================================================== = Please ensure that you set the default write concern for the database bysetting = = 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 acknowledgement = = = = 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 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:9Sat, 27 Jun 2015 12:49:12 GMT express-session deprecated undefined saveUninitialized 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:9Sat, 27 Jun 2015 12:49:12 GMT express-session deprecated undefined saveUninitialized 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' }) }))
剩下的警告应该是数据库不是安全连接,还未能解决,知道的朋友告诉一下
0 0
- nodejs使用connect-mongodb报错(Please ensure that you set the default write concern)
- node.js连接mongodb数据库警告:(Please ensure that you set the default write concern)
- mongodb的write concern
- mongodb的write concern
- mongodb的write concern
- MongoDB Write Concern整理
- mongodb的write concern
- mongodb的write concern
- MongoDB Write Concern整理
- MongoDB Write Concern整理
- mongodb中的read concern和write concern
- iOS报错 - If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variabl
- Eclipse报错 Please ensure that adb is correctly located at '.\adb.exe' and can be
- Android开发——报错Please ensure that adb is correctly located at
- MongoDB 写安全(Write Concern)
- MongoDB 写安全(Write Concern)
- error PRJ0050: Failed to register output. Please ensure you have the appropriate permissions to (转载)
- 后台报错:Ensure that you are running Domino with a valid license file
- 浅谈Java分布式计算
- 使用Maven编译的时候跳过运行测试
- usb鼠标驱动
- Java基础----this、super及其异同
- HDU_2068 RPG的错排(错排+组合数)
- nodejs使用connect-mongodb报错(Please ensure that you set the default write concern)
- 【翻译自mos文章】CRS显示 正在运行的db instance 是offline状态
- 平衡二叉查找树
- 检测内存泄漏的关键
- Github上优秀的Objective-C项目简介
- 硬盘的原理以及SQL Server如何利用硬盘原理减少IO
- oracle设定用户密码使用时间
- Objective-C ---KVO内部实现原理
- 51单片机学习笔记【一】——LED灯实验