Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

mongodb data types

StringThis is the most commonly used datatype to store the data. String in MongoDB must be UTF-8 valid.

IntegerThis type is used to store a numerical value. Integer can be 32 bit or 64 bit depending upon your server.

BooleanThis type is used to store a boolean (true/ false) value.

DoubleThis type is used to store floating point values.

Min/ Max keys − This type is used to compare a value against the lowest and highest BSON elements.

ArraysThis type is used to store arrays or list or multiple values into one key.

Timestamp − ctimestamp. This can be handy for recording when a document has been modified or added.

ObjectThis datatype is used for embedded documents.

NullThis type is used to store a Null value.

SymbolThis datatype is used identically to a string; however, it's generally reserved for languages that use a specific symbol type.

DateThis datatype is used to store 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.

Object IDThis datatype is used to store the document’s ID.

Binary data − This datatype is used to store binary data.

CodeThis datatype is used to store JavaScript code into the document.

Regular expression − This datatype is used to store regular expression.
 
PREVIOUS NEXT
Tagged: #mongodb #data #types
ADD COMMENT
Topic
Name
5+8 =