public class BulkCommand extends AbstractCommand implements CouchCommand
http://docs.couchdb.org/en/2.2.0/api/database/bulk-api.html
POST /{db}/_bulk_docs
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.
Parameters:
db – Database name
Request Headers:
- Accept
+ application/json
+ text/plain
- Content-Type – application/json
- X-Couch-Full-Commit – Overrides server’s commit policy. Possible values are: false and true. Optional
Request JSON Object:
- docs (array) – List of documents objects
- new_edits (boolean) – If false, prevents the database from assigning them new revision IDs. Default is true. Optional
Response Headers:
Content-Type
+ application/json
+ text/plain; charset=utf-8
Response JSON Array of Objects:
- id (string) – Document ID
- rev (string) – New document revision token. Available if document has saved without errors. Optional
- error (string) – Error type. Optional
- reason (string) – Error reason. Optional
Status Codes:
201 Created – Document(s) have been created or updated
400 Bad Request – The request provided invalid JSON data
417 Expectation Failed – Occurs when at least one document was rejected by a validation function
body, commandHandler, handlerException, method, urlHTTP_ACCEPTED, HTTP_BAD_REQUEST, HTTP_CREATED, HTTP_EXPECTATION_FAILED, HTTP_NO_CONTENT, HTTP_NOT_FOUND, HTTP_NOT_MODIFIED, HTTP_OK, HTTP_RESET_CONTENT| Constructor and Description |
|---|
BulkCommand(HttpBuilder httpBuilder,
Queryable queryable) |
| Modifier and Type | Method and Description |
|---|---|
HttpMethod |
asPost() |
HttpMethod |
asPut() |
<T> T |
execute()
Execute the database statement could be a
Command or a Query |
String |
getBody() |
asDelete, asGet, asHead, errorFormat, getContentEncode, getContentType, getEntity, getRevision, injectAutoIdentity, injectIdentity, isAccepted, isCreated, isExpectationFailed, isNotFound, isOk, printRequest, printResponse, setBookmark, with, with, withclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitasDelete, asGet, asHeadpublic BulkCommand(HttpBuilder httpBuilder, Queryable queryable)
public <T> T execute()
CommandCommand or a Querypublic String getBody()
getBody in interface CouchCommandpublic HttpMethod asPut()
asPut in interface CouchCommandasPut in class AbstractCommandpublic HttpMethod asPost()
asPost in interface CouchCommandasPost in class AbstractCommandCopyright © 2012–2020 jkniv, copyleft code. All rights reserved.