File tree 2 files changed +8
-8
lines changed
2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -386,9 +386,9 @@ def build_query(self, columns=None):
386
386
try :
387
387
expr = where .as_mql (self , self .connection ) if where else {}
388
388
except FullResultSet :
389
- query .mongo_query = {}
389
+ query .match_mql = {}
390
390
else :
391
- query .mongo_query = {"$expr" : expr }
391
+ query .match_mql = {"$expr" : expr }
392
392
if extra_fields :
393
393
query .extra_fields = self .get_project_fields (extra_fields , force_expression = True )
394
394
query .subqueries = self .subqueries
@@ -722,7 +722,7 @@ def execute_sql(self, result_type):
722
722
prepared = prepared .as_mql (self , self .connection )
723
723
values [field .column ] = prepared
724
724
try :
725
- criteria = self .build_query ().mongo_query
725
+ criteria = self .build_query ().match_mql
726
726
except EmptyResultSet :
727
727
return 0
728
728
is_empty = not bool (values )
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ def __init__(self, compiler):
45
45
self .compiler = compiler
46
46
self .query = compiler .query
47
47
self .ordering = []
48
- self .mongo_query = {}
48
+ self .match_mql = {}
49
49
self .subqueries = None
50
50
self .lookup_pipeline = None
51
51
self .project_fields = None
@@ -64,14 +64,14 @@ def collection(self):
64
64
return self .compiler .collection
65
65
66
66
def __repr__ (self ):
67
- return f"<MongoQuery: { self .mongo_query !r} ORDER { self .ordering !r} >"
67
+ return f"<MongoQuery: { self .match_mql !r} ORDER { self .ordering !r} >"
68
68
69
69
@wrap_database_errors
70
70
def delete (self ):
71
71
"""Execute a delete query."""
72
72
if self .compiler .subqueries :
73
73
raise NotSupportedError ("Cannot use QuerySet.delete() when a subquery is required." )
74
- return self .collection .delete_many (self .mongo_query ).deleted_count
74
+ return self .collection .delete_many (self .match_mql ).deleted_count
75
75
76
76
@wrap_database_errors
77
77
def get_cursor (self ):
@@ -87,8 +87,8 @@ def get_pipeline(self):
87
87
pipeline .extend (self .lookup_pipeline )
88
88
for query in self .subqueries or ():
89
89
pipeline .extend (query .get_pipeline ())
90
- if self .mongo_query :
91
- pipeline .append ({"$match" : self .mongo_query })
90
+ if self .match_mql :
91
+ pipeline .append ({"$match" : self .match_mql })
92
92
if self .aggregation_pipeline :
93
93
pipeline .extend (self .aggregation_pipeline )
94
94
if self .project_fields :
You can’t perform that action at this time.
0 commit comments