Documents in MongoDB are JSON-like objects. JSON is a simple representation of data. It supports the following data types:
number
: In MongoDB, the shell default supports 64-bit floating-point numbers. To process long and integer numbers, MongoDB providesNumberLong
andNumberInt
, which represent 4 bytes and 8 bytes, respectively.string
: Thestring
data type represents the collection of characters. The MongoDB default supports UTF-* character encoding:
- After inserting a date using the preceding way in the document, when we query using
find
it returns a document with a date in the following format: