Method: Redis::Commands::Keys#migrate
- Defined in:
- lib/redis/commands/keys.rb
#migrate(key, options) ⇒ String
Transfer a key from the connected instance to another instance.
234 235 236 237 238 239 240 241 242 243 244 245 246 |
# File 'lib/redis/commands/keys.rb', line 234 def migrate(key, ) args = [:migrate] args << ([:host] || raise(':host not specified')) args << ([:port] || raise(':port not specified')) args << (key.is_a?(String) ? key : '') args << ([:db] || @client.db).to_i args << ([:timeout] || @client.timeout).to_i args << 'COPY' if [:copy] args << 'REPLACE' if [:replace] args += ['KEYS', *key] if key.is_a?(Array) send_command(args) end |