admin管理员组文章数量:1516870
redis setnx java setIfAbsent的使用
redis setnx java setIfAbsent的使用 如果为空就set值,并返回1 如果存在(不为空)不进行操作,并返回0
test:0>set mykey "hello" OK test:0>get mykey hello test:0>set mykey "world" OK test:0>get mykey world test:0>setnx mykey2 "hello" 1 test:0>get mykey2 hello test:0>setnx mykey2 "world" 0 test:0>get mykey2 hello test:0>del mykey 1 test:0>get mykey NULL test:0>del mykey2 1 test:0>get mykey2 NULL
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。 原始发表:2022-08-12,如有侵权请联系 cloudcommunity@tencent 删除nullredissetjava本文标签: redis setnx java setIfAbsent的使用
版权声明:本文标题:redis setnx java setIfAbsent的使用 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.betaflare.com/shuma/1754983884a3182081.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论