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

The meaning of "-inf +inf" #1862

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

The meaning of "-inf +inf" #1862

wants to merge 2 commits into from

Conversation

hgs-study
Copy link

No description provided.

@hgs-study
Copy link
Author

Hello, I'm hyun, a Korean developer. I don't live in an English-speaking world, so when I looked at the docs, the sentence "inf" didn't make sense at once, so I asked Google. I'm asking pr because it would be easier to understand if a simple comment was added. thank you.

Copy link
Collaborator

@enjoy-binbin enjoy-binbin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, i am also not live in english-speaking world. (i am from China)
it is good that you asked the Google and got your answer. it is a nice habit

it might be like null / NULL / None / nil, it's something customary? (i am not sure about the wording)
unfortunately, i think we will not take the comment. (Ps you can see the example is in cli block, it is a special blcok that we we can run the real redis commands on it)

anyway, actually you can the inf meaning in https://redis.io/commands/zrangebyscore/#exclusive-intervals-and-infinity

@@ -16,6 +16,6 @@ Note: the command has a complexity of just O(log(N)) because it uses elements ra
ZADD myzset 1 "one"
ZADD myzset 2 "two"
ZADD myzset 3 "three"
ZCOUNT myzset -inf +inf
ZCOUNT myzset -inf +inf // -inf +inf : The meaning of this sentence is infinity.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can't use // as a comment in redis-cli, so this is an error if the example is pasted in redis-cli.

Please add this description of negative infinity and positive infinity somewhere else in this document, together with the description of min and max.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you advised in the review, I added the contents of 'inf' and // to another place without using it. Please check. Thank you.

@netlify
Copy link

netlify bot commented Aug 19, 2022

👷 Deploy request for redis-doc pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 988d3de

@@ -11,11 +11,12 @@ Note: the command has a complexity of just O(log(N)) because it uses elements ra
@integer-reply: the number of elements in the specified score range.

@examples
- `-inf +inf` : 'inf' stands for infinity, meaning from least negative infinity to maximum positive infinity.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this explanation should be under "Examples". It's better to explain it in the main documentation section. We should also explain exclusive ranges with (.

We already have "The min and max arguments have the same semantic as described for ZRANGEBYSCORE.", but ZRANGEBYSCORE is deprecated and replaced by ZRANGE with the BYSCORE argument. So instead, I think we should replace "The min and max arguments have the same semantic as described for ZRANGEBYSCORE." with the same explanation that we have in the ZRANGE docs:

start and stop can be -inf and +inf, denoting the negative and positive infinities, respectively. This means that you are not required to know the highest or lowest score in the sorted set to get all elements from or up to a certain score.

By default, the score intervals specified by start and stop are closed (inclusive). It is possible to specify an open interval (exclusive) by prefixing the score with the character (.


```cli
ZADD myzset 1 "one"
ZADD myzset 2 "two"
ZADD myzset 3 "three"
ZCOUNT myzset -inf +inf
ZCOUNT myzset -inf +inf
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't change the whitespace here. (Suggesting self-review so you can see such mistakes.)

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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

Successfully merging this pull request may close these issues.

None yet

4 participants