MongoDB - Basic Concepts and Comparison with Other Databases

Basic Concepts

NoSql

In NoSql databases, data operations are all completed through commands or programming languages.

In MongoDB uses JavaScript and JSON data structures to operate and manage data.

MongoDB Database vs Relational Database Comparison

MongoDBRelational Database
Database (Database)Database (Database)
Collection (Collection)Table (Table)
Document (Document)Record (Record)

MongoDB vs RDBMS Corresponding Terms

MongoDBRDBMS
DatabaseDatabase
CollectionTable
DocumentRow
FieldColumn
Embedded DocumentTable Join
Primary Key (MongoDB provides key as _id )Primary Key

MongoDB Data Types

Data TypeDescription
StringString. Common data type for storing data. In MongoDB, UTF-8 encoded strings are legal.
IntegerInteger value. Used to store numeric values. Depending on server you adopt, can be 32-bit or 64-bit.
BooleanBoolean value. Used to store boolean values (true/false).
DoubleDouble precision floating point value. Used to store floating point values.
Min/Max keysCompare a value with BSON (binary JSON) element’s lowest and highest values.
ArrayUsed to store arrays or lists or multiple values as one key.
TimestampTimestamp. Records document modification or addition specific time.
ObjectUsed for embedded documents.
NullUsed to create empty values.
SymbolSymbol. This data type basically equals string type, but difference is, it’s generally used for languages using special symbol types.
DateDate time. Uses UNIX time format to store current date or time. You can specify your own date time: create Date object, pass year month day information.
Object IDObject ID. Used to create document’s ID.
Binary DataBinary data. Used to store binary data.
CodeCode type. Used to store JavaScript code in documents.
Regular expressionRegular expression type. Used to store regular expressions.

Article Link:

https://alili.tech/en/archive/1f77f611/

# Latest Articles