:param dict kwargsql:
          Kwargsql expression to convert

        :return:
          filter to be used in :py:method:`pymongo.collection.find`
        :rtype: dict

def convert(cls, **kwargsql):
        """
        :param dict kwargsql:
          Kwargsql expression to convert

        :return:
          filter to be used in :py:method:`pymongo.collection.find`
        :rtype: dict
        """
        filters = []
        for k, v in kwargsql.items():
            terms = k.split('__')
            if terms[-1] in cls.KWARGQL_SUPPORTED_MONGO_OPS:
                v = {
                    '$' + terms[-1]: v
                }
                if terms[-1] == 'exists':
                    v['$exists'] = bool(v['$exists'])
                terms = terms[:-1]
            elif terms[-1] in cls.KWARGSQL_REGEX_OPS:
                config = cls.KWARGSQL_REGEX_OPS[terms[-1]]
                pattern = '^{prefix}{pattern}{suffix}$'.format(
                    prefix=config.get('prefix', ''),
                    pattern=re.escape(v),
                    suffix=config.get('suffix', '')
                )
                v = {
                    '$regex': pattern,
                    '$options': config.get('options', ''),
                }
                terms = terms[:-1]
            k = '.'.join(terms)
            filters.append({k: v})
        if len(filters) == 0:
            return {}
        if len(filters) == 1:
            return filters[0]
        else:
            return {
                '$and': filters
            }