redisRename: Rename a key.

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

View source: R/allValCMD.R

Description

Atomically rename a key.

Usage

1
redisRename(old, new, NX = FALSE)

Arguments

old

Original key name.

new

New key name.

NX

Set NX = TRUE to prevent overwriting a key that already exists.

Details

If the source and destination name are the same an error is returned. If newkey already exists it is overwritten unless NX = TRUE, in which case the operation fails.

Value

Returns the Redis status "OK" unless NX = TRUE. When NX = TRUE, returns 1 if successful, 0 otherwise.

Author(s)

B. W. Lewis

References

http://redis.io

See Also

redisKeys

Examples

1
2
3
4
5
6
## Not run: 
redisConnect()
redisSet('x',5)
redisRename('x','y')

## End(Not run)

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