def to_dict(self):
if self.operator == '<STR_LIT>':<EOL><INDENT>return {self.q: self.value}<EOL><DEDENT>if self.q is None:<EOL><INDENT>return {self.operator: self.value}<EOL><DEDENT>return {self.q: {self.operator: self.value}}<EOL>
Return a dictionary suitable for use with pymongo as a filter