MOVE
Syntax
MOVE key db
- Available since:
- Redis Open Source 1.0.0
- Time complexity:
- O(1)
- ACL categories:
-
@keyspace,@write,@fast, - Compatibility:
- Redis Enterprise and Redis Cloud compatibility
Move key from the currently selected database (see SELECT) to the specified
destination database.
When key already exists in the destination database, or it does not exist in
the source database, it does nothing.
It is possible to use MOVE as a locking primitive because of this.
Redis Enterprise and Redis Cloud compatibility
| Redis Enterprise |
Redis Cloud |
Notes |
|---|---|---|
| ❌ Standard |
❌ Standard |
Redis Enterprise does not support shared databases due to potential negative performance impacts and blocks any related commands. |
Return information
One of the following:
- Integer reply:
1if key was moved. - Integer reply:
0if key wasn't moved.