DocumentDB/MongoDB backend for Django
Project description
DocumentDB/MongoDB backend for Django
This project, django-documentdb, is a fork of the original django-mongodb repository, which was developed and maintained by the MongoDB Python Team. The primary purpose of this fork is to enhance compatibility with AWS DocumentDB, a MongoDB-compatible database service provided by Amazon Web Services. To accommodate the differences between DocumentDB and MongoDB’s API support, specific adjustments have been implemented to ensure seamless functionality within DocumentDB.
We encourage users to provide feedback and report any issues as we continue to improve the library. You can share your thoughts, suggestions, or report problems on our GitHub Issues page
Documentation
For full documentation, including installation, configuration, etc. Please see https://django-documentdb.readthedocs.io/
Installation
To install django_documentdb, use one of the following methods:
Using pip
You can install django_documentdb with:
pip install django_documentdb
Using Poetry
If you're using Poetry to manage your dependencies, you can add django_documentdb to your project with:
poetry add django_documentdb
Notes on Django QuerySets
django-documentdb uses own QuerySet implementation (DocumentQuerySet) if you inherit your models from DocumentModel class.
Example:
from django_documentdb.models import DocumentModel
from django_documentdb import fields
from django.db import models
class TestModel(DocumentModel):
_id = fields.ObjectIdAutoField(primary_key=True)
text_value = models.CharField(max_length=100, null=True)
number_value = models.FloatField(null=True)
class Meta:
db_table = "test_db"
Available options with DocumentQuerySet:
-
QuerySet.explain()supports thecommentandverbosityoptions.Example:
QuerySet.explain(comment="...", verbosity="...")Valid values for
verbosityare"queryPlanner"(default),"executionStats", and"allPlansExecution". -
DocumentQuerySet.index_hint(index_name)- allows to specify index hint for query.
Known issues and limitations
-
The following
QuerySetmethods aren't supported:bulk_update()dates()datetimes()distinct()extra()prefetch_related()
-
QuerySet.delete()andupdate()do not support queries that span multiple collections. -
DateTimeFielddoesn't support microsecond precision, and correspondingly,DurationFieldstores milliseconds rather than microseconds. -
The following database functions aren't supported:
ChrExtractQuarterMD5NowOrdPadRepeatReverseRightSHA1,SHA224,SHA256,SHA384,SHA512SignTruncDateTruncTime
-
The
tzinfoparameter of theTruncdatabase functions doesn't work properly because MongoDB converts the result back to UTC. -
When querying
JSONField:- There is no way to distinguish between a JSON "null" (represented by
Value(None, JSONField())) and a SQL null (queried using theisnulllookup). Both of these queries return both of these nulls. - Some queries with
Qobjects, e.g.Q(value__foo="bar"), don't work properly, particularly withQuerySet.exclude(). - Filtering for a
Nonekey, e.g.QuerySet.filter(value__j=None)incorrectly returns objects where the key doesn't exist. - You can study the skipped tests in
DatabaseFeatures.django_test_skipsfor more details on known issues.
- There is no way to distinguish between a JSON "null" (represented by
-
Due to the lack of ability to introspect MongoDB collection schema,
migrate --fake-initialisn't supported.
Forked Project
This project, django-documentdb, is a fork of the original django-mongodb library, which aimed to integrate MongoDB with Django. The fork was created to enhance compatibility with AWS DocumentDB, addressing the limitations of its API support while maintaining the core functionalities of the original library. We appreciate the work of the MongoDB Python Team and aim to build upon their foundation to better serve users needing DocumentDB integration.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_documentdb-0.0.13.tar.gz.
File metadata
- Download URL: django_documentdb-0.0.13.tar.gz
- Upload date:
- Size: 51.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb71934ffcb165501ef1a9aeadb9c08ebbec47f9f7d298fc4a4a95c762293042
|
|
| MD5 |
3cb67f9940e2f137b6b23c87890b268c
|
|
| BLAKE2b-256 |
a19aaceea63e4cf4eaacdca20a6dd59be1c85834de7c388cd7d1de6eff697526
|
Provenance
The following attestation bundles were made for django_documentdb-0.0.13.tar.gz:
Publisher:
publish-package.yml on iYasha/django-documentdb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_documentdb-0.0.13.tar.gz -
Subject digest:
cb71934ffcb165501ef1a9aeadb9c08ebbec47f9f7d298fc4a4a95c762293042 - Sigstore transparency entry: 458503674
- Sigstore integration time:
-
Permalink:
iYasha/django-documentdb@e86cc9574a3fc468076c29302a2f3ccc08bc498b -
Branch / Tag:
refs/tags/v0.0.13 - Owner: https://github.com/iYasha
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-package.yml@e86cc9574a3fc468076c29302a2f3ccc08bc498b -
Trigger Event:
release
-
Statement type:
File details
Details for the file django_documentdb-0.0.13-py3-none-any.whl.
File metadata
- Download URL: django_documentdb-0.0.13-py3-none-any.whl
- Upload date:
- Size: 54.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b34b57d4c0be8d1047437860437413419cd908596573b4021c1bd8398dd646a1
|
|
| MD5 |
78c4434e87c661dbdd006a1233d4a0a4
|
|
| BLAKE2b-256 |
31a34c5f4684255e6bb4166f29924bf39d44a80d55feaf627b79b14b298ddf99
|
Provenance
The following attestation bundles were made for django_documentdb-0.0.13-py3-none-any.whl:
Publisher:
publish-package.yml on iYasha/django-documentdb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_documentdb-0.0.13-py3-none-any.whl -
Subject digest:
b34b57d4c0be8d1047437860437413419cd908596573b4021c1bd8398dd646a1 - Sigstore transparency entry: 458503689
- Sigstore integration time:
-
Permalink:
iYasha/django-documentdb@e86cc9574a3fc468076c29302a2f3ccc08bc498b -
Branch / Tag:
refs/tags/v0.0.13 - Owner: https://github.com/iYasha
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-package.yml@e86cc9574a3fc468076c29302a2f3ccc08bc498b -
Trigger Event:
release
-
Statement type: