A python library for communicating and Querying mongodb
Project description
dmongo
- A python library for communicating and Querying mongodb
how to use
- Install package
pip install dmongo
- import the package
from dmongo.dmongo import mongoQuery
- initializing dmongo
- To initialize dmongo, create a MONGO_URI, you either create the Database or dmongo will automatically creates it, if it doesn"t exist.
Query=mongoQuery(MONGO_URI="localhost:27017",Database="geof",collections="movies")
- creating a record
- To create a new record, send in a data in this Dictionary format, where the key pair is the record name and the value pair is the value to be stored.
Query.create({"name":"JohnDoe","email":"jdoe@gmail.com","username":"JohnD"})
- get all record
- Returns all the record available in the defined collection of the specified Database
Query.getAll()
- get one record
- Returns a particular record from the defined collection of the specified database base on it's ID. which is unique across the collection.
Query.getOne(ID="620843809255d268ce967245")
- updating a record
- replaces the existing value of the specified key pair with a new value of the specified value pair according to the ID specified.
Query.update(ID="620843809255d268ce967245",data={"name":"JamesDoe"})
- filtering of record
- Returns all the record record with the same value as specified
Query.filterBy(data={"name":"JamesDoe"})
- deleting a record
- Deletes a record according to the ID specified.
Query.delete(ID="620843809255d268ce967245")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dmongo-0.1.0.tar.gz
(2.2 kB
view hashes)
Built Distribution
dmongo-0.1.0-py3-none-any.whl
(2.5 kB
view hashes)