CRUD in MongoDB
CRUD operations in MongoDB, i.e. Create, Read, Update, Delete.
The code is for Pymongo.
Preparation
1 | import datetime |
CREATE:
1 | def create_lines(): |
READ:
1 | def read_lines(): |
UPDATE:
1 | def update_lines(): |
DELETE:
1 | def delete_lines(): |
I would say MongoDB is designed in a way that is very user-friendly.
Check out the pymongo website for more detailed instructions.
https://pymongo.readthedocs.io/en/stable/tutorial.html