DSL to MongoEngine Q.
Project description
DSL to MongoEngine Q
Features
- Build your mongoengine query from DSL syntax
- Convert your data at build time via transform hook
Quickstart
Install
pip install mongoengine_dsl
Use
from mongoengine import Document, StringField
from mongoengine_dsl import Query
class User(Document):
fullname = StringField()
User(fullname="Tom").save()
User(fullname="Dick").save()
User(fullname="Harry").save()
assert User.objects(
Query("fullname: Dick")
).first().fullname == "Dick"
assert User.objects(
Query("fullname: dick", transform={
"fullname": lambda x: x.title()
})
).first().fullname == "Dick"
More
Full Documentation: https://stonemoe.github.io/mongoengine_dsl
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
mongoengine_dsl-0.1.5.tar.gz
(20.6 kB
view hashes)
Built Distribution
Close
Hashes for mongoengine_dsl-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff24a87c7179f26fe6d2c53b3daaf9c15bf2bef7ee8071b517df95afc5259df0 |
|
MD5 | cdf7bf4bd6cecb27946a218b40c9f1c4 |
|
BLAKE2b-256 | f1167723aa01db851bc6302949996ff72b61c7b9bd9f0dd69694c66efada6de3 |