code: def to_dict(self):
          
          if self.operator == '$eq':
              return {self.q: self.value}
          if self.q is None:
              return {self.operator: self.value}
          return {self.q: {self.operator: self.value}}
docs: Return a dictionary suitable for use with pymongo as a filter