

def sort(self, key_or_list, direction=None):
    "Sorts this cursor's results.\n\n        Takes either a single key and a direction, or a list of (key,\n        direction) pairs. The key(s) must be an instance of ``(str,\n        unicode)``, and the direction(s) must be one of\n        (:data:`~pymongo.ASCENDING`,\n        :data:`~pymongo.DESCENDING`). Raises\n        :class:`~pymongo.errors.InvalidOperation` if this cursor has\n        already been used. Only the last :meth:`sort` applied to this\n        cursor has any effect.\n\n        :Parameters:\n          - `key_or_list`: a single key or a list of (key, direction)\n            pairs specifying the keys to sort on\n          - `direction` (optional): only used if `key_or_list` is a single\n            key, if not given :data:`~pymongo.ASCENDING` is assumed\n        "
    self.__check_okay_to_chain()
    keys = helpers._index_list(self, direction)
    self.__ordering = helpers._index_document(keys)
    return self

dataset/ETHPy150Open blynch/CloudMemeBackend/pymongo/cursor.py Cursor.sort/VarMisuse@30/341 `key_or_list`->`self`