Data type in MongoDB

Data type in MongoDB

In this blog , we will learn about data type in MongoDB. If you are working with MongoDB for your project then before going into MongoDB queries and collection you need to understand about data type in MongoDB. For every field data type is very important to define to give you proper data structure.

MongoDB Supports various data type , I am explaining some of them as below :-

  • String : String is very common in every data schema, it is used to store text or varchar type data, String must be UTF-8.
  • Integer : It is used to store numeric data.
  • Boolean : It is used to store true/false or 0/1 value
  • Double : It is used to store floating value
  • Min/Max Keys : These type is used to compare min / max value
  • Arrays : It is used to store multiple values into 1 variable/key
  • Timestamp : It is used to store document create/modified time
  • Object: It is used to store embedded document
  • Null : It is used to store null value
  • Symbol : This datatype is used identically to a string; however, it’s generally reserved for languages that use a specific symbol type.
  • Date : It is used to store date
  • Object Id : It is used to store document id , generally used for reference id of other document
  • Binary Data : It is used to store binary data
  • Code: It is used to store java script code
  • Regular expression : It is used to store regular expression

Hope you like our this blog , Please share with your friends and visit us again.

Leave a Reply
Your email address will not be published. *