Redis-字符串string操作命令
Redis-字符串string操作命令
Redis中字符串类型常用命令:
SET key value
设置指定key的值GET key
获取指定key的值SETEX key seconds value
设置指定key的值,并将key的过期时间设为seconds秒 (应用场景:验证码)SETNX key value
只有在key不存在时设置key的值 (应用场景:分布式锁)
更多命令查看redis中文网。
Redis中字符串类型常用命令:
SET key value
设置指定key的值GET key
获取指定key的值SETEX key seconds value
设置指定key的值,并将key的过期时间设为seconds秒 (应用场景:验证码)SETNX key value
只有在key不存在时设置key的值 (应用场景:分布式锁)更多命令查看redis中文网。