Database
Mongo DB

Explain MongoDB Datatypes

In this tutorial you will learn all datatype of mongoDB in depth.

  • 4.5/5.0
  • Last updated 10 September, 2022
  • By Admin

Following is a list of usable data types in MongoDB.

  • String: String is the most commonly used datatype. It is used to store data. A string must be UTF 8 valid in mongodb.
  • Integer: Integer is used to store the numeric value. It can be 32 bit or 64 bit depending on the server you are using.
  • Boolean: This datatype is used to store boolean values. It just shows YES/NO values.
  • Double: Double datatype stores floating point values.
  • Min/Max Keys: This datatype compare a value against the lowest and highest bson elements.
  • Arrays: This datatype is used to store a list or multiple values into a single key.
  • Object: Object datatype is used for embedded documents.
  • Null: It is used to store null values.
  • Symbol: It is generally used for languages that use a specific type.
  • Date: This datatype stores the current date or time in unix time format. It makes you possible to specify your own date time by creating object of date and pass the value of date, month, year into it.

I hope it can help you...