node.js - Mongoose Connection issue -


not able connect mongodb using mongoose getting error

/users/kunal/documents/node/project/taskaccomplisher/node_modules/mongodb/lib/server.js:242         process.nexttick(function() { throw err; })                                       ^ mongoerror: server 127.0.0.1:27017 received error {"name":"mongoerror","message":"write epipe"}     @ null.<anonymous> (/users/kunal/documents/node/project/taskaccomplisher/node_modules/mongodb-core/lib/topologies/server.js:213:40)     @ g (events.js:260:16)     @ emittwo (events.js:87:13)     @ emit (events.js:172:7)     @ null.<anonymous> (/users/kunal/documents/node/project/taskaccomplisher/node_modules/mongodb-core/lib/connection/pool.js:119:12)     @ g (events.js:260:16)     @ emittwo (events.js:87:13)     @ emit (events.js:172:7)     @ socket.<anonymous> (/users/kunal/documents/node/project/taskaccomplisher/node_modules/mongodb-core/lib/connection/connection.js:151:49)     @ socket.g (events.js:260:16)     @ emitone (events.js:77:13)     @ socket.emit (events.js:169:7)     @ onwriteerror (_stream_writable.js:304:10)     @ onwrite (_stream_writable.js:322:5)     @ writablestate.onwrite (_stream_writable.js:89:5)     @ fireerrorcallbacks (net.js:442:13) 

code used connect mongodb

var mongoose = require('mongoose')  mongoose.connect('mongodb://localhost/test') var db  = mongoose.connection; db.on('error', console.error.bind(console, 'connection error:')); db.once('open', function () {  console.log('running'); }); 

how can make mongodb connection node.js

mongod -repair solved issue


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -