Skip to content

Commit

Permalink
fix: batch size applied properly to new qs
Browse files Browse the repository at this point in the history
  • Loading branch information
jkassemi committed Jan 8, 2025
1 parent 15fd2a5 commit c93f2af
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mongoengine/queryset/queryset.py
Original file line number Diff line number Diff line change
Expand Up @@ -806,15 +806,20 @@ def hint(self, index=None):
queryset = self.clone()
queryset._hint = index

# If a cursor object has already been created, apply the hint to it.
if queryset._cursor_obj:
queryset._cursor_obj.hint(queryset._hint)

return queryset

def batch_size(self, size):
queryset = self.clone()
queryset._cursor.batch_size(size)
queryset._batch_size = size

# If a cursor object has already been created, apply the batch size to it.
if queryset._cursor_obj:
queryset._cursor_obj.batch_size(queryset._batch_size)

return queryset

def distinct(self, field, dereference=True):
Expand Down

0 comments on commit c93f2af

Please sign in to comment.