MongoDB vs SQL Terminology


MongoDB is a NoSQL product so the terminology is used in SQL not used in MongoDB, but the comparing SQL things with NoSQL will speedup the learning process.

Terminology Description
1field A name-value pair. It is similar concept of column of an RDBMS
2document A group of fields are termed as document. In RDBMS we will term it as row. MongoDB document follows JSON syntax but it is a BSON syntax (BSON is an extended version of JSON implemented by MongoDB).
3collection A group of documents called collection in MongoDB. A collection is similar concept of table of an RDBMS.
4database A Physical Container for Collections. Each database gets its own set of files on the file system. A single MongoDB server typically has multiple databases

Let’s view this Table presents the various SQL terminology and concepts and the corresponding MongoDB terminology and concepts.

SQL TermsMongoDB Terms
databasedatabase
tablecollection
rowdocument or BSON document
columnfield
indexindex
table joinsembedded documents and linking
primary key
Specify any unique column or
column combination as primary key.
primary key
In MongoDB, the primary key is automatically
set to the _id field.
aggregation (e.g. group by)aggregation pipeline


SQL ConceptsMongoDB
Aggregation Operators
WHERE$match
GROUP BY$group
HAVING$match
SELECT$project
ORDER BY$sort
LIMIT$limit
SUM()$sum
COUNT()$sum
join$lookup


Executables Comparison

The following table presents some database executables and the corresponding MongoDB executables. This table is not meant to be exhaustive.

MongoDBMySQLOracle InformixDB2
Database ServermongodmysqldoracleIDSDB2 Server
Database ClientmongomysqlsqlplusDB-AccessDB2 Client
Copyright © 2018-2020 TutorialToUs. All rights reserved.