MongoDB data types

The tutorial provides the commonly used data types available in the MongoDB NoSQL Database.

MongoDB allows to store different fields with different content and size in the document and uses the below given data types for the same.

MongoDB Data Type Data Type Description
Integer use to store integer value . Integer can be 32-bit or 64-bit
Doubleuse to store double (floating) values
Stringuse to store string values which must be UTF-8 valid in MongoDB
Boolean use to store boolean (true/false) values
Date use to store current date and time in unix time format
TimeStamp use to store timestamp for record creation /updation
Arraysuse to store multiple list /values or arrays into a single key
Min Max Keysuse to compare a value against the lowest and highest BSON elements
Objectuse to store embedded documents
Symboluse to store specific symbol type
Nulluse to store NULL value
Binary Data use to store binary data
Code use to store javaScript code into document
Regular Expressions use to store regular expressions