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

document lt, gt, lte, gte #258

Merged
merged 2 commits into from
Jul 31, 2014
Merged

document lt, gt, lte, gte #258

merged 2 commits into from
Jul 31, 2014

Conversation

dominictarr
Copy link
Contributor

this documents the new range encoding, as discussed in #201

@dominictarr
Copy link
Contributor Author

this is a backwards compatible documentation change, so I think we can just merge this.

@kesla
Copy link
Contributor

kesla commented Jul 25, 2014

Lgtm

@@ -388,11 +388,13 @@ The standard `pause()`, `resume()` and `destroy()` methods are implemented on th

Additionally, you can supply an options object as the first parameter to `createReadStream()` with the following options:

* `'start'`: the key you wish to start the read at. By default it will start at the beginning of the store. Note that the *start* doesn't have to be an actual key that exists, LevelDB will simply find the *next* key, greater than the key you provide.
* `'gt', 'gte'` (greater than (or equal)) if either of these options are provided, the stream output will only include keys that are greater than (or equal) to this option. (can be either a string or a buffer, or a value supported by the current encoding) If not provided the output will include from the lowest key in the database. See also (`'lt', 'lte'`, and `'range'`). keys are compared by comparing the bytes in their binary encoded value.
Copy link
Member

Choose a reason for hiding this comment

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

I'd make this less short but moar easy:

'gt' (greater than), 'gte' (greater than or equal): ...

the stream output will only include k/v pairs whose keys are gre....

I'd move (can be either...) out of the parentheses.

If not provided the output will start at the lowest key in the database.

I'd remove the parentheses at: See also ('lt', 'lte', and 'range').

The last sentence starts with a lower case letter

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I avoided the phrase start at because then you have reverse ranges, which end at the gt value, and that was confusing and that is why we introduced greater than, less than

Copy link
Contributor Author

Choose a reason for hiding this comment

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

maybe the simplest way to describe it would be all at once:

gt (greater than) lt (less than) gte (greater than or equal) lte (less than or equal), describe a range for the stream to retrive, for example {lte: 'zzzzzz', gte: 'a'} will stream all the key/value pairs where the key <= 'a' && key <= 'zzzzzz' (lt and gt are similar, but are used to express exclusive ranges)

Copy link
Member

Choose a reason for hiding this comment

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

See also ... 'range'

what is this 'range' of which you speak? Did you mean 'reverse'?

@dominictarr
Copy link
Contributor Author

okay, I've updated the copy to read more clearly.

rvagg added a commit that referenced this pull request Jul 31, 2014
@rvagg rvagg merged commit 33556b6 into Level:master Jul 31, 2014
@juliangruber
Copy link
Member

great work, looks good to me!

@juliangruber
Copy link
Member

haha github fail

@TimothyGu TimothyGu mentioned this pull request May 9, 2015
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.

4 participants