Member-only story
MongoDB (part1): Basics
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.
Create new database and collection
Syntax:
use <new database name>
db.<new collection name>.insertOne({})