MOVE

Apply for Redis Developer Course Redis Regular Inspection / Technical Support Redis Enterprise Server

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.
Related commands MIGRATE, SELECT, EXISTS
Clients for Java Jedis, Lettuce, Redisson
Clients for C Hiredis

<< COPY MOVE DUMP >>

Email 답글이 올라오면 이메일로 알려드리겠습니다.