New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a way to filter by multiple values of one field without "or" (IN query)? #605
Comments
LSHIFT(<<) is the IN operator and RSHIFT(>>) is the NOT IN operator. Above example taken from: https://github.com/redis-developer/redis-om-python-flask-skeleton-app/blob/main/app.py |
@wanderer056 Thank you for the response In your example skills is an array field (List[str]) By the way REDIS JSON supports MGET operator, but there's no mget method in JsonModel, just simple get... I used It instead of using multiple OR and FT SEARCH |
@DennyD17
Above is the example to find online friends of a player. It will look for the Player with p_id in friends_id list and status online. Note: p_id is string field. The field should be string as the LSHIFT(<<) operator generates tag query underneath. Tag is automatically generated by the redis-om if the data type is string. I don't think you can do this for a number field in Redis. |
Pretty sure this question has been answered so I'm going to close it. Feel free to reopen if needed. |
@wanderer056
@slorello89 |
Is there something like IN query for fetching multiple documents by multiple values of one field?
Similar to SQL
"SELECT * FROM foo WHERE bar in (1, 2, 3);"
The text was updated successfully, but these errors were encountered: