Data Types
The full doc is here: BSON Types
The language used in
mongosh
is javascript.
ObjectId
It's the ID of the document in the collection.
String
The limit is the 16mb.
Boolean
Number
By default, it's double
. It's float64. However, there are other types.
-
Integer: It's int32 (+- 2<sup>32</sup>). It's created by
new NumberInt()
inmongosh
. -
NumberLong: It's int64 (+- 2<sup>64</sup>). It's created by
new NumberLong()
inmongosh
. -
NumberDecimal: It's very precise. It's created by
new NumberDecimal()
inmongosh
.
Date
There are:
-
ISODate: It can be created by
new Date()
inmongosh
. -
Timestamp: It can be created by
new Timestamp()
inmongosh
.
Array
Embedded document
The limit is the 16mb.
Additionally, you may only have 100 levels of embedded documents.