Redis in Action
2024-09-03 05:40:35
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 发布文章使用:只允许注册用户才可以访问!
最新文章
- svm训练显示信息说明
- Scalaz(31)- Free :自由数据结构-算式和算法的关注分离
- C/C++多种方法获取文件大小(转)
- Amazon S3云存储服务器的功能及编程接口
- 横竖屏切换时候Activity的生命周期的总结
- RabbitMQ术语
- 如何在linux系统下面编译C++(写给小白)(-1)
- 本地调试 Chrome支持Ajax跨域
- DataSetToList 和 DataTableTolist 转换
- number问题
- bat修改密码
- Django App(一) StartApp
- Redis进阶实践之六Redis Desktop Manager连接Windows和Linux系统上的Redis服务
- TypeScript入门知识一(字符串特性)
- C 存储类
- php 服务端允许跨域访问
- margin:0 auto是什么意思
- intellij IDEA导入java源码
- 关于C/s结构 本地目录的思考
- 奔跑吧Linux