What is the Redis equivalent of TransactionDB's getRange?
<p>The transactionDB python api says that,</p>

<blockquote>
  <p>Database.get_range(begin, end[, limit, reverse, streaming_mode])</p>
  
  <p>Returns all keys k such that begin &lt;= k &lt; end and their associated values as a 
  list of KeyValue objects. Note the exclusion of end from the range.</p>
  
  <p>This read is fully synchronous.</p>
</blockquote>

<p>I want something equivalent in Redis. I looked at lrange and zrange functions but don't think that they are similar.</p>

<p>TL;DR there isn't a direct equivalent and scanning the entire key space is always slow(er) - you should avoid it unless your intent is getting most/all of the keys anyway.</p>

<p>There are two Redis commands that allow you to scan the keyspace - one is called <a href="http://redis.io/commands/scan" rel="nofollow"><code>SCAN</code></a> and the <a href="http://redis.io/commands/keys" rel="nofollow">other one</a> should not be mentioned nor used for anything but development. Unlike what you're after, however, these commands:
1. Do not work on ranges of keys, but rather on glob-like patterns
2. Do not return the associated value, you have to specifically read it</p>

<p>Generally speaking, you should refrain from practicing such read patterns unless you mean it - in most cases, you want the responses fast and cheap, so a full scan is almost always not the right way,</p>

python redis jedis foundationdb