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:

https://teamtreehouse.com/library/setting-up-mongoose-and-a-mongo-database

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
PRO
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 npmjs.com.

there you can see the solution directly from the documentation.

cheers.