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 2008/05/09 22:20:20 UTC

[Couchdb Wiki] Update of "HttpDocumentApi" by damien

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 damien:
http://wiki.apache.org/couchdb/HttpDocumentApi

------------------------------------------------------------------------------
  
  === Modify Multiple Documents With a Single Request ===
  
- CouchDB provides a bulk insert/update feature. To use this, you make a ''POST'' request to the URI ''/{dbname}/_bulk_docs'', with the request body being a JSON document containing a list of new documents to be inserted.  The actual format of the request/result documents differ between CouchDB 0.7.2 and 0.7.3(svn).
+ CouchDB provides a bulk insert/update feature. To use this, you make a ''POST'' request to the URI ''/{dbname}/_bulk_docs'', with the request body being a JSON document containing a list of new documents to be inserted or updated.  The actual format of the request/result documents differ between CouchDB 0.7.2 and 0.7.3(svn).
  
  '''CouchDB 0.7.2''':
  
@@ -380, +380 @@

  }
  }}}
  
- ''There's currently no bulk deletion feature.''
+ Updating existing documents requires setting the ''_rev'' member to the revision being updated. To delete a document set the ''_deleted'' member to true. '''CouchDB 0.7.3(svn)''':
+ 
+ {{{
+ {
+   "docs": [
+     {"_id": "0", "_rev": "3682408536", _deleted=true},
+     {"_id": "1", "_rev": "3206753266", "integer": 2, "string": "2"},
+     {"_id": "2", "_rev": "426742535", "integer": 3, "string": "3"}
+   ]
+ }
+ }}}
  
  === DELETE ===