Redis Append 命令

更新时间: 2019-07-07 15:54

Redis Append 命令用于为指定的 key 追加值。

如果 key 已经存在并且是一个字符串, APPEND 命令将 value 追加到 key 原来的值的末尾。

如果 key 不存在, APPEND 就简单地将给定 key 设为 value ,就像执行 SET key value 一样。

语法

redis 127.0.0.1:6379> APPEND KEY_NAME NEW_VALUE

返回值

追加指定值之后, key 中字符串的长度。

实例

实例1:key 存在

127.0.0.1:6379> set domain codercto.com
OK
127.0.0.1:6379> append domain new
15
127.0.0.1:6379> get domain
codercto.comnew

实例2:key 不存在

127.0.0.1:6379> del domain
0
127.0.0.1:6379> append domain codercto
8
127.0.0.1:6379> get domain
codercto

查看更多 Redis 字符串(String)命令

Blockchain Basics

Blockchain Basics

Daniel Drescher / Apress / 2017-3-16 / USD 20.99

In 25 concise steps, you will learn the basics of blockchain technology. No mathematical formulas, program code, or computer science jargon are used. No previous knowledge in computer science, mathema......一起来看看 《Blockchain Basics》 这本书的介绍吧!

图片转BASE64编码

图片转BASE64编码

在线图片转Base64编码工具

Base64 编码/解码

Base64 编码/解码

Base64 编码/解码

Markdown 在线编辑器

Markdown 在线编辑器

Markdown 在线编辑器