MongoDB 基本概念 一

MongoDB: from humongous. <俚>极大的; 其大无比的, written in C++, JavaScript, C.
使用类似JSON的格式 -> BSON.

MongoDB instance -> Database -> Collection -> Document -> JSON [null, boolean, number, string, object, array]

Document 的键是一个字符串.
MongoDB 不但区分数据类型, 还区分大小写, 还区分 键/值对的顺序.

关于数组:

var arr = ['a', 1, false, null];
arr.forEach(function(x){console.log(x);});

ObjectId 是 _id 的默认类型 (可替换为其他类型). 使用12字节存储空间, 由24个16进制数字字符串表示.
{0..3: 时间戳, 4..6: 机器, 7..8: PID, 9..11: 计数器}

标签: none

添加新评论