Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions pymongo_wrapper/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ def group(self, groupby: List[Union[str, Dict[str, Any]]], **kwargs) -> 'Pipelin
def sort(self, sortby: Union[List[Tuple[str, int]], Tuple[str, int]]) -> 'PipelineBuilder':
if isinstance(sortby, tuple):
sortby = [sortby]
sort_dict = {}
for field, direction in sortby:
sort_dict[field] = direction
sort_dict = dict(sortby)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function PipelineBuilder.sort refactored with the following changes:

self.pipeline.append({'$sort': sort_dict})
return self

Expand Down