Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9ec9aed

Browse files
Update documentation of MIGRATE method
1 parent 30462b8 commit 9ec9aed

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

README.markdown

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,19 +1344,26 @@ $redis->restore('bar', 0, $val); // The key 'bar', will now be equal to the key
13441344
### migrate
13451345
-----
13461346
_**Description**_: Migrates a key to a different Redis instance.
1347+
1348+
**Note:**: Redis introduced migrating multiple keys in 3.0.6, so you must have at least
1349+
that version in order to call `migrate` with an array of keys.
1350+
13471351
##### *Parameters*
1348-
*host* string. The destination host
1349-
*port* integer. The TCP port to connect to.
1350-
*key* string. The key to migrate.
1351-
*destination-db* integer. The target DB.
1352-
*timeout* integer. The maximum amount of time given to this transfer.
1353-
*copy* boolean, optional. Should we send the COPY flag to redis
1354-
*replace* boolean, optional. Should we send the REPLACE flag to redis
1352+
*host* string. The destination host
1353+
*port* integer. The TCP port to connect to.
1354+
*key(s)* string or array.
1355+
*destination-db* integer. The target DB.
1356+
*timeout* integer. The maximum amount of time given to this transfer.
1357+
*copy* boolean, optional. Should we send the COPY flag to redis.
1358+
*replace* boolean, optional. Should we send the REPLACE flag to redis
13551359
##### *Examples*
13561360
~~~
13571361
$redis->migrate('backup', 6379, 'foo', 0, 3600);
13581362
$redis->migrate('backup', 6379, 'foo', 0, 3600, true, true); /* copy and replace */
13591363
$redis->migrate('backup', 6379, 'foo', 0, 3600, false, true); /* just REPLACE flag */
1364+
1365+
/* Migrate multiple keys (requires Redis >= 3.0.6)
1366+
$redis->migrate('backup', 6379, ['key1', 'key2', 'key3'], 0, 3600);
13601367
~~~
13611368

13621369

0 commit comments

Comments
 (0)