I am trying to post data to database that I have created on mLab and I am getting this error but I don\'t know whats going wrong.I also have read previously asked question o
According to the mongo document, we need to change the connection as bellow,
The legacy operation
MongoClient.connect('mongodb://localhost:27017/test', (err, db) => {
// Database returned
});
is replaced with
MongoClient.connect('mongodb://localhost:27017/test', (err, client) => {
// Client returned
var db = client.db('test');
});
Don't need to downgrade the mongo version :)