Skip to content

Commit

Permalink
Merge pull request #26 from certego/develop
Browse files Browse the repository at this point in the history
Hotfix
  • Loading branch information
0ssigeno authored Sep 29, 2022
2 parents 8302dc7 + f7ec1e5 commit dd22df5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions atlasq/queryset/queryset.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,19 @@ def _query(self):
logger.debug(self._query_obj.to_query(self._document))
return super()._query

def aggregate(self, pipeline, *suppl_pipeline, **kwargs):
def aggregate(self, pipeline, **kwargs): # pylint: disable=arguments-differ
self._return_objects = False
if isinstance(pipeline, dict):
pipeline = [pipeline]
return super().aggregate(self._aggrs + pipeline, *suppl_pipeline)

final_pipeline = self._aggrs + pipeline
collection = self._collection
if self._read_preference is not None or self._read_concern is not None:
collection = self._collection.with_options(
read_preference=self._read_preference, read_concern=self._read_concern
)

return collection.aggregate(final_pipeline, cursor={}, **kwargs)

def __call__(self, q_obj=None, **query):
if self.index is None:
Expand Down

0 comments on commit dd22df5

Please sign in to comment.