File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 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 @@ -44,7 +44,7 @@ def __init__(self, compiler):
44
44
self .compiler = compiler
45
45
self .query = compiler .query
46
46
self .ordering = []
47
- self .mongo_query = {}
47
+ self .match_mql = {}
48
48
self .subqueries = None
49
49
self .lookup_pipeline = None
50
50
self .project_fields = None
@@ -56,14 +56,14 @@ def __init__(self, compiler):
56
56
self .subquery_lookup = None
57
57
58
58
def __repr__ (self ):
59
- return f"<MongoQuery: { self .mongo_query !r} ORDER { self .ordering !r} >"
59
+ return f"<MongoQuery: { self .match_mql !r} ORDER { self .ordering !r} >"
60
60
61
61
@wrap_database_errors
62
62
def delete (self ):
63
63
"""Execute a delete query."""
64
64
if self .compiler .subqueries :
65
65
raise NotSupportedError ("Cannot use QuerySet.delete() when a subquery is required." )
66
- return self .compiler .collection .delete_many (self .mongo_query ).deleted_count
66
+ return self .compiler .collection .delete_many (self .match_mql ).deleted_count
67
67
68
68
@wrap_database_errors
69
69
def get_cursor (self ):
@@ -79,8 +79,8 @@ def get_pipeline(self):
79
79
pipeline .extend (self .lookup_pipeline )
80
80
for query in self .subqueries or ():
81
81
pipeline .extend (query .get_pipeline ())
82
- if self .mongo_query :
83
- pipeline .append ({"$match" : self .mongo_query })
82
+ if self .match_mql :
83
+ pipeline .append ({"$match" : self .match_mql })
84
84
if self .aggregation_pipeline :
85
85
pipeline .extend (self .aggregation_pipeline )
86
86
if self .project_fields :
You can’t perform that action at this time.
0 commit comments