Upstash Documentation home page
Search...
⌘K
Ask AI
Discord
Blog
Twitter
Console
Console
Search...
Navigation
SETBIT
Overview
Redis
Vector
QStash
Workflow
Search
Developer API
Overall
Quickstarts
Features
SDKs
How To
Integrations
Tutorials
Troubleshooting
Help
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.