I have a little problem with couchdb, it's about pagination with startkey, endkey and limit. I can page to the next pages. But, I cannot understand how to keep the previous key to return. I use nodejs + express. If I could pass on some material with an example I would appreciate it. I've looked for a lot, a lot, but, there is nothing but the algorithm of the documentation itself. If you can help me I would appreciate it very much.
The documentation says that limit & skip performs poorly with a large amount of data. So I already want to avoid this problem in the future, treating it as efficiently as possible.
My question was how to return to the previous page. And the solution that stores the keys in the frontend will not add complexity to the project.
I appreciate the suggestion, I will do a deeper analysis to see the cost benefit.
I see. Personally in my experience, I've not hit those performance bottlenecks yet (I've used CouchDB to handle a few thousands of documents). And I'd say, it's quite harder fetching by keys.
However, if that's the case, a workaround could be running an _all_docs to get a list of all documents (just rev and id, without the full document), save those in state/localstorage and use that as basis for performing queries using the ids for start & end key.
Mardone Dias
Hello,
I have a little problem with couchdb, it's about pagination with startkey, endkey and limit. I can page to the next pages. But, I cannot understand how to keep the previous key to return. I use nodejs + express. If I could pass on some material with an example I would appreciate it. I've looked for a lot, a lot, but, there is nothing but the algorithm of the documentation itself. If you can help me I would appreciate it very much.
Thank you.