MongoDB Data Types
The BSON data format provides several different types that are used when storing the JavaScript objects to binary form. These types match the JavaScript types as closely as possible. It is important to understand these types because you can actually query MongoDB to find objects that have a specific property which has a value of a certain type. For example, you can look for documents in a database whose timestamp value is a String object or query for ones whose timestamp value is a Date object.
MongoDB assigns each of the data types an integer ID number from 1 to 255 that is used when querying by type. Table 11.1 shows a list of the data types that MongoDB supports, along with the numbers MongoDB uses to identify them.
Another ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access