title: reddit-like sorting in rethinkdb
body: <p>I'm using rethinkdb with the <a href="http://thinky.io/" rel="nofollow">thinky</a> ORM on node.js.</p>
  
  <p>I'm trying to sort documents (posts, comments) from a rethinkdb table using a function that takes data from documents, and outputs a number that represents the sorting index of each document, much like <a href="https://github.com/reddit/reddit/blob/master/r2/r2/lib/db/_sorts.pyx#L45-L56" rel="nofollow">reddit's time-sensitive ranking algorithm</a>. The data should then be able to be paginated using <code>.slice()</code>.</p>
  
  <p>Does anyone know how to do this? I'm completely lost.</p>