Metadata-Version: 2.1
Name: aioworkers-mongo
Version: 0.1.0
Summary: Module for working with MongoDB via asyncpg
Home-page: https://github.com/aioworkers/aioworkers-mongo
License: Apache Software License 2.0
Author: Alexander Bogushov
Author-email: abogushov@gmail.com
Requires-Python: >=3.6,<3.11
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: aioworkers (>=0.15)
Requires-Dist: motor (>=1.3,<2.0)
Project-URL: Repository, https://github.com/aioworkers/aioworkers-mongo
Description-Content-Type: text/markdown

# aioworkers-mongo


[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/aioworkers/aioworkers-mongo/CI)](https://github.com/aioworkers/aioworkers-mongo/actions?query=workflow%3ACI)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/aioworkers-mongo)](https://pypi.org/project/aioworkers-mongo)
[![PyPI](https://img.shields.io/pypi/v/aioworkers-mongo)](https://pypi.org/project/aioworkers-mongo)

Mongo plugin for `aioworkers`.


## Usage

### Connection

Add this to aioworkers config.yaml:

```yaml
mongo:
    cls: aioworkers_mongo.base.Connector
    uri: 'mongodb://localhost:27017/'
```

You can get access to mongo anywhere via context:

```python
docs = [doc async for doc in context.mongo.db.collection.find({})]
```

## Development

Run Mongo DB:

```shell
docker run --rm -p 27017:27017 --name mongo -d mongo
```

Install dev requirements:

```shell
poetry install
```

Activate env:

```shell
. .venv/bin/activate
```


Run tests:

```shell
pytest
```

