当前位置:网站首页>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
边栏推荐
- Exploration and practice of inress in kubernetes
- 力扣(LeetCode)181. 超过经理收入的员工(2022.06.29)
- The idea runs with an error command line is too long Shorten command line for...
- 英特尔实验室公布集成光子学研究新进展
- CVPR 2022 | 基于密度与深度分解的自增强非成对图像去雾
- 技术分享 | Linkis参数介绍
- CANN算子:利用迭代器高效实现Tensor数据切割分块处理
- China's cellular Internet of things users have reached 1.59 billion, and are expected to surpass mobile phone users within this year
- [AI information monthly] 350 + resources! All the information and trends that can't be missed in June are here! < Download attached >
- Kafuka learning path (I) Kafuka installation and simple use
猜你喜欢

CVPR 2022 | 基于密度与深度分解的自增强非成对图像去雾

Introduction to unittest framework and the first demo

索引失效的几种情况

redis配置环境变量

"Target detection" + "visual understanding" to realize the understanding and translation of the input image (with source code)

CVPR 2022 | self enhanced unpaired image defogging based on density and depth decomposition

华为设备配置大型网络WLAN基本业务

京东与腾讯续签合作:向腾讯发行A类股 价值最高达2.2亿美元

2022年6月编程语言排行,第一名居然是它?!

Harbor webhook从原理到构建
随机推荐
CVPR 2022 | 基于密度与深度分解的自增强非成对图像去雾
Compile and debug net6 source code
[Maui] add click events for label, image and other controls
How to realize the four isolation levels of MySQL (brief)
Kafuka learning path (I) Kafuka installation and simple use
优雅地翻转数组
Can I open an account today and buy stocks today? Is it safe to open an account online?
2022/6/29学习总结
IPlImage的width和widthStep
提问:测试工程师应该具备哪些职业素养?
Comment Cao définit la décimale de dimension
Wechat applet development - user authorization to log in to "suggestions collection"
田溯宁投的天润云上市:市值22亿港元 年利润下降75%
redis配置环境变量
2022/6/30学习总结
获取键代码
Share the method of how to preview PSD format and PSD file thumbnail plug-in [easy to understand]
Openinstall: wechat applet jump to H5 configuration service domain name tutorial
Tempest HDMI leak receive 3
银行卡借给别人是否构成犯罪