Learn R Programming

rredis (version 1.7.0)

redisRename: Rename a key.

Description

Atomically rename a key.

Usage

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.

Value

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

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.

References

http://redis.io

See Also

redisKeys

Examples

Run this code
## Not run: 
# redisConnect()
# redisSet('x',5)
# redisRename('x','y')
# ## End(Not run)

Run the code above in your browser using DataLab