Skip to content

Add support for JSONArray function #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions django_mongodb_backend/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ class DatabaseFeatures(BaseDatabaseFeatures):
# of $setIsSubset must be arrays. Second argument is of type: null"
# https://jira.mongodb.org/browse/SERVER-99186
"model_fields_.test_arrayfield.QueryingTests.test_contained_by_subquery",
# JSONArray not implemented.
"db_functions.json.test_json_array.JSONArrayTests",
# Some usage of prefetch_related() raises "ColPairs is not supported."
"known_related_objects.tests.ExistingRelatedInstancesTests.test_one_to_one_multi_prefetch_related",
"known_related_objects.tests.ExistingRelatedInstancesTests.test_one_to_one_prefetch_related",
Expand Down
2 changes: 2 additions & 0 deletions django_mongodb_backend/functions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from django.db import NotSupportedError
from django.db.models.expressions import Func
from django.db.models.functions import JSONArray
from django.db.models.functions.comparison import Cast, Coalesce, Greatest, Least, NullIf
from django.db.models.functions.datetime import (
Extract,
Expand Down Expand Up @@ -238,6 +239,7 @@ def register_functions():
Cot.as_mql = cot
Extract.as_mql = extract
Func.as_mql = func
JSONArray.as_mql = process_lhs
Left.as_mql = left
Length.as_mql = length
Log.as_mql = log
Expand Down