Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript User Authentication With Express and Mongo Sessions and Cookies Authenticating the Username and Password

ryantalbot2
ryantalbot2
12,537 Points

it appears several pieces of code are deprecated. I would include them here but I'm not allowed enough room to add them.

(node:31380) 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. (node:31380) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor. Express app listening on port 3000 (node:31380) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead.

1 Answer

Blake Larson
Blake Larson
13,014 Points

The MongoClient or mongoose connect function can take another argument .connect("mongoURI", { useNewUrlParser: true })