incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From J Chris Anderson <jch...@gmail.com>
Subject Re: _changes/Filter detecting new documents
Date Fri, 28 May 2010 17:12:29 GMT

On May 28, 2010, at 8:54 AM, Zachary Zolton wrote:

> I was just thinking on this problem the other day....
> 
> The only thing I can think of is looking at the _rev of the document.
> Unfortunately, the format of the _rev has changed in the past, and it
> may change in the future. So I think we're supposed to treat it as an
> opaque token.
> 
> Hmm... Hopefully someone else has a better solution.
> 

I've started to write code that depends on the fact that the rev is structured like "3-abcdefabcedef"
(eg I've got some code that splits by "-", etc).

So you could look for docs with a rev that starts with 1. I'm not sure how good an idea it
is to do that...

> --Zach
> 
> On Fri, May 28, 2010 at 4:33 AM, Pavan Kumar <tvpavan@gmail.com> wrote:
>> Hi ,
>> 
>>  using _changes API with filters, can i detect if the document is a newly
>> Created one or Modified one ? What i understand now is that for both of the
>> scenarios ( new documents added or existing document changed ) _changes API
>> will give a reply back.
>> 
>>  Is there a way to differentiate ?
>> 
>> Thanks,
>> Pavan
>> 


Mime
View raw message