incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From svilen ...@svilendobrev.com>
Subject Re: any good way of filtering out your own _changes?
Date Wed, 03 Oct 2012 15:07:45 GMT
well, imagine a chat, each room being database, each message
separate doc. each participant keeps replicas of chats he's in - and
talks into them. when special messages appear, the app does something
(e.g. pop-up).

so order does matter (but doesnt have to be strict), 
and not reacting on current-app's own messages too.

svil

 On Wed, 3 Oct 2012 16:51:33 +0200
Dave Cottlehuber <dch@jsonified.com> wrote:

> On 3 October 2012 16:19, svilen <az@svilendobrev.com> wrote:
> > g'day
> >
> > so i have a local db that replicates bidirectional with several
> > others. an app uses local db, listens to _changes and also puts
> > things sometimes. Any way to avoid it seeing it's own changes?
> > i guess i can put a manual field e.g. "source" to *each* document or
> > something... but that's not very neat. but may be the only way,
> > hmmm - e.g. how to differ between different copies of same app..
> > running in parallel.
> >
> > ah, and any way to automaticaly sequence items? Even if "eventual"
> > as in "eventual consistency"..
> ?
> > Now i am putting a separate field for that ( =db.doc_count ) at each
> > update, but i dont like it..
> 
> Use either a view (look up complex keys on the wiki for example), or
> put it into the id of the doc:
> 
> 00001_the_other_id
> 00002_the_next_id
> 
> > there is _local_seq in the document API that returns the sequenceid
> > of the revision, but that is not accesible in views.. or actualy
> > now i see it can be made accessible by adding extra options in the
> > view definition. hmm i have to try that.
> 
> Seems like a better fit. A little more info on what you're trying to
> achieve might give us some better ideas.
> 
> A+
> Dave

Mime
View raw message