diff options
author | michael-grunder <michael.grunder@gmail.com> | 2017-04-23 23:22:16 +0300 |
---|---|---|
committer | michael-grunder <michael.grunder@gmail.com> | 2017-04-23 23:22:16 +0300 |
commit | 9ec9aedea803ebc7b55fca026f3be69471d0e964 (patch) | |
tree | 6f6c73115a1b77680ef900877a71802a31f8d022 /README.markdown | |
parent | 30462b86f68130bfb239de8c21d93ab8e9b95f03 (diff) |
Update documentation of MIGRATE method
Diffstat (limited to 'README.markdown')
-rw-r--r-- | README.markdown | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/README.markdown b/README.markdown index decac681..70caab0f 100644 --- a/README.markdown +++ b/README.markdown @@ -1344,19 +1344,26 @@ $redis->restore('bar', 0, $val); // The key 'bar', will now be equal to the key ### migrate ----- _**Description**_: Migrates a key to a different Redis instance. + +**Note:**: Redis introduced migrating multiple keys in 3.0.6, so you must have at least +that version in order to call `migrate` with an array of keys. + ##### *Parameters* -*host* string. The destination host -*port* integer. The TCP port to connect to. -*key* string. The key to migrate. -*destination-db* integer. The target DB. -*timeout* integer. The maximum amount of time given to this transfer. -*copy* boolean, optional. Should we send the COPY flag to redis -*replace* boolean, optional. Should we send the REPLACE flag to redis +*host* string. The destination host +*port* integer. The TCP port to connect to. +*key(s)* string or array. +*destination-db* integer. The target DB. +*timeout* integer. The maximum amount of time given to this transfer. +*copy* boolean, optional. Should we send the COPY flag to redis. +*replace* boolean, optional. Should we send the REPLACE flag to redis ##### *Examples* ~~~ $redis->migrate('backup', 6379, 'foo', 0, 3600); $redis->migrate('backup', 6379, 'foo', 0, 3600, true, true); /* copy and replace */ $redis->migrate('backup', 6379, 'foo', 0, 3600, false, true); /* just REPLACE flag */ + +/* Migrate multiple keys (requires Redis >= 3.0.6) +$redis->migrate('backup', 6379, ['key1', 'key2', 'key3'], 0, 3600); ~~~ |