JavaScript User Authentication With Express and Mongo User Registration Setting Up Mongoose and a Mongo Database

Daniel Baker
Daniel Baker
15,350 Points

(node:7288) DeprecationWarning:

When following along I received this error:

(node:7288) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.

I googled it and made this change:

// mongodb connection
mongoose.connect("mongodb://localhost:27017/bookworm", { useNewUrlParser: true });

Error went away, hope this helps others.

Thanks! I was just about to look this up as well.

1 Answer

Roger Rodriguez
Roger Rodriguez
Pro Student 5,837 Points

Good catch while going through this videos is also a good idea to have the latest documentation of the packages in

there you can see the solution directly from the documentation.