1
- import operator
2
-
3
1
from django .db .backends .base .features import BaseDatabaseFeatures
4
2
from django .utils .functional import cached_property
5
3
6
4
7
5
class DatabaseFeatures (BaseDatabaseFeatures ):
8
- minimum_database_version = (5 , 0 )
6
+ minimum_database_version = (6 , 0 )
9
7
allow_sliced_subqueries_with_in = False
10
8
allows_multiple_constraints_on_same_fields = False
11
9
can_create_inline_fk = False
@@ -24,10 +22,6 @@ class DatabaseFeatures(BaseDatabaseFeatures):
24
22
supports_expression_indexes = False
25
23
supports_foreign_keys = False
26
24
supports_ignore_conflicts = False
27
- # Before MongoDB 6.0, $in cannot be used in partialFilterExpression.
28
- supports_in_index_operator = property (operator .attrgetter ("is_mongodb_6_0" ))
29
- # Before MongoDB 6.0, $or cannot be used in partialFilterExpression.
30
- supports_or_index_operator = property (operator .attrgetter ("is_mongodb_6_0" ))
31
25
supports_json_field_contains = False
32
26
# BSON Date type doesn't support microsecond precision.
33
27
supports_microsecond_precision = False
@@ -97,16 +91,11 @@ class DatabaseFeatures(BaseDatabaseFeatures):
97
91
"expressions.tests.ExpressionOperatorTests.test_lefthand_bitwise_xor_right_null" ,
98
92
"expressions.tests.ExpressionOperatorTests.test_lefthand_transformed_field_bitwise_or" ,
99
93
}
100
- _django_test_expected_failures_partial_expression_in = {
101
- "schema.tests.SchemaTests.test_remove_ignored_unique_constraint_not_create_fk_index" ,
102
- }
103
94
104
95
@cached_property
105
96
def django_test_expected_failures (self ):
106
97
expected_failures = super ().django_test_expected_failures
107
98
expected_failures .update (self ._django_test_expected_failures )
108
- if not self .supports_in_index_operator :
109
- expected_failures .update (self ._django_test_expected_failures_partial_expression_in )
110
99
if not self .is_mongodb_6_3 :
111
100
expected_failures .update (self ._django_test_expected_failures_bitwise )
112
101
return expected_failures
@@ -601,10 +590,6 @@ def django_test_expected_failures(self):
601
590
},
602
591
}
603
592
604
- @cached_property
605
- def is_mongodb_6_0 (self ):
606
- return self .connection .get_database_version () >= (6 , 0 )
607
-
608
593
@cached_property
609
594
def is_mongodb_6_3 (self ):
610
595
return self .connection .get_database_version () >= (6 , 3 )
0 commit comments