DSL to MongoEngine Q.
Project description
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.3.tar.gz
(20.8 kB
view hashes)
Built Distribution
Close
Hashes for mongoengine_dsl-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 599927d666ad4bbf35672d3addb13d13f66bc352c1d0370d6d82da83293c2bf8 |
|
MD5 | f793f5a663630cae840f101eb6dee545 |
|
BLAKE2b-256 | 7e872dc691394564e6f1ef050508caaf8a1bd948c31958883dceb4034053b2b9 |