Full-Stack Web Development with Vue.js and Node

(singke) #1
Introducing MEVN Chapter 1

Each document is stored in a JSON-structured format.
Querying and Indexing the MongoDB is very easy.
MongoDB is a free and open source program.

Installing MongoDB on macOS


There are two ways to install MongoDB. We can either download it from the official
MongoDB website (https:/​/​www.​mongodb.​org/​downloads#production) or we can use


Homebrew to install it.


Installing MongoDB by downloading


  1. Download the version of MongoDB you want from https:/​/​www.​mongodb.​com/
    download-​center#production.​

  2. Copy the downloaded gzipped to the root folder. Adding it to the root folder will
    allow us to use it globally:


$ cd Downloads
$ mv mongodb-osx-x86_64-3.0.7.tgz ~/


  1. Unzip the gzipped file:


$ tar -zxvf mongodb-osx-x86_64-3.0.7.tgz


  1. Create a directory that will be used by Mongo to save data:


$ mkdir -p /data/db


  1. Now, to check if the installation was done successfully, start the Mongo server:


$ ~/mongodb/bin/mongod

Here, we have successfully installed and started the mongo server.

Free download pdf