File tree Expand file tree Collapse file tree 1 file changed +22
-13
lines changed Expand file tree Collapse file tree 1 file changed +22
-13
lines changed Original file line number Diff line number Diff line change @@ -104,16 +104,25 @@ Non-existent keys are treated as empty strings.
104104
105105## Examples
106106
107- {{% redis-cli %}}
108- SET mykey "\xff\xf0\x00"
109- BITPOS mykey 0
110- SET mykey "\x00\xff\xf0"
111- BITPOS mykey 1 0
112- BITPOS mykey 1 2
113- BITPOS mykey 1 2 -1 BYTE
114- BITPOS mykey 1 7 15 BIT
115- set mykey "\x00\x00\x00"
116- BITPOS mykey 1
117- BITPOS mykey 1 7 -3 BIT
118- {{% /redis-cli %}}
119-
107+ ``` redis
108+ redis> SET mykey "\xff\xf0\x00"
109+ OK
110+ redis> BITPOS mykey 0
111+ (integer) 12
112+ redis> SET mykey "\x00\xff\xf0"
113+ OK
114+ redis> BITPOS mykey 1 0
115+ (integer) 8
116+ redis> BITPOS mykey 1 2
117+ (integer) 16
118+ redis> BITPOS mykey 1 2 -1 BYTE
119+ (integer) 16
120+ redis> BITPOS mykey 1 7 15 BIT
121+ (integer) 8
122+ redis> set mykey "\x00\x00\x00"
123+ OK
124+ redis> BITPOS mykey 1
125+ (integer) -1
126+ redis> BITPOS mykey 1 7 -3 BIT
127+ (integer) -1
128+ ```
You can’t perform that action at this time.
0 commit comments