Normally you would do something like:
var db = new mongo
.Db('test', new mongo.Server('127.0.0.1', 27017), {w: 1})
.open(function (error, database) {
if (error) throw error
console.log('Connected to database test')
})
I, however, want to connect to mongodb synchronously. So I'd need a method I can use in this way:
var db = new mongo.openDb('test', new mongo.Server('127.0.0.1', 27017), {w: 1})
console.log('Connected to database test')
Is there anything like this?