BITFIELD_RO(3valkey)
π BITFIELD_RO (3valkey) π
okay bestie, welcome to the Valkey Command Manual page for bitfield_ro β she's cute, she's read-only, she's giving β¨*immaculate vibes*β¨
πΈ NAME πΈ
bitfield_ro β performs arbitrary read-only bitfield integer operations on strings. no writes, no drama, just reading π
π SYNOPSIS π
BITFIELD_RO key [GET encoding offset [GET encoding offset ...]]
π¦ DESCRIPTION π¦
so this is the read-only variant of the valkey-bitfield(7) BITFIELD command. like, it's basically the same girl as the original BITFIELD, except she only accepts the GET subcommand, and she can be used safely on read-only replicas. no cap π«Ά
here's the tea though: because the original BITFIELD has SET and INCRBY options, it's technically flagged as a writing command in the Valkey command table. which means read-only replicas in a Valkey Cluster will redirect it to the master instance even if the connection is in read-only mode (that's the valkey-readonly(7) READONLY command of Valkey Cluster, iykyk). so rude of it honestly π
see original BITFIELD for more details π
example moment, because we love a demo:
BITFIELD_RO hello GET i8 16
β REPLY β
valkey-protocol(7) Array reply: each entry being the corresponding result of the sub-command given at the same position. one subcommand in, one result out, perfectly matched, as she should π
β¨
π COMPLEXITY π
O(1) for each subcommand specified. constant time per subcommand, we love an efficient queen π
π ACL CATEGORIES π
@bitmap @fast @read
π HISTORY π
- Available since: 6.0.0
π§ SEE ALSO π§
bitcount(3valkey), bitfield(3valkey), bitop(3valkey), bitpos(3valkey), getbit(3valkey), setbit(3valkey)
and that's the whole page bestie!! version 9.0.0, dated 2025-10-21 β go forth and read your bitfields, you absolute icon πππ¦βπ
π¦ where this page comes from
- fedora 44: valkey-doc 9.0.3-2.fc44 Β· CC-BY-SA-4.0
- fedora 44: valkey-doc 9.0.6-1.fc44 Β· CC-BY-SA-4.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms