couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Couchdb Wiki] Update of "HTTP Document API" by mdornseif
Date Fri, 06 Feb 2009 23:11:04 GMT
Dear Wiki user,

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

The following page has been changed by mdornseif:
http://wiki.apache.org/couchdb/HTTP_Document_API

The comment on the change is:
rename count to limit

------------------------------------------------------------------------------
  }
  }}}
  
- The query string parameters ''startkey'', ''endkey'' and ''count'' may also be used to limit
the result set. For example:
+ The query string parameters ''startkey'', ''endkey'' and ''limit'' may also be used to limit
the result set. For example:
  
  {{{
- GET somedatabase/_all_docs?startkey=doc2&count=2 HTTP/1.0
+ GET somedatabase/_all_docs?startkey=doc2&limit=2 HTTP/1.0
  }}}
  
  Will return:
@@ -138, +138 @@

  Both approaches can be combined with ''descending'':
  
  {{{
- GET somedatabase/_all_docs?startkey=doc2&count=2&descending=true HTTP/1.0
+ GET somedatabase/_all_docs?startkey=doc2&limit=2&descending=true HTTP/1.0
  }}}
  
  Will return:
@@ -297, +297 @@

  
  === POST ===
  
- The ''POST'' operation can be used to create a new document with a server generated DocID.
To create a named document, use the ''PUT'' method instead. It is recommended that you avoid
''POST'' when possible, because proxies and other network intermediaries will occasionally
resend ''POST'' requests, which can result in duplicate document creation. If your client
software is not capable of guaranteeing uniqueness of generated UUIDs, use a ''POST'' to ''/_uuids?count=100''
to retrieve a list of document IDs for future ''PUT'' requests. Please note that the ''/_uuids''-call
does not check for existing document ids; collision-detection happens when you are trying
to save a document.
+ The ''POST'' operation can be used to create a new document with a server generated DocID.
To create a named document, use the ''PUT'' method instead. It is recommended that you avoid
''POST'' when possible, because proxies and other network intermediaries will occasionally
resend ''POST'' requests, which can result in duplicate document creation. If your client
software is not capable of guaranteeing uniqueness of generated UUIDs, use a ''POST'' to ''/_uuids?limit=100''
to retrieve a list of document IDs for future ''PUT'' requests. Please note that the ''/_uuids''-call
does not check for existing document ids; collision-detection happens when you are trying
to save a document.
  
  The following is an example HTTP ''POST''. It will cause the CouchDB server to generate
a new DocID and revision ID and save the document with it.
  

Mime
View raw message