Getting Started

Installing MongoDB

Configuring MongoDB

MongoDB config files are written in YAML, an example mongodb.conf file is provided below

Connecting to a MongoDB Atlas Server

# Using a single URI
mongo mongodb+srv://

# Using a URI and two flags
# Short Form
mongo 'mongodb+srv://' -u 'tommy' -p 'fighton'
# Long Form
mongo 'mongodb+srv://' --username 'tommy' --password 'fighton'

The MongoDB Shell


Basic Operations in the Shell

There are 4 basic operations

  1. Create
  2. Read
  3. Update
  4. Delete


Use the insert function to add a document to a collection.

Documents can be represented in JavaScript Object Notation JSON and then inserted, which helps add simplicity.