move
MOVE
Move data to another DB
Usage is move key db [type].
Redis has 16 DBs by default, numbered 0 through 15.
Moves the key and data to the specified db.
If the key already exists in the target db, it is not moved.
📍 type is one of string/list/set/zset/hash/stream.
type was added from ent811. Please use it.
Example
| Command> | set key value |
| Result> | OK |
| Command> | move key 1 string Move to db 1 |
| Result> | 1 |
| Command> | exists key string |
| Result> | 0 |
| Command> | select 1 Work in db 1 |
| Result> | OK |
| Command> | get key |
| Result> | value |
View animation
Syntax
MOVE key db [type]
- Available since version 1.0.0.
- Time complexity is O(1).
- ent811 type added.