Thursday, 15 March 2012

Node.js issue with mongodb -



Node.js issue with mongodb -

i ran node server.js in topmost directory of project: , error got:

connect.multipart() removed in connect 3.0 visit https://github.com/senchalabs/connect/wiki/connect-3.0 alternatives connect.limit() removed in connect 3.0 magic happens on port 8080 events.js:72 throw er; // unhandled 'error' event ^ error: failed connect [your_database_here:27017] @ null.<anonymous> (/home/ajay/desktop/easy-node-authentication-facebook/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/server.js:549:74) @ emit (events.js:106:17) @ null.<anonymous> (/home/ajay/desktop/easy-node-authentication-facebook/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:150:15) @ emit (events.js:98:17) @ socket.<anonymous> (/home/ajay/desktop/easy-node-authentication-facebook/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection.js:533:10) @ socket.emit (events.js:95:17) @ net.js:833:16 @ process._tickcallback (node.js:419:13)

i've installed mongodb , when open localhost:27017 in browser, says it looks trying access mongodb on http on native driver port.. exact mistake?

i suggest utilize 'mongoose' connect mongodb node. here sample code this.

class="snippet-code-js lang-js prettyprint-override">var mongoose=require('mongoose'), db = 'mongodb://localhost/test'; mongoose.connect(db); //and code goes here

you have install node module 'mongoose'. read docs of mongoose.

node.js mongodb ubuntu-14.04

No comments:

Post a Comment