Skip to main content

easy to use mongo(kb)

Project description

Easy to use python mongo(for kb first)

pymongo Reference: https://pymongo.readthedocs.io/en/3.10.0/tutorial.html

Quick Start

Installation: pip install easy_mongo

1.config

Edit conf/conf.yml

mongo: # mongo config
  host: 127.0.0.1
  port: 27017
  name: db_name
  password: password # blank if not require

2.demo

from easy_mongo.mongo import EasyMongo

def demo_mongo():
    easy_mongo = EasyMongo('../conf/conf.yml')
    col = easy_mongo.get_collection('country')
    # get first 10 items
    # reference pymongo
    for item in col.find().limit(10):
        print(item)


if __name__ == '__main__':
    demo_mongo()

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

easy_mongo-0.0.4.tar.gz (2.5 kB view hashes)

Uploaded Source

Built Distribution

easy_mongo-0.0.4-py3-none-any.whl (3.4 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