title: Redis - subset of querying hashes and then sorting alphabetically on a value of the hash
body: <p>In my application users can favourite pages - I store these in a set</p>
  
  <pre><code>user:123:favourites
      456, 671, 106, 507, 789
  </code></pre>
  
  <p>I also store a hash of information for each page</p>
  
  <pre><code>page:1
      title: "foo"
      owner_name: "jim"
  page:2
      title: "bar"
      owner_name: "tim"
  ....
  page:n
      title: "title-n"
      owner_name: "owner-n"
  </code></pre>
  
  <p>I'm trying to do the following</p>
  
  <ol>
  <li>Get the set of favourite pages</li>
  <li>Get the page objects from the hashes</li>
  <li>Sort the page hashes by title</li>
  <li>Return a subset of the pages (for paging results - 1-3 or 4-6)</li>
  </ol>
  
  <p>I'm still quite new to redis so kind of struggling to get my head around if this is possible and if I should even be using redis this way. </p>
  
  <p>What steps here should be completed on the redis side and what steps should be completed on the application side?</p>
  
  <hr>
  
  <p>Here's my guess, I'll try it later</p>
  
  <pre><code>SORT user:123:favourites BY page:* -&gt; title GET # LIMIT 0 2 ALPHA DESC
  </code></pre>