Redis Setnx 命令

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

Redis Setnx(SET if Not eXists) 命令在指定的 key 不存在时,为 key 设置指定的值。

语法

redis 127.0.0.1:6379> SETNX KEY_NAME VALUE

返回值

设置成功,返回 1 。 设置失败,返回 0 。

实例

127.0.0.1:6379> set domain www.codercto.com
OK
127.0.0.1:6379> setnx domain www.codercto.com.1
0
127.0.0.1:6379> setnx domain1 www.codercto.com
1

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

具体数学(英文版第2版)

具体数学(英文版第2版)

[美] Ronald L. Graham、Donald E. Knuth、Oren Patashnik / 机械工业出版社 / 2002-8 / 49.00元

This book introduces the mathematics that supports advanced computer Programming and the analysis of algorithms. The primary aim of its well-known authors is to provide a solid and relevant base of ma......一起来看看 《具体数学(英文版第2版)》 这本书的介绍吧!

CSS 压缩/解压工具

CSS 压缩/解压工具

在线压缩/解压 CSS 代码

JSON 在线解析

JSON 在线解析

在线 JSON 格式化工具

随机密码生成器

随机密码生成器

多种字符组合密码