node.js - Mongoose - Save doesnt work when am connecting to mongodb running in different server -
when trying save document in collection or find list of collections in mongodb running remotely doesnt work works when connecting mongo db locally. save doesnt show if throwed error or successful. appreciated. below code var mongoose = require('mongoose'); var dbname = 'ost'; var connectionstring = 'mongodb://vm-1b98-f53f.nam.nsroot.net:32017/ost?ssl=true&sslverifycertificate=false'; mongoose.connect(connectionstring); mongoose.connection.on('error', function (err) { console.log('mongoose default connection error: ' + err); }); mongoose.connection.on('connected', function () { console.log('mongoose default connection open ' + connectionstring); var region = require('./region.js'); var r = new region({ nodeid: 8687, regionname: 'emea' }); r.save(function (err, regionobj) { if (err) { console.log('error'); throw err; } else { console.log('saved successfully:...