Skip to content

Commit 6838f43

Browse files
committed
Drop support for MongoDB 6.0
It will be end of life July 31, 2024.
1 parent 0ac7ca9 commit 6838f43

File tree

3 files changed

+8
-28
lines changed

3 files changed

+8
-28
lines changed

.evergreen/config.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,21 +69,21 @@ tasks:
6969

7070
buildvariants:
7171
- name: tests-6-noauth-nossl
72-
display_name: Run Tests 6.0 NoAuth NoSSL
72+
display_name: Run Tests 7.0 NoAuth NoSSL
7373
run_on: rhel87-small
7474
expansions:
75-
MONGODB_VERSION: "6.0"
75+
MONGODB_VERSION: "7.0"
7676
TOPOLOGY: server
7777
AUTH: "noauth"
7878
SSL: "nossl"
7979
tasks:
8080
- name: run-tests
8181

8282
- name: tests-6-auth-ssl
83-
display_name: Run Tests 6.0 Auth SSL
83+
display_name: Run Tests 7.0 Auth SSL
8484
run_on: rhel87-small
8585
expansions:
86-
MONGODB_VERSION: "6.0"
86+
MONGODB_VERSION: "7.0"
8787
TOPOLOGY: server
8888
AUTH: "auth"
8989
SSL: "ssl"

django_mongodb_backend/features.py

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
from django.db.backends.base.features import BaseDatabaseFeatures
2-
from django.utils.functional import cached_property
32

43

54
class DatabaseFeatures(BaseDatabaseFeatures):
6-
minimum_database_version = (6, 0)
5+
minimum_database_version = (7, 0)
76
allow_sliced_subqueries_with_in = False
87
allows_multiple_constraints_on_same_fields = False
98
can_create_inline_fk = False
@@ -39,7 +38,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
3938
supports_unspecified_pk = True
4039
uses_savepoints = False
4140

42-
_django_test_expected_failures = {
41+
django_test_expected_failures = {
4342
# $concat only supports strings, not int
4443
"db_functions.text.test_concat.ConcatTests.test_concat_non_str",
4544
# QuerySet.order_by() with annotation transform doesn't work:
@@ -89,23 +88,6 @@ class DatabaseFeatures(BaseDatabaseFeatures):
8988
# https://jira.mongodb.org/browse/SERVER-99186
9089
"model_fields_.test_arrayfield.QueryingTests.test_contained_by_subquery",
9190
}
92-
# $bitAnd, #bitOr, and $bitXor are new in MongoDB 6.3.
93-
_django_test_expected_failures_bitwise = {
94-
"expressions.tests.ExpressionOperatorTests.test_lefthand_bitwise_and",
95-
"expressions.tests.ExpressionOperatorTests.test_lefthand_bitwise_or",
96-
"expressions.tests.ExpressionOperatorTests.test_lefthand_bitwise_xor",
97-
"expressions.tests.ExpressionOperatorTests.test_lefthand_bitwise_xor_null",
98-
"expressions.tests.ExpressionOperatorTests.test_lefthand_bitwise_xor_right_null",
99-
"expressions.tests.ExpressionOperatorTests.test_lefthand_transformed_field_bitwise_or",
100-
}
101-
102-
@cached_property
103-
def django_test_expected_failures(self):
104-
expected_failures = super().django_test_expected_failures
105-
expected_failures.update(self._django_test_expected_failures)
106-
if not self.is_mongodb_6_3:
107-
expected_failures.update(self._django_test_expected_failures_bitwise)
108-
return expected_failures
10991

11092
django_test_skips = {
11193
"Database defaults aren't supported by MongoDB.": {
@@ -607,7 +589,3 @@ def django_test_expected_failures(self):
607589
"custom_lookups.tests.SubqueryTransformTests.test_subquery_usage",
608590
},
609591
}
610-
611-
@cached_property
612-
def is_mongodb_6_3(self):
613-
return self.connection.get_database_version() >= (6, 3)

docs/source/releases/5.1.x.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Django MongoDB Backend 5.1.x
1111
:attr:`~.ArrayField.size` parameter is renamed to
1212
:attr:`~.ArrayField.max_size`. The :attr:`~.ArrayField.size` parameter is now
1313
used to enforce fixed-length arrays.
14+
- Backward-incompatible: Bumped the minimum supported version of MongoDB from
15+
6.0 to 7.0.
1416
- Added support for :doc:`database caching </topics/cache>`.
1517
- Fixed ``QuerySet.raw_aggregate()`` field initialization when the document key
1618
order doesn't match the order of the model's fields.

0 commit comments

Comments
 (0)