Upstash Documentation home page
Search...
⌘K
Ask AI
Discord
Blog
X
Console
Console
Search...
Navigation
SETBIT
General
Redis
Kafka
Vector
QStash
SDKs
Developer API
Introduction
Get Started
Concepts
Serverless
Scale to Zero
Global Replication
Access Anywhere
Help
Account & Teams
Support & Contact Us
Professional Support
SLA
Uptime Monitor
Legal
Compliance
Integration with Third Parties & Partnerships
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.