title: CouchDB pagination and sorting
body: <p>So I am using this approach on CouchDB docs to perform pagination.</p>
  
  <ul>
  <li>Request rows_per_page + 1 rows from the view </li>
  <li>Display rows_per_page rows, store + 1 row as next_startkey and next_startkey_docid </li>
  <li>As page information, keep startkey and next_startkey </li>
  <li>Use the next_* values to
  create the next link, and use the others to create the previous link</li>
  </ul>
  
  <p>One thing I don't understand is, how do I perform sorting using this approach, assuming each document have a last updated timestamp and I want to sort using that field instead of sorting using ids.</p>