Mongo plugin for aioworkers
.
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({})]
mongo:
cls: aioworkers_mongo.base.Connector
client:
host: 'localhost'
port: 27017
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