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

BOOL: TRUE in case of success, FALSE in case of failure.

整数BOOL:返回true为成功,返回false为失败。


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