TSCARD

Synopsis

TSCARD keyThis command returns the number of entires in the given time series.

  • If the given key is associated with non-timeseries data, an error is raised.
  • If the given key is not associated with any data, 0 is returned.

Return value

Returns the number of entries in the given time series.

Examples

  1. $ TSADD ts_key 10 v1 20 v2 30 v3 40 v4 50 v5
  1. "OK"
  1. $ TSCARD ts_key
  1. (integer) 5
  1. $ TSADD ts_key1 10 v1 20 v2 30 v3
  1. "OK"
  1. $ TSCARD ts_key1
  1. (integer) 3

Non-existent key returns 0.

  1. $ TSCARD ts_key2
  1. (integer) 0

See also

tsadd, tsget, tsrem,tsrangebytime, tsrevrangebytime,tslastn