Skip to main content

A python library for communicating and Querying mongodb

Project description

dmongo

  • A python library for communicating and Querying mongodb

how to use

  1. Install package
pip install dmongo

  1. import the package
from dmongo.dmongo import mongoQuery

  1. 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")

  1. 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"})

  1. get all record
  • Returns all the record available in the defined collection of the specified Database
Query.getAll()

  1. 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")

  1. 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"})

  1. filtering of record
  • Returns all the record record with the same value as specified
Query.filterBy(data={"name":"JamesDoe"})

  1. deleting a record
  • Deletes a record according to the ID specified.
Query.delete(ID="620843809255d268ce967245")

Project details


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)

Uploaded Source

Built Distribution

dmongo-0.1.0-py3-none-any.whl (2.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page