couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens Alfke <>
Subject How to identify new docs in the _changes feed?
Date Wed, 22 Jun 2011 17:17:03 GMT
By watching the _changes feed I can detect when a document is deleted (via the “deleted”
key), but is there a way to tell when a new document is created? There doesn’t seem to be
a corresponding extra key in the notification in this case.

I am tempted to look for a prefix of “1-“ in the revision, but I’m pretty sure that
this is an implementation detail and revision IDs should be treated as purely opaque cookies,

The cheapest alternative I can think of is to do a HEAD on the _all_docs view after I get
a new notification from _changes, and see if its ETag has changed.

View raw message