Search code examples
couchdbreplicationpouchdb

How can I alter the incoming documents on replication in CouchDB


I need to replicate in CouchDB data from one database to another but in the process I want to alter the documents being replicated over,

  1. mostly stripping out particular fields (but other applications mentioned in comments).
  2. The replication would always be 100% one way (but other applications mentioned in comments could use bi-directional and sync)
  3. I would prefer if this process did not increment their revision ID but that might be asking for too much.

But I don't see any of the design document functions that do what I am trying to do.

As it seems doesn't do this, what plans are there for adding this? And meanwhile, what workarounds are there?


Solution

  • No, there is no out-of-the-box solution, as this would defy the whole purpose and logic of multi-master, MVCC logic.

    The only option I can see here is to create your own solution, but I would not call this a replication, but rather ETL (Extract, Transform, Load). And for ETL there are tools available that will let you do the trick, like (mixing open source and commercial here):

    There is plenty more of ETL tools on the market.