Learn R Programming

rredis (version 1.7.0)

redisMove: Move the specified key/value pair to another database.

Description

Move the specified key/value pair in the currently selected database to another database.

Usage

redisMove(key, dbindex)

Arguments

key
The key to move.
dbindex
The destination database index number.

Value

Returns TRUE if the key/value pair was moved, or FALSE otherwise.

Details

This command returns TRUE only if the key was successfully moved, and FALSE if the target key was already there or if the source key was not found at all. It is possible to use redisMove as a locking primitive.

References

http://redis.io/commands

See Also

redisSelect

Examples

Run this code
## Not run: 
# redisConnect()
# redisSelect(1)
# redisSet('x',5)
# redisMove('x',2)
# redisSelect(2)
# redisGet('x')
# ## End(Not run)

Run the code above in your browser using DataLab