redisEval: Evaluate a Lua script in the Redis server.

Description Usage Arguments Value Author(s) References Examples

View source: R/scriptCMD.R

Description

Evaluate a Lua script in the Redis server.

Usage

1
redisEval(script, keys = vector("list",0), SHA = FALSE, ...)

Arguments

script

A Redis server-side Lua script (character).

keys

An optional list of script key arguments.

SHA

If TRUE, the script is a SHA1-encoded string, otherwise plan text.

...

Optional list of script arguments.

Value

"OK" is returned on success. Errors are displayed if the script fails.

Author(s)

B. W. Lewis

References

http://redis.io/commands

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
redisConnect()
redisEval("return redis.call('set','foo','bar')")

# Supply a key argument to the script
redisEval("return redis.call('set',KEYS[1],'bar')", "foo")

# Supply a key and other arguments to the script
redisEval("return redis.call('set',KEYS[1],ARGV[1])", "foo", pi)

## End(Not run)

rredis documentation built on May 2, 2019, 2:02 p.m.