You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Nestor Urquiza <ne...@gmail.com> on 2011/10/21 20:35:32 UTC

selective replication not working for deleted source documents

Hi,

I have successfully setup selective replication as I have posted on
http://thinkinginsoftware.blogspot.com/2011/10/couchdb-filtered-replication.html

Everything works perfectly but I have a user story I cannot complete and it is:
When a document is deleted in source
Then the document should be deleted from target

Any idea how can I get this done preferably using the _replicator. I
am not able to discover a magic flag that would allow me to achieve
what I need.

Thanks,

-Nestor

Re: selective replication not working for deleted source documents

Posted by Nestor Urquiza <ne...@gmail.com>.
Yes the changes API could be used from a script to do something around
this, in fact filtered replication is based on the change API after
all as it reads the changes feed to decide what to replicate.

I was more interested in an out of the box setting to state something
like "Run filters for all documents" in which case any document
existing in the target but not in the source could be removed of
course as a "one time shot".

Thanks!
-Nestor

On Sat, Oct 22, 2011 at 11:36 AM, Kwasi Gyasi - Agyei
<kw...@4things.co.za> wrote:
> I thing if you run a _change request from target/source you should be able
> to remove what should be removed. just an idea :)
>
> On Fri, Oct 21, 2011 at 11:14 PM, Nestor Urquiza
> <ne...@gmail.com>wrote:
>
>> Great! Tested and worked but only for the new documents I add. Any
>> documents deleted from source before the addition of the filter will
>> not be deleted in the destination. Nothing big but definitely to be
>> kept in mind. Probably there is an option to force even deleting
>> those?
>>
>> Thanks!
>> -Nestor
>>
>> On Fri, Oct 21, 2011 at 2:38 PM, Robert Newson <rn...@apache.org> wrote:
>> > Your filter function blocks replication of deletions.
>> >
>> > add;
>> >
>> > if (doc._deleted) {
>> >  return true;
>> > }
>> >
>> >
>> > On 21 October 2011 19:35, Nestor Urquiza <ne...@gmail.com>
>> wrote:
>> >> Hi,
>> >>
>> >> I have successfully setup selective replication as I have posted on
>> >>
>> http://thinkinginsoftware.blogspot.com/2011/10/couchdb-filtered-replication.html
>> >>
>> >> Everything works perfectly but I have a user story I cannot complete and
>> it is:
>> >> When a document is deleted in source
>> >> Then the document should be deleted from target
>> >>
>> >> Any idea how can I get this done preferably using the _replicator. I
>> >> am not able to discover a magic flag that would allow me to achieve
>> >> what I need.
>> >>
>> >> Thanks,
>> >>
>> >> -Nestor
>> >>
>> >
>>
>
>
>
> --
>
> Multimedia and Communication | Property | Entertainment
> Kwasi Owusu Gyasi - Agyei
>
> *cell*        (+27) (0) 76 466 4488
> *website *www.4things.co.za
> *email     *kwasi.gyasiagyei@4things.co.za
> *skype    *kwasi.gyasiagyei
> *role*        Developer.Designer.Software Architect
>

Re: selective replication not working for deleted source documents

Posted by Kwasi Gyasi - Agyei <kw...@4things.co.za>.
I thing if you run a _change request from target/source you should be able
to remove what should be removed. just an idea :)

On Fri, Oct 21, 2011 at 11:14 PM, Nestor Urquiza
<ne...@gmail.com>wrote:

> Great! Tested and worked but only for the new documents I add. Any
> documents deleted from source before the addition of the filter will
> not be deleted in the destination. Nothing big but definitely to be
> kept in mind. Probably there is an option to force even deleting
> those?
>
> Thanks!
> -Nestor
>
> On Fri, Oct 21, 2011 at 2:38 PM, Robert Newson <rn...@apache.org> wrote:
> > Your filter function blocks replication of deletions.
> >
> > add;
> >
> > if (doc._deleted) {
> >  return true;
> > }
> >
> >
> > On 21 October 2011 19:35, Nestor Urquiza <ne...@gmail.com>
> wrote:
> >> Hi,
> >>
> >> I have successfully setup selective replication as I have posted on
> >>
> http://thinkinginsoftware.blogspot.com/2011/10/couchdb-filtered-replication.html
> >>
> >> Everything works perfectly but I have a user story I cannot complete and
> it is:
> >> When a document is deleted in source
> >> Then the document should be deleted from target
> >>
> >> Any idea how can I get this done preferably using the _replicator. I
> >> am not able to discover a magic flag that would allow me to achieve
> >> what I need.
> >>
> >> Thanks,
> >>
> >> -Nestor
> >>
> >
>



-- 

Multimedia and Communication | Property | Entertainment
Kwasi Owusu Gyasi - Agyei

*cell*        (+27) (0) 76 466 4488
*website *www.4things.co.za
*email     *kwasi.gyasiagyei@4things.co.za
*skype    *kwasi.gyasiagyei
*role*        Developer.Designer.Software Architect

Re: selective replication not working for deleted source documents

Posted by Nestor Urquiza <ne...@gmail.com>.
Great! Tested and worked but only for the new documents I add. Any
documents deleted from source before the addition of the filter will
not be deleted in the destination. Nothing big but definitely to be
kept in mind. Probably there is an option to force even deleting
those?

Thanks!
-Nestor

On Fri, Oct 21, 2011 at 2:38 PM, Robert Newson <rn...@apache.org> wrote:
> Your filter function blocks replication of deletions.
>
> add;
>
> if (doc._deleted) {
>  return true;
> }
>
>
> On 21 October 2011 19:35, Nestor Urquiza <ne...@gmail.com> wrote:
>> Hi,
>>
>> I have successfully setup selective replication as I have posted on
>> http://thinkinginsoftware.blogspot.com/2011/10/couchdb-filtered-replication.html
>>
>> Everything works perfectly but I have a user story I cannot complete and it is:
>> When a document is deleted in source
>> Then the document should be deleted from target
>>
>> Any idea how can I get this done preferably using the _replicator. I
>> am not able to discover a magic flag that would allow me to achieve
>> what I need.
>>
>> Thanks,
>>
>> -Nestor
>>
>

Re: selective replication not working for deleted source documents

Posted by Robert Newson <rn...@apache.org>.
Your filter function blocks replication of deletions.

add;

if (doc._deleted) {
  return true;
}


On 21 October 2011 19:35, Nestor Urquiza <ne...@gmail.com> wrote:
> Hi,
>
> I have successfully setup selective replication as I have posted on
> http://thinkinginsoftware.blogspot.com/2011/10/couchdb-filtered-replication.html
>
> Everything works perfectly but I have a user story I cannot complete and it is:
> When a document is deleted in source
> Then the document should be deleted from target
>
> Any idea how can I get this done preferably using the _replicator. I
> am not able to discover a magic flag that would allow me to achieve
> what I need.
>
> Thanks,
>
> -Nestor
>