Lua, redis.call and set and hgetall in one command

467 views
Skip to first unread message

David Montgomery

unread,
Jun 4, 2012, 11:37:30 AM6/4/12
to redi...@googlegroups.com
Hi,

I am trying to get the basics of lua scripting.

I understand this example. eval "return redis.call('set',KEYS[1],'bar')" 1 foo

How would I also add in addition to the set command a hgetall foohash
as well? Is that possible?

I.e. doing a set and a hgetall in the same call.

Thanks

T B

unread,
Jun 4, 2012, 12:22:31 PM6/4/12
to redi...@googlegroups.com
if you don't care about the return value from the set operation:

eval "redis.call('set',KEYS[1],'bar') ; return(redis.call('HGETALL', KEYS[2]))" 2 foo bar




--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To post to this group, send email to redi...@googlegroups.com.
To unsubscribe from this group, send email to redis-db+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/redis-db?hl=en.


Huo Qikun

unread,
Jun 4, 2012, 6:42:34 PM6/4/12
to redi...@googlegroups.com
you can use pipeline

2012/6/5 T B <phreak...@gmail.com>
Reply all
Reply to author
Forward
0 new messages