TS.QUERYINDEX l=v | l!=v | l= | l!= | l=(v1,v2,...) | l!=(v1,v2,...) [ l=v | l!=v | l= | l!= | l=(v1,v2,...) | l!=(v1,v2,...) ...]
Available in: Redis Stack
Time complexity: O(n) where n is the number of time-series that match the filters
TS.QUERYINDEX
Get all time series keys matching a filter list.
TS.QUERYINDEX filter...
filter...
This is the list of possible filters:
- label
=
value - label equals value - label
!=
value - label doesn't equal value - label
=
- key does not have the label label - label
!=
- key has label label - label
=(
value1,
value2,
...)
- key with label label that equals one of the values in the list - lable
!=(
value1,
value2,
...)
- key with label label that doesn't equal any of the values in the list
Note: Whenever filters need to be provided, a minimum of one label
=
value filter must be applied.- label
Note: QUERYINDEX command can't be part of transaction when running on Redis cluster.
Query index example
127.0.0.1:6379> TS.QUERYINDEX sensor_id=2
1) "temperature:2:32"
2) "temperature:2:33"