redis-om-python
redis-om-python copied to clipboard
how can I search by condition
results = []
if name:
results = BaseProductPy.find(BaseProductPy.name % f"{name}*")
if tags:
results = results.find(BaseProductPy.tag.value == tags)
if city:
results = results.find(BaseProductPy.address.city == city)
return results
how can i search by condition where if name is there, find by name. if tag is there, find by name and tag. If city is there, find by name, tag and city.
how can i do that?