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 details)
Built Distribution
File details
Details for the file mongoengine_dsl-0.1.5.tar.gz
.
File metadata
- Download URL: mongoengine_dsl-0.1.5.tar.gz
- Upload date:
- Size: 20.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f7326f45b0e1f8d0dd8a3f2423d123e1afcf5c7f34ce1afca419ee9837221ba |
|
MD5 | 8401595bd213e59e2aff45c5c000691e |
|
BLAKE2b-256 | 7f122051f707d72b383999069b0ed8ff3db76148504a25eb9f69caf8954ac629 |
File details
Details for the file mongoengine_dsl-0.1.5-py3-none-any.whl
.
File metadata
- Download URL: mongoengine_dsl-0.1.5-py3-none-any.whl
- Upload date:
- Size: 21.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff24a87c7179f26fe6d2c53b3daaf9c15bf2bef7ee8071b517df95afc5259df0 |
|
MD5 | cdf7bf4bd6cecb27946a218b40c9f1c4 |
|
BLAKE2b-256 | f1167723aa01db851bc6302949996ff72b61c7b9bd9f0dd69694c66efada6de3 |