incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Ramage <ryan.ram...@gmail.com>
Subject Re: Anyway to alter doc when replicating?
Date Thu, 06 Feb 2014 19:39:52 GMT
On Thu, Feb 6, 2014 at 10:38 AM, Dan Santner <dansantner@me.com> wrote:

> I have the replication filtering down now but I'm wondering is there
> anyway for me to change the doc before it copies to the source?
>
> The use case is I have production documents that I want to migrate
> somewhere else but change all the names to 'John Smith' before they land in
> the new destination.  Also need to remove a couple other things that might
> be considered sensitive.
>
>

I am loving using leveldb with couch. For the problem you are dealing with,
one very helpful module is https://github.com/dominictarr/level-couch-sync

In the emit you could alter the doc, change names, etc. Then just replicate
that to a remote couch. I does add a layer of middleware, but might meet
your needs.

Another option is to use Cloudants chained views. See here:
http://examples.cloudant.com/sales/_design/sales/index.html use a view, and
then a dbcopy to another database, and then just replicate that db.
Unfortunately this is non-standard couchdb, but the cloudant team are
friendly folk.

Ryan

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message