-
-
Notifications
You must be signed in to change notification settings - Fork 267
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
Conversation
this is a backwards compatible documentation change, so I think we can just merge this. |
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. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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'
?
okay, I've updated the copy to read more clearly. |
great work, looks good to me! |
haha github fail |
this documents the new range encoding, as discussed in #201