redisGetSet: Store a value in Redis, returning the previously defined...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/strValCMD.R

Description

Store a value identified by a character key name in the Redis database, returning the previously defined value or NULL if the key was not already associated with a value.

Usage

1
redisGetSet(key, value, ...)

Arguments

key

The (required) character identifier for the value to be stored.

value

The (required) object to associate with the key.

...

Optional additional arguments. Specify raw=TRUE to skip de-serialization of the data.

Details

The key must not contain spaces or newline characters (otherwise an error will be thrown).

The value object is copied to the Redis server. The value to be stored may can be any serializable R object up to the Redis maximum object size (excluding, for example, external pointer references). References to other R objects or environments inside the value are not guaranteed to be preserved.

In order to store strings that can easily be read by other clients, first convert the character object using the charToRaw function as shown in the examples.

Value

The previous value associated with key or NULL if no previous association exists.

Author(s)

B. W. Lewis

References

http://redis.io/commands

See Also

redisGet

Examples

1
2
3
4
5
## Not run: 
# Store an R object with the key 'x':
redisGetSet('x',runif(5))

## End(Not run)

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