当前位置:网站首页>12_ Redis_ Bitmap_ command
12_ Redis_ Bitmap_ command
2022-07-02 15:20:00 【Listen to the rain】
Bitmap
Bit storage
Statistics user information , active , Inactive ! Sign in 、 Not logged in ! Clock in ,365 Clock in ! Two states of , You can use Bitmap !
Bitmap Bitmap , data structure ! It's all operating bits to record , Only 0 and 1 Two states !
Use bitmap To record clocks from Monday to Sunday !
Monday ∶1 Tuesday ∶0 Wednesday :0 Thursday :1 Friday :0 Saturday :1 Sunday :0
127.0.0.1:6379> setbit sign 0 1 // Set the daily clock in situation
(integer) 0
127.0.0.1:6379> setbit sign 1 0
(integer) 0
127.0.0.1:6379> setbit sign 2 0
(integer) 0
127.0.0.1:6379> setbit sign 3 1
(integer) 0
127.0.0.1:6379> setbit sign 4 0
(integer) 0
127.0.0.1:6379> setbit sign 5 1
(integer) 0
127.0.0.1:6379> setbit sign 6 0
(integer) 0
127.0.0.1:6379> getbit sign 3 // Check whether you punch in on Thursday !
(integer) 1
127.0.0.1:6379> getbit sign 6
(integer) 0
127.0.0.1:6379> bitcount sign // Count the days of clocking in a week !
(integer) 3
边栏推荐
猜你喜欢
随机推荐
12_Redis_Bitmap_命令
Topology architecture of the minimum deployment of tidb cluster
03_線性錶_鏈錶
How to test tidb with sysbench
工程师评测 | RK3568开发板上手测试
vChain: Enabling Verifiable Boolean Range Queries over Blockchain Databases(sigmod‘2019)
04_ 栈
数据分析常见的英文缩写(一)
Internet Explorer officially retired
php获取数组中键值最大数组项的索引值的方法
TiDB混合部署拓扑
Tidb hybrid deployment topology
10_Redis_geospatial_命令
Set set you don't know
Btrace- (bytecode) dynamic tracking tool
The past and present lives of visual page building tools
蜻蜓低代码安全工具平台开发之路
基于RZ/G2L | OK-G2LD-C开发板存储读写速度与网络实测
Tidb environment and system configuration check
[noi Simulation Competition] scraping (dynamic planning)




![[C language] explain the initial and advanced levels of the pointer and points for attention (1)](/img/61/1619bd2e959bae1b769963f66bab4e.png)




