A MongoDB client simple demonstration inspired by w3schools's examples
This script demonstrates the most use functions of pymongo, which are explained in w3schools's website includings: database creation, collection creation, data insertion, finding, querying, sorting, deletion, dropping collection, etc.
- You must have your own mongodb service running to serve this demo, or you can easily run it by follow this repo with few steps
- Clone and get into this repo
git clone https://github.com/geeksloth/MongoDB-client-simple-demo.git && cd MongoDB-client-simple-demo
- Install some requirements:
python3 -m pip install --upgrade pip && python3 -m pip install pymongo
- [Recommend] Modify
server
,username
, andpassword
to your MongoDB server. Or you cal leave it default if you use the guide. - Run the demo:
python3 demo.py