Member-only story

MongoDB (part1): Basics

Hang Nguyen
Jun 8, 2022

--

MongoDB is a distributed document-oriented NoSQL database. It is used for storing massive volumes of data. It differs from relational databases in its flexibility and performance.

Structure

  • MongoDB contains several collections (can be understood as tables in RDBMS).
  • Each collection contains several documents (each document can be understood as a record in RDBMS). Document has structure that is similar to JSON file, called BSON. It does not necessary have defined structure like in RDBMS.
differences between MongoDB and RDBMS (1/2)
differences between MongoDB and RDBMS (2/2)
Document structure

Create new database and collection

Syntax:

use <new database name>

db.<new collection name>.insertOne({})

CRUD (Create, Read, Update, Delete)

--

--

Hang Nguyen
Hang Nguyen

Written by Hang Nguyen

Just sharing (data) knowledge

No responses yet