incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Cottlehuber <d...@muse.net.nz>
Subject Re: replication with document transformation
Date Wed, 25 Apr 2012 22:06:12 GMT
On 24 April 2012 21:39, Tim Kuijsten <info@netsend.nl> wrote:
> I'm currently replicating with filters, this works great to share certain
> documents between multiple systems based on their attributes. The thing is,
> I'd like to map certain names to a locally used name.
>
> Example: we have 2 systems that want to share some documents with each
> other, based on a certain value for the "company" attribute.
>
> The owners of database 1 want to share all documents that have "company":
> "Webstore Chicago" with the owners of database 2. All fine with a filter,
> but the owners of database 2 like to refer to "Webstore Chicago" as
> "Webstore 501". Is there a way to somehow transform the document while it's
> being replicated by the filter so in 1 database it's represented as
> "Webstore Chicago" and in the other db this same doc has "Webstore 501"?
>
> Maybe if I could replicate the results of a view instead of the direct docs
> or something..
>
> Regards,
>
> Tim

Hi Tim,

sorry I thought I send this through yesterday. I can only think of hacks.

Store the core data in a master doc, and have two linked docs that
represent the additional (transformed) info for each site. These linked docs
are then filterable individually for each site, and you can query
include_docs at
each end on the core data to retrieve the master + only the
site-specific transform.
Either munge it back together maybe in a list or show, or do it client side.

Sound workable?

A+
Dave

Mime
View raw message