📄 Table of Contents

How To Decide If MongoDB Is Right For You

NoSQL

Document-oriented

Schemaless (really?)

Non-relational (really?)

NoSQL Documents vs. Relational Tables in SQL

◉ How to setup and install MongoDB using Homebrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew tap mongodb/brew
brew install mongodb-community@4.0
brew services start mongodb
Object Mapping between Node and MongoDB managed via Mongoose

MongoDB Shell (mongosh)

Install mongosh

brew install mongosh
use dummydb => switched to db dummydbif above db is not present, it will create a new dummy db else will override it. Also, it will not be shown until & unless you insert atleast one collection (table) in db.

Creating Mongoose Schemas

npm install mongoose
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
let blogSchema = new Schema({
title: String,
author: String,
body: String,
comments: [{ body: String, date: Date }],
date: { type: Date, default: Date.now },
hidden: Boolean,
meta: {
votes: Number,
favs: Number
}
});
const Blog = mongoose.model('Blog', blogSchema);

Reference:

Experience with Front-end Technologies and MERN / MEAN Stack. Working on all Major UI Frameworks like React, Angular.