Data Types
- Boolean (true/false)
- Numbers
- Strings
- Dates
- Timestamps
- ObjectId
- Binary Data
- Objects (Nested documents)
- Arrays
- Null
Booleans
Numbers
| Type | Description |
|---|---|
| int | 32-bit signed integer |
| double | 64-bit floating point |
| long | 64-bit unsigned integer |
| decimal | 128-bit floating point |
Strings
ObjectId
| Type | Description |
|---|---|
| ObjectId | Unique value of 12 bytes |
The first 4 bytes represent the timestamp, 5 bytes to represent random value, and 3 bytes to represent an incremental counter.
Binary Data
Objects (Nested documents)
info
A MongoDB BSON document supports nesting up to 100 levels.
caution
Performance and memory consumption issues arise when the number of nesting levels increases.