Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 165D36FA2 for ; Thu, 23 Jun 2011 01:14:29 +0000 (UTC) Received: (qmail 46573 invoked by uid 500); 23 Jun 2011 01:14:27 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 46547 invoked by uid 500); 23 Jun 2011 01:14:27 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 46539 invoked by uid 99); 23 Jun 2011 01:14:26 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Jun 2011 01:14:26 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [74.125.82.54] (HELO mail-ww0-f54.google.com) (74.125.82.54) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Jun 2011 01:14:20 +0000 Received: by wwf4 with SMTP id 4so1308646wwf.23 for ; Wed, 22 Jun 2011 18:14:00 -0700 (PDT) Received: by 10.227.19.209 with SMTP id c17mr1349984wbb.8.1308791639120; Wed, 22 Jun 2011 18:13:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.227.145.7 with HTTP; Wed, 22 Jun 2011 18:13:39 -0700 (PDT) In-Reply-To: References: <4E3B3704-FB66-4F8E-9660-20CECB9338F4@mooseyard.com> From: Mark Hahn Date: Wed, 22 Jun 2011 18:13:39 -0700 Message-ID: Subject: Re: How to identify new docs in the _changes feed? To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=002215b03e62bc1bb904a656ccc8 X-Virus-Checked: Checked by ClamAV on apache.org --002215b03e62bc1bb904a656ccc8 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable > What if revision 2-* replicates in? I assume you mean: What if revision 2-* replicates in and there is no 1-*? On Wed, Jun 22, 2011 at 1:26 PM, Randall Leeds wro= te: > On Wed, Jun 22, 2011 at 10:17, Jens Alfke wrote: > > By watching the _changes feed I can detect when a document is deleted > (via the =93deleted=94 key), but is there a way to tell when a new docume= nt is > created? There doesn=92t seem to be a corresponding extra key in the > notification in this case. > > > > I am tempted to look for a prefix of =931-=93 in the revision, but I=92= m pretty > sure that this is an implementation detail and revision IDs should be > treated as purely opaque cookies, amiright? > > Youisright. But it would work. ;) > > > > > The cheapest alternative I can think of is to do a HEAD on the _all_doc= s > view after I get a new notification from _changes, and see if its ETag ha= s > changed. > > > > =97Jens > > Careful, this is not cheap (yet): > https://issues.apache.org/jira/browse/COUCHDB-941 > (The workaround is be sure to specify ?limit=3D1 or some similarly > restrictive query) > > Why do you need to know the difference and what defines "created" for you= ? > Would a document that replicated from elsewhere count as "created" or > only if it's the first revision? > What if revision 2-* replicates in? > --=20 Mark Hahn Website Manager mark@boutiquing.com 949-342-4246 --002215b03e62bc1bb904a656ccc8--