incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From svilen ...@svilendobrev.com>
Subject Re: tracking changes - how to check what was deleted?
Date Thu, 16 May 2013 16:17:18 GMT
thanks Dave.
i'll stick with client-cache-checks, because apart of deleting,
type-change also can happen (in principle) - and that's deleting from
one cache insert in another.

svilen

On Thu, 16 May 2013 17:59:48 +0200
Dave Cottlehuber <dch@jsonified.com> wrote:

> On 16 May 2013 13:47, svilen <az@svilendobrev.com> wrote:
> > g'day
> > so i have multiple (3) kinds of documents (say with
> > fields .type=..) in same database. And i listen to changes feed,
> > and according to type, show the different kinds of docs in 3
> > different windows.
> >
> > if some doc was deleted, how can i guess what .type it had ?
> > changes return only _id and _rev of the new deleted stub..
> > is looking up the doc.id in those 3 caches the only option?
> >
> > ciao
> > svilen
> 
> Hey Svilen,
> 
> Some things:
> 
> Changes only returns the "last known good" change (~handwavey~) if
> that makes sense - e.g. if doc a -> a' -> a'' -> a''' are processed in
> between you checking changes, you will not receive a', a'' at all.
> 
> Document deletion inside couch is simply taking doc._id,_rev only and
> storing a new doc._id, doc._deleted, and _rev + 1. There is nothing
> stopping you re-implementing DELETE yourself (e.g. update handler
> server side, or client side as you like), and storing doc._id _rev AND
> _type as well.
> 
> Alternatively, use a byte of the id to store the type if you can
> achieve that.
> 
> That should see you right.
> 
> A+
> Dave

Mime
View raw message