Method | POST /db/_bulk_docs | |
Request | JSON of the docs and updates to be applied | |
Response | JSON of updated documents | |
Admin Privileges Required | no | |
Return Codes | ||
201 | Document(s) have been created or updated |
The bulk document API allows you to create and update multiple documents at the same time within a single request. The basic operation is similar to creating or updating a single document, except that you batch the document structure and information and . When creating new documents the document ID is optional. For updating existing documents, you must provide the document ID, revision information, and new document values.
For both inserts and updates the basic structure of the JSON is the same:
Table 5.4. Bulk Documents
Field | Description |
all_or_nothing (optional) | Sets the database commit mode to use all-or-nothing semantics |
docs [array] | Bulk Documents Document |
_id (optional) | Document ID |
_rev (optional) | Revision ID (when updating an existing document) |
_deleted (optional) | Whether the document should be deleted |