- Redis Basics
- Redis - Home
- Redis - Overview
- Redis - Environment
- Redis - Configuration
- Redis - Data types
- Redis Commands
- Redis - Commands
- Redis - Keys
- Redis - Strings
- Redis - Hashes
- Redis - Lists
- Redis - Sets
- Redis - Sorted Sets
- Redis - HyperLogLog
- Redis - Publish Subscribe
- Redis - Transactions
- Redis - Scripting
- Redis - Connections
- Redis - Server
- Redis Advanced
- Redis - Backup
- Redis - Security
- Redis - Benchmarks
- Redis - Client Connection
- Redis - Pipelining
- Redis - Partitioning
- Redis - Java
- Redis - Php
- Redis Useful Resources
- Redis - Quick Guide
- Redis - Useful Resources
- Redis - Discussion
Redis - Keys Move Command
Redis MOVE command is used to move a key from the currently selected database to the specified destination database.
Return Value
Integer value 1 or 0
- 1, if the key is moved.
- 0, if the key is not moved.
Syntax
Following is the basic syntax of Redis MOVE command.
redis 127.0.0.1:6379> MOVE KEY_NAME DESTINATION_DATABASE
Example
First, create a key in Redis and set some value in it.
redis 127.0.0.1:6379> SET tutorial1 redis OK
In Redis, by default 0th database is selected, so now we are moving the generated key in the second database.
redis 127.0.0.1:6379> MOVE tutorial1 1 1) (integer) 1
redis_keys.htm
Advertisements