Redis in Action
Redis in Action
Redis
REmote DIctionary Server(Redis)
Redis 是一种开放源代码(BSD许可)的内存中数据结构存储,用作数据库,缓存和消息代理。
它支持数据结构,例如字符串,哈希,列表,集合,带范围查询的排序集,位图,超级日志,带有半径查询和流的地理空间索引。
# redis-server version
$ redis-server -v
$ redis-server --version
# Redis server v=6.0.6 sha=00000000:0 malloc=libc bits=64 build=5b8f79637e2b0790
# redis-client version
$ redis-cli -v
$ redis-cli --version
# redis-cli 6.0.6
# If you want to know the version of the server, from the client
> INFO
https://stackoverflow.com/questions/22153504/how-to-find-out-redis-version
https://stackoverflow.com/questions/21555942/how-to-check-redis-instance-version
REPL
$ HELP
# Please type HELP for one of these commands: DECR, DECRBY, DEL, EXISTS, EXPIRE, GET, GETSET, HDEL, HEXISTS, HGET, HGETALL, HINCRBY, HKEYS, HLEN, HMGET, HMSET, HSET, HVALS, INCR, INCRBY, KEYS, LINDEX, LLEN, LPOP, LPUSH, LRANGE, LREM, LSET, LTRIM, MGET, MSET, MSETNX, MULTI, PEXPIRE, RENAME, RENAMENX, RPOP, RPOPLPUSH, RPUSH, SADD, SCARD, SDIFF, SDIFFSTORE, SET, SETEX, SETNX, SINTER, SINTERSTORE, SISMEMBER, SMEMBERS, SMOVE, SORT, SPOP, SRANDMEMBER, SREM, SUNION, SUNIONSTORE, TTL, TYPE, ZADD, ZCARD, ZCOUNT, ZINCRBY, ZRANGE, ZRANGEBYSCORE, ZRANK, ZREM, ZREMRANGEBYSCORE, ZREVRANGE, ZSCORE
$ help SET
# OR
$ help set
"""
SET key value
TIME COMPLEXITY: O(1)
DESCRIPTION: Set key to hold the string value. If key already holds a value, it is overwritten, regardless of its type. Any previous time to live associated with the key is discarded on successful SET operation.
Options
EX seconds -- Set the specified expire time, in seconds.
PX milliseconds -- Set the specified expire time, in milliseconds.
NX -- Only set the key if it does not already exist.
XX -- Only set the key if it already exist.
RETURN VALUE: Status code reply: OK if SET was executed correctly. Null multi-bulk reply: a Null Bulk Reply is returned if the SET operation was not performed because the user specified the NX or XX option but the condition was not met.
"""
# use the command SET to store the value "fido" at key "server:name":
SET server:name "fido"
# OK
# use the command GET to read the value stored at key server:name
GET server:name
# "fido"
# test if a give key exists(1) or not(0)
EXISTS server:name
# (integer) 1
EXISTS server:blabla
# (integer) 0
docs
https://redis.io/documentation
数据结构
String: 字符串
Hash: 散列
List: 列表
Set: 集合
Sorted Set: 有序集合
bitmaps
hyperloglogs
geospatial indexes
Ctrl + ⬇
切换 vscode workspace
refs
http://download.redis.io/releases/redis-6.0.6.tar.gz
©xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/13530420.html
未经授权禁止转载,违者必究!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· .NET10 - 预览版1新功能体验(一)
2019-08-19 如何正确的阅读 js 源码
2017-08-19 shit api & shit antd
2016-08-19 CSS3 : text-?