I’m new to Node.js and this blog post is to help me remember what I did as I learn it. Hopefully, it will also help others who are reading this. Comments and suggestions are welcome.

I have a Rails background so I’m used to having nice terminal commands like Rail’s rake command. To create a database and populate it, I would use a terminal command like: rake db:setup

For Node.js, I wanted a command like node seed.js to

  1. Connect to MongoDB
  2. Drop a specific DB
  3. Recreate the DB
  4. Insert documents into DB