Python 中的 MongoDB 入门
Filip Schouwenaars
Machine Learning Researcher

| student_id | name | course_code | title |
|---|---|---|---|
| 1 | Amina | CS101 | 编程入门 |
| 1 | Amina | MATH201 | 代数基础 |
| 2 | Luca | CS101 | 编程入门 |
学生
| student_id | name |
|---|---|
| 1 | Amina |
| 2 | Luca |
学生
| student_id | name |
|---|---|
| 1 | Amina |
| 2 | Luca |
课程
| course_code | title |
|---|---|
| CS101 | 编程入门 |
| MATH201 | 代数基础 |
学生
| student_id | name |
|---|---|
| 1 | Amina |
| 2 | Luca |
选课
| student_id | course_code |
|---|---|
| 1 | CS101 |
| 1 | MATH201 |
| 2 | CS101 |
课程
| course_code | title |
|---|---|
| CS101 | 编程入门 |
| MATH201 | 代数基础 |
关系模型



from pymongo import MongoClient# Create client (localhost) client = MongoClient()# Create client (remote server) client2 = MongoClient("mongodb+srv://usr:[email protected]")
Python 中的 MongoDB 入门