Metadata-Version: 2.1
Name: mgqpy
Version: 0.1.7
Summary: mongo query as a python filter predicate
Author-email: Chiawei Ong <ongchiawei@gmail.com>
Description-Content-Type: text/markdown
Classifier: License :: OSI Approved :: MIT License
Project-URL: Home, https://github.com/weiliddat/mgqpy

# mgqpy

mongo query as a python filter predicate

```python
from mgqpy import Query

predicate = Query({"foo.bar": 1})

inputs = [
    {"foo": [{"bar": [1]}]},
    {"foo": {"bar": 1}},
    {"foo": None},
]

filtered = filter(predicate.match, inputs)

assert list(filtered) == [
    {"foo": [{"bar": [1]}]},
    {"foo": {"bar": 1}},
]
```

## Supported operators

Comparison query operators

- [x] \$eq
- [x] \$eq (implicit), e.g. `{"foo": None}`
- [ ] \$ne
- [x] \$gt
- [ ] \$gte
- [ ] \$lt
- [ ] \$lte
- [ ] \$in
- [ ] \$nin

Logical query operators

- [ ] \$and
- [x] \$and (implicit), e.g. `{"foo": 1, "bar": "baz"}`
- [ ] \$or
- [ ] \$not
- [ ] \$nor

Evaluation query operators

- [ ] \$regex
- [ ] \$mod

Array query operators

- [ ] \$all
- [ ] \$elemMatch
- [ ] \$size

