BITFIELD_RO

Syntax
BITFIELD_RO key [GET encoding offset [GET encoding offset ...]]
Available since:
6.0.0
Time complexity:
O(1) for each subcommand specified
ACL categories:
@read, @bitmap, @fast,

BITFIELD 命令的只读变体。 它类似于原始的 BITFIELD,但只接受 GET 子命令,并且可以安全地用于只读副本。

由于原始的BITFIELD具有SETINCRBY选项,它在Redis命令表中被技术性地标记为写入命令。 因此,即使连接处于只读模式(参见Redis集群的READONLY命令),Redis集群中的只读副本也会将其重定向到主实例。

自 Redis 6.2 起,引入了 BITFIELD_RO 变体,以便在只读副本中允许 BITFIELD 行为,而不会破坏命令标志的兼容性。

查看原始 BITFIELD 了解更多详情。

示例

BITFIELD_RO hello GET i8 16

RESP2/RESP3 回复

Array reply: each entry being the corresponding result of the sub-command given at the same position.
RATE THIS PAGE
Back to top ↑