Skip to content

Instantly share code, notes, and snippets.

@rogerwschmidt
Last active June 28, 2019 18:36
Show Gist options
  • Save rogerwschmidt/f8660b26e76a17a3dbed30067ce955f4 to your computer and use it in GitHub Desktop.
Save rogerwschmidt/f8660b26e76a17a3dbed30067ce955f4 to your computer and use it in GitHub Desktop.

Mongodb + express instructor notes

Objectives

  • Install mongodb
  • Explain the differences between a database, a collection, and a record
  • Add records to a collection
  • Get all records in a collection
  • Get one record from a collection
  • Delete one record from a collection
  • Update one record in a collection

Resources

Install mongodb

brew install mongodb
mongo

Explain the differences between a database, collection, and a record

Add records to a collection

  • Add a new book to the books collection/schema using the post request

Get all records in a collection

  • Get all books from the books collections/schema

Get one record from a collection

  • Get one book by id from the books collections/schema

Delete one record from a collection

  • Delete one book by id from the books collections/schema

Update one record in a collection

  • Update one book by id from the books collections/schema

Update views counter on get one

  • Update the get one route to find and update one record by id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment