LUA script

6 views
Skip to first unread message

Van Zyl Kruger

unread,
Apr 12, 2020, 2:54:15 AM4/12/20
to RedisTimeSeries Discussion Forum
Hi,

How would I add data to a timeseries ket using LUA scripting?

Kind Regards,
Van Zyl

Itamar Haber

unread,
Apr 12, 2020, 8:53:05 AM4/12/20
to RedisTimeSeries Discussion Forum
Hello Van Zyl,

If I understand your question correctly adding data to a RedisTimeSeries key from a Lua script is as simple as:

redis> EVAL "return redis.call('TS.ADD', KEYS[1], ARGV[1], ARGV[2])" 1 mykey 12345678 42

where 'mykey' is the key's name, 12345678 is the timestamp and 42 is the value.


Cheers,
Itamar
Reply all
Reply to author
Forward
0 new messages