Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BITPOS Wrong examples results #20

Open
jrgcubano opened this issue Feb 24, 2023 · 1 comment
Open

BITPOS Wrong examples results #20

jrgcubano opened this issue Feb 24, 2023 · 1 comment

Comments

@jrgcubano
Copy link

jrgcubano commented Feb 24, 2023

Hello. I was checking the BITPOS (https://redis.io/commands/bitpos/) examples I realized that the results may be wrong in the official docs. I have executed the same commands using Redis docker's official image (version 7.0.8):

> SET mykey "\xff\xf0\x00"
"OK"

 > BITPOS mykey 0
(integer) 12

 > SET mykey "\x00\xff\xf0"
"OK"

 > BITPOS mykey 1 0
(integer) 8

 > BITPOS mykey 1 2
(integer) 16

 > BITPOS mykey 1 2 -1 BYTE
(integer) 16

 > BITPOS mykey 1 7 15 BIT
(integer) 8

 > set mykey "\x00\x00\x00"
"OK"

 > BITPOS mykey 1
(integer) -1

 > BITPOS mykey 1 7 -3 BIT
(integer) -1
> 

Would it make sense to do a separate PR?

Regards.

@itamarhaber
Copy link
Member

Hello @jrgcubano - thanks for reporting this.

The core problem IMO isn't the docs, but the interactive example. Moving this issue there.

@itamarhaber itamarhaber transferred this issue from redis/redis-doc Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants