Skip to content
masterclass Buddy

Redis · Command

SETBIT

SETBIT sets or clears one bit in a Redis String. It creates the key when missing and returns the bit's previous value.

Last updated

Since
2.2.0

Syntax

SETBIT key offset value

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • BITCOUNT
  • BITFIELD
  • BITFIELD_RO
  • BITOP
  • BITPOS
  • GETBIT
  • GET
  • SET

Source: SETBIT | Docs. Checked 2026-11-03.