The CouchDB docs 6.2.5 pagination recipe recommends to use the
"startkey_docid for pagination if, and only if, the extra row you fetch to
find the next page has the same key as the current startkey"
Why can't you keep the start key the same and just keep updating the
startkey_docid?
For example:
if a view emits a key of [doc.zipcode, doc.lastname]
And I'm looking for all people in a given zipcode.
and I do an initial query with startkey=[02134] endKey=[02134,{}] limit=51
the 50th user has a last name of Jackson (_id 123) and the 51st user has a
lastname of Johnson (_id 234).
I could ask for the next page in two ways:
*startkey=[02134,Johnson] endKey=[02134,{}] limit=51*
OR
*startkey=[02134] endKey=[02134,{}] startkey_doc_id=234 limit=51*
Is there something wrong with the second approach? Would it perform poorly?
Thanks
Jason
Jason Gordon | Principal | A S S U R E B R I D G E
Office: +1 888 409 6995 | Mobile: +1 978 885 6102 | Fax: +1 888 409
6995
Email: [email protected]