Nodejs using CONNECT-MONGODB error (please ensure the default write concern)

Source: Internet
Author: User
Tags deprecated

Originally used connect-mongo , may be the Express version of the upgrade error, instead connect-mongodb , but after the use of the following warning:

G:\nodejs\moviesite>gruntrunning "Concurrent:tasks" (concurrent) Task Running "Nodemon:dev" (Nodemon) Task Runnin    G "Watch" task waiting ... [Nodemon] v1.3.7 [Nodemon] to restart at any time, enter ' RS ' [Nodemon] Watching: *. * [Nodemon] starting ' node AP P.js ' =========================================================================================Please   ensure so 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 Acknowledgemen     t = ===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(' localhost ', 27017), { safe:  False})   ==== http://www.mongodb.org/display/docs/getlasterror+Command    ====The   default of no acknowledgement     would change in the very near future====This message would disappear when the   default safe was set on the driver Db    =========================================================================================Sat, June 12:49:12 GMT express-session deprecated undefined resave option; Provide resave option at App.js:20:9sat, June 12:49:12 GMT express-session deprecated undefined saveuninitialized o ption; Provide saveuninitialized option at App.js:20:9 MovieSite started on port 3000

The warning below will be resolved by adding two attribute values restart and saveuninitialized to the session.

Sat, 27June2015 12:: GMT express-session deprecated undefined resave option;provide resave option  at app. js:: 9Sat, 27June2015 12:: GMT express-session deprecated undefined saveuninitialized option;provide saveuninitialized option  at app. js:: 9Such as:app. Use(Session({  resave: false,//re-Save: Forces the session to be saved even if it is not modified. (default ture) saveuninitialized:true,//forces an uninitialized session-to-memory cookie: {maxAge:3600000   },Secret: ' Imooc ',Store: New Mongostore({  URL:dburl, Collection:' Sessions '       })    }))

The rest of the warning should be that the database is not a secure connection and has not been resolved, know friend tell

Nodejs using CONNECT-MONGODB error (please ensure the default write concern)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.