Mongoskin connection to mongodb with node js

138 Views Asked by At

Am trying to connect to mongodb throw my node js app using this line:

const db = mongoskin.db("mongodb://localhost:27017/todo?auto_reconnect", {safe:true});

but it always gives me error: enter image description here

And here screen shot from my code sample: enter image description here

1

There are 1 best solutions below

0
Artur P. On

Please read documentation: https://docs.mongodb.com/manual/reference/connection-string/#connections-connection-options

Connection options are pairs in the following form: name=value. The value is always case sensitive.

What version of MongoDB? In latest documentation i cant find any option called auto_reconnect so It isnt required.