workshopper / levelmeup

Level Me Up Scotty! An intro to Node.js databases via a set of self-guided workshops.
Other
271 stars 60 forks source link

Start/End options for readStreams are legacy ranges #80

Closed xaviervalarino closed 7 years ago

xaviervalarino commented 7 years ago

start and end options are labelled as legacy ranges, suggesting the use of lte (less than or equal) and gte (greater than or equal) instead.

From the LevelUp README:

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

'gt' (greater than), 'gte' (greater than or equal) define the lower bound of the range to be streamed. Only records where the key is greater than (or equal to) this option will be included in the range. When reverse=true the order will be reversed, but the records streamed will be the same.

'lt' (less than), 'lte' (less than or equal) define the higher bound of the range to be streamed. Only key/value pairs where the key is less than (or equal to) this option will be included in the range. When reverse=true the order will be reversed, but the records streamed will be the same.

'start', 'end' legacy ranges - instead use 'gte', 'lte'

Exercises _@horsejs Tweets, Keywise, and Short Scrabble Words all reference using start and end. Is it worthwhile to update these exercises? I can create a PR.

martinheidegger commented 7 years ago

Fixed in https://github.com/workshopper/levelmeup/pull/39 thank you for pointing this out!