Articles → MONGODB → Introduction To MongoDB

Introduction To MongoDB

How The Data Is Stored In MongoDB?

Picture showing the representation of how the documents are stored in MongoDB
Click to Enlarge

Relational Database VS MongoDB

Relational DatabaseMongoDB


Picture showing the process of converting the JSON to BSON
Click to Enlarge

Benefits Of BSON Format Over JSON

  1. BSON is more lightweight than JSON
  2. BSON traverses much more quickly than the JSON format
  3. BSON supports efficient data encoding and decoding

Why BSON Is Lightweight Compared To JSON?

Data Types In BSON

Data TypeDescription
DoubleRepresents the floating-point numbers
StringRepresents the UTF-8 encoded strings
ObjectRepresents embedded documents
ArrayRepresents arrays of elements
Binary DataRepresents binary data such as images or other blobs
ObjectIDRepresents a unique identifier for documents
BooleanRepresents Boolean values of true or false
DateRepresents a date and time value
NullRepresents a null value
Regular ExpressionRepresents regular expression patterns
JavaScriptRepresents JavaScript code
JavaScript (with scope)Represents JavaScript code with additional scope
32-bit IntegerRepresents 32-bit signed integers
TimestampRepresents a BSON timestamp
64-bit IntegerRepresents 64-bit signed integers
Decimal128Represents 128-bit decimal floating-point numbers
Min KeyRepresents a lower bound for comparison purposes
Max KeyRepresents an upper bound for comparison purposes

Posted By  -  Karan Gupta
Posted On  -  Thursday, February 2, 2023
Updated On  -  Tuesday, February 20, 2024


Your Email Id  
Query/FeedbackCharacters remaining 250