move

PHP Redis

move

Description

Moves a key to a different database.

移动一个KEY-VALUE到另一个DB

Parameters

Key: key, the key to move.

key:要移动的key

INTEGER: dbindex, the database number to move the key to.

整数值:要移动到的数据库ID

Return value

BOOLTRUE in case of success, FALSE in case of failure.

Example
$redis->select(0);  // switch to DB 0
$redis->set('x', '42'); // write 42 to x
$redis->move('x', 1);   // move to DB 1
$redis->select(1);  // switch to DB 1
$redis->get('x');   // will return 42