title: Redis : How can I sort my hash by keys?
body: <p>Suppose that I have some news stored in a hash. I have different hashes (each hash represent one news) :</p>
  
  <pre><code>news:1
  news:2
  news:3
  ...
  </code></pre>
  
  <p>I want to retrieve all the keys with the KEYS command like that :</p>
  
  <pre><code>KEYS news:*
  </code></pre>
  
  <p>The problem the keys are not sorted :</p>
  
  <pre><code>news:3
  news:1
  news:2
  </code></pre>
  
  <p>I would like to retrieve the list of keys in the right order. I'm not sure that the hash is the structure that I need. But, according to the <a href="http://redis.io/topics/data-types#hashes">redis documentation</a> :</p>
  
  <blockquote>
    <p>Redis Hashes are maps between string field and string values, so they are the perfect data type to represent objects (for instance Users with a number of fields like name, surname, age, and so forth):</p>
  </blockquote>
  
  <p>Storing my news object in a hash seems to be a good idea.</p>
  
  <p>Any suggestions ?</p>