The database for you and me

Tuesday, Feb 4, 2020


Getting Started

Mac OS

brew install mongodb


apt install mongodb

Connecting to a MongoDB Atlas Server

$ mongo "mongodb+srv://" --username root

Mac OS

The config file is located at /usr/local/etc/mongod.conf


The config file is located at /etc/mogndob.conf

The MongoDB Shell


{: .notice–info} Tip: If the database doesn’t yet exist, switching to it will implicitly create it.

{: .notice–warning} Warning: If you switch to a new database and don’t add anything, the command above won’t show you the current database you are using since there isn’t anything inside of it.

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.