- [Instructor] This course is not a full on course
on MongoDB, and if you want to follow a course
on the subject, feel free to take
the learning MongoDB course in our library.
We'll briefly go over the basics and concepts around
using MongoDB so you have a good idea of what we're doing
when we implement the code.
A MongoDB database is one big object containing collections.
Each collection could be like a contextual item,
like for example, contacts for the database we'll create.
Then inside a collection we have documents
which are the contacts themselves.
So my contact information would be in a document,
yours in another, et cetera.
And then inside each document we have the data
for each contact, such as address, telephone,
email, et cetera.
The document looks like a JSON object
with a key-value pair approach or arrays of data.
So where does Mongoose fit into this?
Well, Mongoose will allow us to set a schema
for a collection and predefine what each
key-value pair takes as type.
For example, the first name of a contact will take a string.
But we'll cover this in more detail soon.
So as we continue working on our backend API,
we'll implement these concepts and they'll start
making a bit more sense, if it doesn't right now.
Before we move on, I'd like to install a tool
we'll use to test our Mongo database and make sure
the data we have in our database matches
the calls we make to the imports.
So go to this page, robomongo.org,
and when you get to this page you have two options:
you can download the Studio 3T Only
which has a lot of extra features;
you can download Robo 3T Only which will connect
and do some of the features that we need;
or you can download them both and install them.
So I'm going to go for Robo 3T Only.
You can do anything in here, it's going to be the same thing,
but I'll go for this one for now.
So I'll click on it and then download Robo 3T.
And you have a version for Linux, for Mac, and for Windows.
So if you have Windows you can install this version
the same way we're going to do it in Mac.
So I'm just opening the file.
I'm going to drag and drop Robo 3T in the Applications
and then Eject.
One area that you want to make sure before you start Robo 3T,
you want to make sure that MongoDB has been started.
So if you haven't done it yet, please use the command
that we've shown you earlier.
So now that you have Robo 3T open, what we're going to do is
do a new connection.
So we'll create a new connection.
So most of the time you have all the settings
that you need to run a connection to MongoDB.
So basically, localhost and the port is 27017
which is the port for Mongo, so you can save this
and then connect.
So if you see a connection here and you see
folders like this, that means that you're connected.
So as soon as we add collections to our database,
we're going to see them here.
So you can minimize this for now and we can move on.
Okay, so now that we've got some basics around MongoDB
and a tool we'll use as we implement or database,
let's move on.