---
title: "Discussion on \"Basic CRUD with CouchDB/PouchDB\" | Hashnode"
description: "Discussion on \"Basic CRUD with CouchDB/PouchDB\". In my  previous post I discussed the basics of setting up CouchDB and PouchDB, in this article I'd like to walk you through some common operations we perform on any database: CRUD (Create-Read-Update-Delete) with CouchDB. I'd also add some SQL refere..."
url: "https://hashnode.com/posts/basic-crud-with-couchdbpouchdb/5ec522d86bace2452f98e767"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Basic CRUD with CouchDB/PouchDB](https://blog.amustapha.com/basic-crud-with-couchdbpouchdb?utm_source=hashnode&utm_medium=feed)

In my previous post I discussed the basics of setting up CouchDB and PouchDB, in this article I'd like to walk you through some common operations we perform on any database: CRUD (Create-Read-Update-Delete) with CouchDB. I'd also add some SQL refere...

May 19, 2020 · blog.amustapha.com  
Read the article

-   [#couchdb](https://hashnode.com/tag/couchdb)
-   [#offline](https://hashnode.com/tag/offline)
-   [#pwa](https://hashnode.com/tag/pwa)

## Written by

[Abdulhakeem Mustapha](https://hashnode.com/@amustapha)

@amustapha · Kano, Nigeria.

  
[View profile](https://hashnode.com/@amustapha)

Software Engineer | Startup Founder

## Responses 1

Markdown supported · ⌘↵ to post

[Mardone Dias](https://hashnode.com/@mardonedias)

[Jul 15, 2020](https://hashnode.com/posts/basic-crud-with-couchdbpouchdb/5ec522d86bace2452f98e767/comment/5f0f861b2259ec1c14c4c659)

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.

[Abdulhakeem Mustapha](https://hashnode.com/@amustapha)

[Jul 16, 2020](https://hashnode.com/posts/basic-crud-with-couchdbpouchdb/5ec522d86bace2452f98e767/comment/5f0f861b2259ec1c14c4c659#reply-5f1056687f90732581b909ab)

[Mardone Dias](https://hashnode.com/@mardonedias)

If it's about pagination, why not use limit&skip rather than start & end key? Do you have any special use case why you have to use keys?

[Mardone Dias](https://hashnode.com/@mardonedias)

[Jul 16, 2020](https://hashnode.com/posts/basic-crud-with-couchdbpouchdb/5ec522d86bace2452f98e767/comment/5f0f861b2259ec1c14c4c659#reply-5f107c517f90732581b90bde)

[Abdulhakeem Mustapha](https://hashnode.com/@amustapha)

Hello,

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.

Thank you.

[Abdulhakeem Mustapha](https://hashnode.com/@amustapha)

[Jul 16, 2020](https://hashnode.com/posts/basic-crud-with-couchdbpouchdb/5ec522d86bace2452f98e767/comment/5f0f861b2259ec1c14c4c659#reply-5f10c168d6c58d29e0240c01)

[Mardone Dias](https://hashnode.com/posts/basic-crud-with-couchdbpouchdb/@mardonedias)

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.
