复制

Syntax
COPY source destination [DB destination-db] [REPLACE]
Available since:
6.2.0
Time complexity:
O(N) worst case for collections, where N is the number of nested items. O(1) for string values.
ACL categories:
@keyspace, @write, @slow,

此命令将存储在source键中的值复制到destination键。

默认情况下,destination 键是在连接使用的逻辑数据库中创建的。DB 选项允许为目的地键指定一个替代的逻辑数据库索引。

destination键已经存在时,命令返回零。REPLACE选项在将值复制到destination键之前会删除该键。

示例

SET dolly "sheep"
COPY dolly clone
GET clone

RESP2/RESP3 回复

以下之一:


RATE THIS PAGE
Back to top ↑