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):
386386 try :
387387 expr = where .as_mql (self , self .connection ) if where else {}
388388 except FullResultSet :
389- query .mongo_query = {}
389+ query .match_mql = {}
390390 else :
391- query .mongo_query = {"$expr" : expr }
391+ query .match_mql = {"$expr" : expr }
392392 if extra_fields :
393393 query .extra_fields = self .get_project_fields (extra_fields , force_expression = True )
394394 query .subqueries = self .subqueries
@@ -722,7 +722,7 @@ def execute_sql(self, result_type):
722722 prepared = prepared .as_mql (self , self .connection )
723723 values [field .column ] = prepared
724724 try :
725- criteria = self .build_query ().mongo_query
725+ criteria = self .build_query ().match_mql
726726 except EmptyResultSet :
727727 return 0
728728 is_empty = not bool (values )
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ def __init__(self, compiler):
4444 self .compiler = compiler
4545 self .query = compiler .query
4646 self .ordering = []
47- self .mongo_query = {}
47+ self .match_mql = {}
4848 self .subqueries = None
4949 self .lookup_pipeline = None
5050 self .project_fields = None
@@ -56,14 +56,14 @@ def __init__(self, compiler):
5656 self .subquery_lookup = None
5757
5858 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} >"
6060
6161 @wrap_database_errors
6262 def delete (self ):
6363 """Execute a delete query."""
6464 if self .compiler .subqueries :
6565 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
6767
6868 @wrap_database_errors
6969 def get_cursor (self ):
@@ -79,8 +79,8 @@ def get_pipeline(self):
7979 pipeline .extend (self .lookup_pipeline )
8080 for query in self .subqueries or ():
8181 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 })
8484 if self .aggregation_pipeline :
8585 pipeline .extend (self .aggregation_pipeline )
8686 if self .project_fields :
You can’t perform that action at this time.
0 commit comments