Lesson 18

Filtering Data from CouchDB

Improve efficiency by only syncing required data

PRO

Lesson Outline

Filtering Data from CouchDB

We can automatically sync data from our remote CouchDB database to our local PouchDB database, which is pretty cool. But there could be some problems that arise from that. If it's a small enough amount of data then there won't be an issue, but what about when the application is two years old and maybe 300,000 chat messages have been sent? You probably don't want to keep the entire CouchDB database replicated to the local PouchDB database.

We've covered creating views with map functions, and validate_doc_update functions, but now we are going to use yet another function with CouchDB to create a filter. This will allow us to filter the data that we want to replicate. What you want to replicate is going to depend on the application, but we are going to walk through implementing a filter that will only replicate documents from the last week.

PRO

Thanks for checking out the preview of this lesson!

You do not have the appropriate membership to view the full lesson. If you would like full access to this module you can view membership options (or log in if you are already have an appropriate membership).