Redis Getbit 命令

更新时间: 2019-07-07 15:54

Redis Getbit 命令用于对 key 所储存的字符串值,获取指定偏移量上的位(bit)。

语法

redis 127.0.0.1:6379> GETBIT KEY_NAME OFFSET

返回值

字符串值指定偏移量上的位(bit)。

当偏移量 OFFSET 比字符串值的长度大,或者 key 不存在时,返回 0 。

实例

# 对不存在的 key 或者不存在的 offset 进行 GETBIT, 返回 0

redis> EXISTS bit
(integer) 0

redis> GETBIT bit 10086
(integer) 0


# 对已存在的 offset 进行 GETBIT

redis> SETBIT bit 10086 1
(integer) 0

redis> GETBIT bit 10086
(integer) 1

查看更多 Redis 字符串(String)命令

Computational Geometry

Computational Geometry

Mark de Berg、Otfried Cheong、Marc van Kreveld、Mark Overmars / Springer / 2008-4-16 / USD 49.95

This well-accepted introduction to computational geometry is a textbook for high-level undergraduate and low-level graduate courses. The focus is on algorithms and hence the book is well suited for st......一起来看看 《Computational Geometry》 这本书的介绍吧!

CSS 压缩/解压工具

CSS 压缩/解压工具

在线压缩/解压 CSS 代码

HTML 编码/解码

HTML 编码/解码

HTML 编码/解码

XML 在线格式化

XML 在线格式化

在线 XML 格式化压缩工具