MongoDB 101
MongoDB basic concept
collection: A collection in MongoDB is the same as a table in MySQL
| SQL | MongoDB | explain |
|---|---|---|
| database | database | |
| table | collection | 数据库表/集合 |
| row | document | 数据库记录行/文档 |
| column | filed | 数据字段/域 |
| index | index | 索引 |
| table joins | 表连接,mongoDB不支持 | |
| primary key | primary key | 主键,MongoDB自动将_id字段设置为主键 |
reference: https://www.runoob.com/mongodb/mongodb-databases-documents-collections.html https://www.w3schools.com/nodejs/nodejs_mongodb_createcollection.asp https://www.w3schools.com/nodejs/nodejs_mongodb_insert.asp https://docs.mongodb.com/manual/tutorial/getting-started/