mongodb 数据类型_MongoDB中的数据类型

mongodb 数据类型

It is known that the MongoDB stores the JSON data in a binary encoded format called BSON, where JSON data model actually extends the BSON in order to provide more flexibility with the additional data types and helps in easily encoding and decoding the data across various programming languages. By default, there is no support for the datatypes like date in JSON. But, BSON provides that feature.

众所周知,MongoDB以称为BSON的二进制编码格式存储JSON数据,其中JSON数据模型实际上扩展了BSON,以便通过其他数据类型提供更大的灵活性,并有助于轻松地跨各种编程语言对数据进行编码和解码。 默认情况下,不支持JSON中的日期等数据类型。 但是,BSON提供了该功能。

MongoDB supports the below list of datatypes. Each datatype in MongoDB possess a unique number.

MongoDB支持以下数据类型列表。 MongoDB中的每个数据类型都有一个唯一的编号。

DatatypeNumberDescription
Double1Used to stored floating point values
String2Commonly used datatype and it is UTF-8 valid
Object3Used for storing embedded objects
Array4Used for storing embedded objects
Binary Data5Used to store binary data
Undefined6Used to store undefined value
Object Id7Used to store document's ID
Boolean9Used to store Boolean value
Date10Used to store current date time in UNIX format.
Null11Used to store null value
Regular Expression12Used to store regex
Javascript13Used to store JavaScript data without scope
Symbol14Basically used to store string, but reserved for languages that use specific symbol
Javascript with scope15Used to store JavaScript data with scope
Integer16 & 18Used to store numerical value
Timestamp10Used to track when a document is modified.
Min/Max Key255/127Used to compare value against lowest and highest BSON elements
数据类型 描述
1个 用于存储浮点值
2 常用的数据类型,它是UTF-8有效
目的 3 用于存储嵌入式对象
数组 4 用于存储嵌入式对象
二进制数据 5 用于存储二进制数据
未定义 6 用于存储未定义的值
对象编号 7 用于存储文档的ID
布尔型 9 用于存储布尔值
日期 10 用于以UNIX格式存储当前日期时间。
空值 11 用于存储空值
正则表达式 12 用于存储正则表达式
Java脚本 13 用于存储无范围JavaScript数据
符号 14 基本上用于存储字符串,但保留给使用特定符号的语言使用
具有范围的Javascript 15 用于存储具有范围JavaScript数据
整数 16和18 用于存储数值
时间戳记 10 用于跟踪文档何时被修改。
最小/最大键 255/127 用于将值与最低和最高BSON元素进行比较

翻译自: https://www.studytonight.com/mongodb/datatypes-in-mongodb

mongodb 数据类型

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值