Upstash Documentation home page
Search...
⌘K
Ask AI
Discord
Blog
X
Console
Console
Search...
Navigation
SETBIT
General
Redis
Kafka
Vector
QStash
SDKs
Developer API
Overall
Overview
SDKs
Typescript
Python
DevOps
Terraform
Pulumi
CLI
Example
Copy
Ask AI
original_bit
=
redis.setbit(key,
4
,
1
)
SETBIT
Set a single bit in a string.
Example
Copy
Ask AI
original_bit
=
redis.setbit(key,
4
,
1
)
Arguments
key
str
required
The key of the bitset
offset
int
required
Specify the offset at which to set the bit.
value
0 | 1
required
The bit to set
Response
The original bit value stored at offset.
Example
Copy
Ask AI
original_bit
=
redis.setbit(key,
4
,
1
)
Was this page helpful?
Yes
No
Suggest edits
Raise issue
Assistant
Responses are generated using AI and may contain mistakes.