/MongoDB-client-simple-demo

A MongoDB client simple demonstration inspired by w3schools's examples

Primary LanguagePython

MongoDB-client-simple-demo

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.

Getting started

  1. 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
  2. Clone and get into this repo
git clone https://github.com/geeksloth/MongoDB-client-simple-demo.git && cd MongoDB-client-simple-demo
  1. Install some requirements:
python3 -m pip install --upgrade pip && python3 -m pip install pymongo
  1. [Recommend] Modify server, username, and password to your MongoDB server. Or you cal leave it default if you use the guide.
  2. Run the demo:
python3 demo.py