Open dehuy69 opened 2 years ago
I think the translated SQL query would be something like:
SELECT *, COUNT(skills)
FROM Person
GROUP BY skills
HAVING COUNT(skills) > 1;
Or redis search version:
FT.AGGREGATE "idx:skills" GROUPBY 4 @skills REDUCE COUNT 4 AS nb_skills FILTER "nb_skills > 1"
Not sure if I can confirm now it is not supported yet in redis-om
has a HAVING
functionalityredis-om
, and it is being tracked in issues/258, i may work on it. However, if you want to accomplish it with the current setup, you can do something like:
results = Person.find().all()
results = [person for person in results if len(person.skills) > 1])
Closing - refer to #258 thanks.
Hello, how can i query condition which use len of list in redis_om?
I want query condition of length of skills list Can not find out anything in document and I tried many ways. Pls help!