mysql  mongodb

表     table    Collection

字段  Colum   Fields

行  row  Document

Mongo中的一些概念
--------------+------------------------+-------------------------------------------
SQL术语/概念 MongoDB术语/概念 解释/说明
--------------+------------------------+-------------------------------------------
database database 数据库
--------------+------------------------+-------------------------------------------
table collection 数据库表/集合
--------------+------------------------+-------------------------------------------
row document 数据记录行/文档
--------------+------------------------+-------------------------------------------
column field 数据字段/域
--------------+------------------------+-------------------------------------------
index index 索引
--------------+------------------------+-------------------------------------------
table joins 表连接,MongoDB不支持
--------------+------------------------+-------------------------------------------
primary key primary key 主键,MongoDB自动将"_id"字段设置为主键
--------------+------------------------+-------------------------------------------

例如这张图 整个表叫做Collection

每一列就叫做fields,每一行叫做Document

MongoDB与关系型数据库 区别-LMLPHP

MongoDB不是关系型数据库,没有"表"的概念,没有"字段"的概念,没有"行"的概念。

[  # 大列表就是Collection

    { # 其中一个字典就是 Document
"name": "武大郎", # 其中一个fields
"age": 18,
"gender": "男"
},
{
"name": "孙悟空",
"age": 100000,
"gender": "男"
},
{
"name": "蔡文姬",
"age": 16,
"gender": "女"
} ]
05-11 13:02