MongoDB SQL 区别
下表展示了各种 SQL 术语和概念,与 MongoDB 术语和概念类似。
SQL 概念 | MongoDB 概念 |
---|---|
database | Database |
table | Collection |
row | document or BSON document |
column | field |
index | index |
table joins | $lookup, embedded document |
primary key | primary key |
In SQL, we can specify any unique column or column combination as the primary key. | In MongoDB, we don't need to set the primary key. The _id field is automatically set to the primary key. |
aggregation | aggregation pipeline |
SELECT INTO NEW_TABLE | $out |
MERGE INTO TABLE | $merge |
transactions | transactions |
热门文章
优秀文章