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 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 the
db.users.find().pretty()— nicer format for output documents within the shell
db.users.drop()— remove the
userscollection from the current database
You need to sign up for Treehouse in order to download course files.Sign up