MongoDB supports the following data types:
1. String: This is the most commonly used datatype to store data.
1. Integer: This type is used to store numerical values. Integer can be further classified into two types: 32 bit and 64 bit.
1. Boolean: This type is used to store boolean (true/ false) values.
1. Double: This type is used to store floating point values.
1. Min/ Max keys: This type is used to compare a value against the lowest and highest BSON (Binary JSON) elements.
1. Arrays: This type is used to store arrays or list or multiple values into one key.
1. Timestamp: This can be helpful for recording when a document has been modified or added.
1. Object: This datatype is used for embedded documents.
1. Null: This type is used to store a Null value.
1. Symbol: This datatype is identical to a string; however, it’s generally reserved for languages that use a specific symbol type.
1. Date: This datatype is used for storing the current date or time in UNIX time format. You can specify your own date time by creating object of Date and passing day, month, year into it.
1. Object ID: This datatype is used to store the document’s ID.
1. Binary data: This datatype is used for storing binary data.
1. Code: This datatype is used to store JavaScript code into the document.
1. Regular expression: This datatype is used to store regular expression.
These datatypes are used while writing the schemas for the collections in MongoDB database.