Grokking Node.js
Vote

0% completed

​

Connecting Node.js with MongoDB using Mongoose

Many older tutorials connect to MongoDB with two extra options, useNewUrlParser and useUnifiedTopology. With the current version of Mongoose, that call does not connect at all:

mongoose.connect('mongodb://127.0.0.1:27017/mydatabase', { useNewUrlParser: true, useUnifiedTopology: true });
MongoParseError: options usenewurlparser, useunifiedtopology are not supported

Both options belonged to an old version of the MongoDB driver. Mongoose 6 made their behavior the default, and current Mongoose rejects them as unknown options

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content