TSREM
AttentionThis page documents an earlier version. Go to the latest (v2.1)version.
Synopsis
TSREM key timestamp [timestamp …]This command removes one or more specified timestamps from the time series that is associated with the given key.
- If the
keyexists, but is not of time series type, an error is raised. - If the given
timestampis not a valid signed 64 bit integer, an error is raised. - If the provided timestamps don’t exist, TSREM still returns “OK”. As a result, TSREM justensures the provided timestamps no longer exist, but doesn’t provide any information about whetherthey existed before the command was run.
Return Value
Returns the appropriate status string.
Examples
The timestamp can be arbitrary integers used just for sorting values in a certain order.
1. TSADD ts_key 1 one 2 two 3 three 4 four 5 five 6 six
1. "OK"
1. TSGET ts_key 2
1. "two"
1. TSGET ts_key 3
1. "three"
1. TSRANGEBYTIME ts_key 1 4
1. 1) "1"
2. 2) "one"
3. 3) "2"
4. 4) "two"
5. 5) "3"
6. 6) "three"
7. 7) "4"
8. 8) "four"
1. TSREM ts_key 2 3
1. "OK"
1. TSRANGEBYTIME ts_key 1 4
1. 1) "1"
2. 2) "one"
3. 3) "4"
4. 4) "four"
1. TSGET ts_key 2
1. (nil)
1. TSGET ts_key 3
1. (nil)
