Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 41060 invoked from network); 24 Jan 2010 16:38:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Jan 2010 16:38:04 -0000 Received: (qmail 22873 invoked by uid 500); 24 Jan 2010 16:38:03 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 22787 invoked by uid 500); 24 Jan 2010 16:38:03 -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 22777 invoked by uid 99); 24 Jan 2010 16:38:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 24 Jan 2010 16:38:03 +0000 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [212.61.9.21] (HELO mail2.nl.clara.net) (212.61.9.21) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 24 Jan 2010 16:37:54 +0000 Received: from claranet.nl (bifur.vianetworks.nl [212.61.15.16]) by mail2.nl.clara.net (Postfix) with SMTP id CBFC35AEFCA for ; Sun, 24 Jan 2010 17:37:28 +0100 (CET) Received: from 82.73.244.17 (SquirrelMail authenticated user buyway58) by webmail.claranet.nl with HTTP; Sun, 24 Jan 2010 17:37:28 +0100 (CET) Message-ID: <40746.82.73.244.17.1264351048.squirrel@webmail.claranet.nl> Date: Sun, 24 Jan 2010 17:37:28 +0100 (CET) Subject: Re: Revisions for Created Documents From: "Markus Jelsma" To: In-Reply-To: <97552DEE-5559-4DA4-80EA-E3F9B4861300@me.com> References: <97552DEE-5559-4DA4-80EA-E3F9B4861300@me.com> X-Priority: 3 Importance: Normal Reply-To: markus@buyways.nl X-Mailer: SquirrelMail (version 1.2.8) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Hi Mike, This is not completely watertight, especially considering replicating over documents. In general, all new documents are prefixed with 1- but you can just as easily add a document and set the _rev manually to a number higher than 1. Setting _rev to 0 won't do the trick though. If your scenario doesn't allow for these kind of `features`, you could use it i guess. Cheers, Michael Beam said: > Hi There, > > My application is monitoring the _changes API to update its UI for > updated documents. I would also like to take actions in my app for new > documents, so I wanted to get the list's opinion on detecting created > documents. > > Is checking the revision string for the prefix "1-" is a reliable and > robust method of recognizing a change as a new document? Everything in > my experience points to yes, but I may be overlooking some subtleties > about how that all works. > > Thanks! > > Mike Beam