Skip to content

Commit 1c326da

Browse files
authored
DEV: fix bug on BITPOS command page (#995)
1 parent 747e4e1 commit 1c326da

File tree

1 file changed

+22
-13
lines changed

1 file changed

+22
-13
lines changed

content/commands/bitpos/index.md

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff 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+
```

0 commit comments

Comments
 (0)