Fix limit usage in aggregate

As per https://stackoverflow.com/a/24161461
This commit is contained in:
Neeraj 2019-04-03 19:09:45 +05:30 committed by GitHub
parent 827de76345
commit 9f2a9d9cda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1200,7 +1200,7 @@ class BaseQuerySet(object):
initial_pipeline.append({'$sort': dict(self._ordering)})
if self._limit is not None:
initial_pipeline.append({'$limit': self._limit})
initial_pipeline.append({'$limit': self._limit + self._skip})
if self._skip is not None:
initial_pipeline.append({'$skip': self._skip})