BITCONVERT
BITCONVERT key
- Available since:
- Redis Open Source 8.12.0
- Time complexity:
- O(N) where N is the length of the string value.
- ACL categories:
-
@write,@bitmap,@slow, - Compatibility:
- Redis Software and Redis Cloud compatibility
BITCONVERT is an internal command that preserves string-to-native bitmap
conversions during replication and append-only file (AOF) replay. Applications
cannot call it directly.
Required arguments
key
The key to convert to a native bitmap.
Details
Redis uses this command to replay a representation change independently of the
receiving node's bitmap-default-roaring setting. Ordinary clients receive an
unknown-command error and do not see it in COMMAND INFO or COMMAND DOCS.
Converting a string preserves its bits, logical byte length, and expiration.
A missing key becomes an empty native bitmap. An existing native bitmap is
unchanged. Other value types return WRONGTYPE; strings beyond the supported
native bitmap length return an error.
Redis Software and Redis Cloud compatibility
| Redis Software |
Redis Cloud |
Notes |
|---|---|---|
| ❌ Standard |
❌ Standard |
Return information
Simple string reply:
OK.