当前位置:网站首页>Value/string in redis
Value/string in redis
2022-07-01 11:22:00 【Daily enlightenment】
String
help set
nx yes key Value does not appear , Before setting ( For distributed locks )
xx yes key There must have been , Before setting , Equivalent to updating
mset You can set multiple key
mset k1 a k2 b
mget k1 k2
APPEND Can increase value Value
APPEND k1 "word"
get k1
GETRANGE Where to go and where to end , And display
GETRANGE k1 2 3
GETRANGE k1 2 -1 from 2 To the last
GETRANGE k1 2 -2 from 2 To the next to last
SETRANGE Where to cover
SETRANGE k1 6 666 From 6 Cover... On positions 666
STRLEN Display length
STRLEN k1 Show k1 length
The number
type k1 see k1 The type of
OBJECT encoding k1
key There is type, describe value Properties of
key There is encoding, see value code
INCR k1 k1 Add one
INCRBY k1 value k1 Add value
DECR k1 k1 Minus one
DECR k1 value k1 reduce value
INCRBYFLOAT k1 0.5 k1 Add 0.5
Binary security
Character stream
Byte stream
redis When a process interacts with the outside world , Get the byte stream
redis-cli --raw
raw: If not raw,redis Only recognize ascii, exceed ascii, It will be displayed in hexadecimal , add raw, It will trigger the format of the code set
GETSET: Take out the old value , Insert new values
GETSET k1 666 return k1 The value of the original
get k1 Returns the new value
MSETNX: Only k It can only be set when it does not exist , You can set multiple key value
Principle operation : One addition failed , The rest failed
bitmap Bitmap
setbit key offset value: hold key Corresponding value, The number on the bit number becomes value
offset It's an array of bits, not bytes , Is the binary offset (1 Bytes are 8 Binary bits )
0 1 2 3 4 5 6 7 8 9 10 11 12
0-7 Represents the first byte 8-16 Represents the second byte
bitpos key bit [start] [end]: Within the specified byte index range (start end), stay key Corresponding value in , The first occurrence on the binary bit bit The location of
bitcount key [satrt end]: Within the specified byte index range (start end), stay key Corresponding value in , Statistics 1 Several times
BIIOP operation destkey key [key...]:operation(and or xor not) The result returned key key1 And key2 do operation operation
边栏推荐
- 为什么一定要从DevOps走向BizDevOps?
- 【AI资讯月刊】350+资源大盘点!6月不容错过的资料和动态,都都都在这里啦!<附下载>
- 名创拟7月13日上市:最高发行价22.1港元 单季净利下降19%
- Kafuka learning path (I) Kafuka installation and simple use
- The developer said, "this doesn't need to be tested, just return to the normal process". What about the testers?
- redis中value/set
- ES6 promise Usage Summary
- 田溯宁投的天润云上市:市值22亿港元 年利润下降75%
- tmux使用
- Shangtang entered the lifting period: the core management voluntarily banned and strengthened the company's long-term value confidence
猜你喜欢

达梦数据冲刺科创板:拟募资24亿 冯裕才曾为华科教授

2022/6/29学习总结

索引失效的几种情况

Harbor webhook从原理到构建

Applymiddleware principle

China's cellular Internet of things users have reached 1.59 billion, and are expected to surpass mobile phone users within this year

CAD如何設置標注小數比特

Unittest框架中跳过要执行的测试用例

Technology sharing | introduction to linkis parameters

为什么一定要从DevOps走向BizDevOps?
随机推荐
redis中value/String
Huawei Equipment configure les services de base du réseau WLAN à grande échelle
Get key code
Vscode shortcut key (the most complete) [easy to understand]
Mingchuang plans to be listed on July 13: the highest issue price is HK $22.1, and the net profit in a single quarter decreases by 19%
Nordic nrf52832 flash download M4 error
TEMPEST HDMI泄漏接收 3
IPlImage的width和widthStep
华泰证券网上开户安全吗?
In June 2022, it was the first programming language?!
索引失效的几种情况
8款最佳实践,保护你的 IaC 安全!
redis中value/set
MySQL IN 和 NOT IN () 空列表报错
Exposure:A White-Box Photo Post-Processing Framework阅读札记
树莓派4B安装tensorflow2.0[通俗易懂]
How to set decimal places in CAD
Packet mode and three streaming modes in SDP protocol
Compile and debug net6 source code
Paxos 入门