You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by "Jeffrey M. Barber" <ze...@gmail.com> on 2010/11/19 04:24:51 UTC

changes from view

is there a way to get change notifications on a view? or, is there a way to
replicate from a view into another database?

Re: changes from view

Posted by Jan Lehnardt <ja...@apache.org>.
On 23 Nov 2010, at 14:24, Ido Ran wrote:

> Hi,
> This is actually good question. In my use case I have CouchDB with documents
> of different "types". For simplicity and future ability for change I've
> create two views, one for each type of document: TasksView and ProjectsView
> (it is a POC application).
> 
> If I'll use _changes notification I'll have to check if the changed document
> is of type "Task" and refetch the TasksView but then I've hold in my
> application knowledge about the TasksView.
> 
> Is that good? Is there a better way?

You could use a _changes filter:

  http://guide.couchdb.org/editions/1/en/notifications.html#filters

Cheers
Jan
-- 

> 
> Ido
> 
> On Fri, Nov 19, 2010 at 1:20 PM, Sebastian Cohnen <
> sebastiancohnen@googlemail.com> wrote:
> 
>> Hi Jeffrey,
>> 
>> there is no mechanism to get changes to a view. Since view updates are
>> triggered on read it wouldn't make much sense anyways. Also it is not
>> possible to replicate view results to another database (although this might
>> be an interesting feature in future releases).
>> 
>> Are you asking out of curiosity or do you have an actual use case?
>> 
>> Best
>> 
>> Sebastian
>> 
>> On 19.11.2010, at 04:24, Jeffrey M. Barber wrote:
>> 
>>> is there a way to get change notifications on a view? or, is there a way
>> to
>>> replicate from a view into another database?
>> 
>> 


Re: changes from view

Posted by Ido Ran <id...@gmail.com>.
Hi,
This is actually good question. In my use case I have CouchDB with documents
of different "types". For simplicity and future ability for change I've
create two views, one for each type of document: TasksView and ProjectsView
(it is a POC application).

If I'll use _changes notification I'll have to check if the changed document
is of type "Task" and refetch the TasksView but then I've hold in my
application knowledge about the TasksView.

Is that good? Is there a better way?

Ido

On Fri, Nov 19, 2010 at 1:20 PM, Sebastian Cohnen <
sebastiancohnen@googlemail.com> wrote:

> Hi Jeffrey,
>
> there is no mechanism to get changes to a view. Since view updates are
> triggered on read it wouldn't make much sense anyways. Also it is not
> possible to replicate view results to another database (although this might
> be an interesting feature in future releases).
>
> Are you asking out of curiosity or do you have an actual use case?
>
> Best
>
> Sebastian
>
> On 19.11.2010, at 04:24, Jeffrey M. Barber wrote:
>
> > is there a way to get change notifications on a view? or, is there a way
> to
> > replicate from a view into another database?
>
>

Re: changes from view

Posted by Sebastian Cohnen <se...@googlemail.com>.
Hi Jeffrey,

there is no mechanism to get changes to a view. Since view updates are triggered on read it wouldn't make much sense anyways. Also it is not possible to replicate view results to another database (although this might be an interesting feature in future releases).

Are you asking out of curiosity or do you have an actual use case?

Best

Sebastian

On 19.11.2010, at 04:24, Jeffrey M. Barber wrote:

> is there a way to get change notifications on a view? or, is there a way to
> replicate from a view into another database?


Re: changes from view

Posted by David Rose <do...@gmail.com>.
You cannot get change notifications in a view. You can do selective
replication from one db to another, though. See
http://wiki.apache.org/couchdb/Replication#Filtered_Replication

David Rose

On Thu, Nov 18, 2010 at 9:24 PM, Jeffrey M. Barber <ze...@gmail.com> wrote:
> is there a way to get change notifications on a view? or, is there a way to
> replicate from a view into another database?
>