Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
- Define User Registration Routes 3:52
- Using Nodemon While Developing an Express App 3:20
- Creating a Registration Form With Pug (Jade) 7:18
- Review: Routes, Nodemon and Pug 5 questions
- Setting Up Mongoose and a Mongo Database 4:34
- Defining a Mongo Schema with Mongoose 4:44
- Adding Data to the Database 9:46
- Review: Mongo, Mongoose and Schemas 5 questions
- Hashing and Salting 2:53
- Storing Passwords Securely 5:54
- Review: Passwords, Hashing and Salting 5 questions
Well done!
You have completed User Authentication With Express and Mongo!

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
In this video, we'll update our POST /register route so that we can validate the user input from the registration form, and create a new document in MongoDB with the user's name, email, favorite book, and password.
Mongo Shell
Mongo Shell Cheatsheet
You first need to log into the Mongo shell — mongo
in the terminal for Macs and Linux, or start mongo.exe for Windows.
-
show dbs
— display the databases -
use bookworm
— specify the database you're going to work with -
show collections
— shows the document collections for the selected database -
db.users.find()
— display all the documents in theusers
collection -
db.users.find().pretty()
— nicer format for output documents within the shell -
db.users.drop()
— remove theusers
collection from the current database
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
Edsel Talento
16,922 Points1 Answer
-
S K
55 Points1 Answer
-
Daniel Baker
15,369 Points3 Answers
-
Irena B.
8,713 Points2 Answers
-
Vitaly Kashubin
8,449 Points1 Answer
-
Marshall Bradley
13,552 Points2 Answers
-
Martin Coutts
18,154 Points1 Answer
-
Shyam Gupta
7,757 Points0 Answers
-
Brian Patterson
19,588 Points1 Answer
-
Don Macarthur
28,430 Points2 Answers
-
Zach Freitag
20,341 Points1 Answer
-
PLUS
John C
Courses Plus Student 138 Points1 Answer
-
PLUS
chris ingvartsen
Courses Plus Student 52 Points1 Answer
-
Alexei Parphyonov
34,128 Points1 Answer
-
Ken Stone
29,703 Points0 Answers
-
Charles-Antoine Francisco
27,426 Points1 Answer
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up