Data type of MongoDB

Source: Internet
Author: User
Data type of MongoDB

Object ID: ID of the document

String: Strings, most commonly used, must be utf-8

Boolean: Boolean value, True or False

Integer: Integers

Double: Floating-point number

Arrays: Array or list, multiple values stored to a key

Object: Used to embed a document, i.e. a value of one document

NULL: Store null value

Timestamp: Time stamp

Date: Stores the current date or time in Unix time format

Object ID:

Each document has a property that guarantees the uniqueness of the document for _id;

You can set _id to insert the document yourself.

If you do not set it, MongoDB provides a unique _id for each document, which is a 12-byte hexadecimal number

The first 4 bytes are the current timestamp

The next 3 bytes are machine ID

The next 2 bytes for the service process ID of MONGO

The last 3 is a simple increment value

Data type of MongoDB

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.