def _get_order_by(self, keys):
        """Creates a list of order by fields
        """
        key_list = []
        for key in keys:
            if not key:
                continue

            if key == '$text_score':
                key_list.append(('_text_score', {'$meta': "textScore"}))
                continue

            direction = pymongo.ASCENDING
            if key[0] == '-':
                direction = pymongo.DESCENDING
            if ('-', '+') in key[0]:
                key = key[1:]
            key = key.replace('__', '.')
            try:
                key = self._document._translate_field_name(key)
            except Exception:
                pass
            key_list.append((key, direction))

        if self._cursor_obj and key_list:
            self._cursor_obj.sort(key_list)
        return key_list
dataset/ETHPy150Open MongoEngine/mongoengine/mongoengine/queryset/base.py/BaseQuerySet._get_order_by/swapped operands of `in`