couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Markus Jelsma" <>
Subject Re: Revisions for Created Documents
Date Sun, 24 Jan 2010 16:37:28 GMT
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.


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

View raw message