Module for working with MongoDB via asyncpg
Project description
aioworkers-mongo
Mongo plugin for aioworkers
.
Usage
Connection
Add this to aioworkers config.yaml:
mongo:
cls: aioworkers_mongo.base.Connector
uri: 'mongodb://localhost:27017/'
You can get access to mongo anywhere via context:
docs = [doc async for doc in context.mongo.db.collection.find({})]
Extended client config
mongo:
cls: aioworkers_mongo.base.Connector
client:
host: 'localhost'
port: 27017
Development
Run Mongo DB:
docker run --rm -p 27017:27017 --name mongo -d mongo
Install dev requirements:
poetry install
Activate env:
. .venv/bin/activate
Run tests:
pytest
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
aioworkers-mongo-0.2.1.tar.gz
(6.9 kB
view hashes)
Built Distribution
Close
Hashes for aioworkers_mongo-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f64b00e6a4d2846eff86d934e1738ab1a6712bacc046edd4d5cd6910c13345cf |
|
MD5 | d9a6624c204e40ae15d8e272b24f5ad5 |
|
BLAKE2b-256 | fcd858f43e8917a0510fffe58afa2b7e837beb41383259d9492914af58ca5d80 |