code: def convert_to_record(func):
      
      @functools.wraps(func)
      def wrapper(self, *args, **kwargs):
          result = func(self, *args, **kwargs)
          if result is not None:
              if isinstance(result, dict):
                  return _record(result)
              return (_record(i) for i in result)
  
          return result
  
      return wrapper
docs: Wrap mongodb record to a dict record with default value None