Learn the Basics and Get Started with MongoDB

Get into to the world of NoSQL databases

Lynn G. Kwong
8 min readFeb 24, 2022

MongoDB is an open-source document-oriented NoSQL database. NoSQL, which can be interpreted as “non-SQL” or “not only SQL”, means the data is stored differently from Relational DataBase Management System (RDBMS) where data is stored as tables. As a popular NoSQL database, MongoDB stores data as documents, which are NOT Word documents 😄, but are objects with key/value pairs. If you use Python, you can understand documents as dictionaries. And if you have some knowledge of JavaScript, a document is an object in JavaScript. Note that a MongoDB document is not a JSON, which stands for JavaScript Object Notation and is actually the JavaScript object represented as a string.

Image by AlLes on Pixabay.

Technically, the documents in MongoDB are BSON documents, which are binary representations of JSON documents and support more data types such as ObjectId and Timestamps.

A document in MongoDB corresponds to a row in RDBMS. And the keys of a document then correspond to the columns of a row. Similarly, just as the rows are stored in a table in RDBMS, the documents are stored in a collection in MongoDB. And at the highest level, MongoDB also has the concept of databases that store collections rather than tables.

--

--

Lynn G. Kwong

I’m a Software Developer (https://medium.com/@lynn-kwong) keen on sharing thoughts, tutorials, and solutions for the best practice of software development.