Storing session data in RAM is fine for development, but would quickly crash a production server. In this lesson learn how to use a MongoDB-based data store for your session variables, which provides a scalable solution for a production server.
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
- connect-mongo A MongoDB session store for Connect and Express
You need to sign up for Treehouse in order to download course files.Sign up