You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by Apache Wiki <wi...@apache.org> on 2011/12/02 00:38:45 UTC

[Couchdb Wiki] Update of "HTTP_Document_API" by JensAlfke

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification.

The "HTTP_Document_API" page has been changed by JensAlfke:
http://wiki.apache.org/couchdb/HTTP_Document_API?action=diff&rev1=82&rev2=83

  {{{
  GET somedatabase/_changes HTTP/1.0
  }}}
- Will return:
+ Will return something of the form:
  
  {{{
  HTTP/1.1 200 OK
@@ -425, +425 @@

  Content-Type: application/json
  Connection: close
  
+ {"results":[
+ {"seq":1,"id":"fresh","changes":[{"rev":"1-967a00dff5e02add41819138abb3284d"}]},
+ {"seq":3,"id":"updated","changes":[{"rev":"2-7051cbe5c8faecd085a3fa619e6e6337"}]},
+ {"seq":5,"id":"deleted","changes":[{"rev":"2-eec205a9d413992850a6e32678485900"}],"deleted":true}
+ ],
+ "last_seq":5}
- {
-   "total_rows": 4, "offset": 0, "rows": [
-     {"id": "doc1", "key": "1", "value": {"rev":"1-4124667444"}},
-     {"id": "doc2", "key": "2", "value": {"rev":"1-1815587255"}},
-     {"id": "doc3", "key": "3", "value": {"rev":"1-1750227892"}},
-     {"id": "doc4", "key": "4", "value": {"rev":"2-524044848", "deleted": true}}
-   ]
- }
  }}}
  All the view parameters work on _changes, such as startkey, include_docs etc. However, note that the startkey is exclusive when applied to this view. This allows for a usage pattern where the startkey is set to the sequence id of the last doc returned by the previous query. As the startkey is exclusive, the same document won't be processed twice.