Introduction
IBM® Cloudant® for IBM Cloud® is a document-oriented database as a service (DBaaS). It stores data as documents in JSON format. It is built with scalability, high availability, and durability in mind. It comes with a wide variety of indexing options that include MapReduce, IBM Cloudant Query, and full-text indexing. The replication capabilities make it easy to keep data in sync between database clusters, desktop PCs, and mobile devices.
Detailed documentation is also available such as a Getting started tutorial, API overview documentation, tutorials, and guides.
If you intend to store sensitive information in an IBM® Cloudant® for IBM Cloud® database you must use client-side encryption to render data unreadable to Cloudant operators. For example for PCI DSS compliance you must encrypt the Primary Account Number (PAN) before sending a document containing it to the database.
This documentation describes the SDKs and examples. To see usage information and examples in your preferred SDK, select the language tab in the right pane.
This documentation describes the Java SDK and examples. To see usage information and examples in your preferred SDK, select the language tab in the right pane.
This documentation describes the Node SDK and examples. To see usage information and examples in your preferred SDK, select the language tab in the right pane.
This documentation describes the Python SDK and examples. To see usage information and examples in your preferred SDK, select the language tab in the right pane.
This documentation describes the Go SDK and examples. To see usage information and examples in your preferred SDK, select the language tab in the right pane.
The code examples on this tab use the IBM Cloudant SDK for Java&trade.
Gradle
implementation 'com.ibm.cloud:cloudant:0.+'
Maven
GitHub
The code examples on this tab use the IBM Cloudant SDK for Node.js.
Installation
npm install --save @ibm-cloud/cloudant
GitHub
The code examples on this tab use the IBM Cloudant SDK for Python.
Installation
pip3 install ibmcloudant
GitHub
The code examples on this tab use the IBM Cloudant SDK for Go.
Installation
go get -u github.com/IBM/cloudant-go-sdk/cloudantv1
GitHub
Endpoint URLs
The IBM Cloudant API uses an instance-specific endpoint URL for all regions. You can find your external endpoint by following these steps:
- Go to the IBM Cloud dashboard and open an instance.
- Click the Service credentials tab.
- Click the chevron next to the service credentials to open the credentials pane.
- Copy the value from the
host
field and prefix it with thehttps://
protocol. This value is the external endpoint.
For more information, see the Locating your service credentials tutorial.
Or you can copy your external endpoint by following these steps:
- Go to the IBM Cloud dashboard and open an instance.
- Under the Manage tab on the Overview page, see the External endpoint in the table.
- Click Copy to copy the External endpoint. Paste the endpoint where you need your credentials.
A public endpoint looks something like these examples:
https://5lll032-dd12-536e-09b3-432fg9f07e78-bluemix.cloudantnosqldb.appdomain.cloud
or
https://5lll032-dd12-536e-09b3-432fg9f07e78-bluemix.cloudant.com
A private endpoint is one that is only accessible through a non-public network, like IBM's internal network. Private endpoints are available to customers who have the Dedicated Hardware plan.
Authentication
You can access IBM Cloudant with IBM Cloud® Identity and Access Management (IAM) or IBM Cloudant legacy access controls. The choice between Use only IAM and Use both legacy credentials and IAM access control affects how credentials are delivered to your application when you bind and generate service credentials.
The Use only IAM option is preferred. Review Must I use Use only IAM or Use both legacy credentials and IAM? to help with making a decision.
IAM authentication
Access to IBM Cloudant is centrally controlled by IBM Cloud® Identity and Access Management (IAM), which provides a unified approach to managing user identities, and access control across your IBM Cloud® services and applications using the same set of credentials.
To work with the API, authenticate your application or service by including your IBM Cloud® IAM access token in API requests.
Cloudant legacy authentication
Legacy access controls are unique to IBM Cloudant, which means that accessing each service instance requires its own set of credentials. These credentials can be used with HTTP basic and cookie authentication. IBM Cloudant legacy API keys authenticate identically to username and password credentials but are generated and assigned differently. For more information, see the documentation about IBM Cloudant legacy API keys.
Additional authentication resources
- IBM Cloudant client libraries provide full integration with IAM's access controls and automatically retrieve an IAM access token when an appropriate IAM configuration is provided (for example, an IAM API key or IAM profile ID).
- View IBM Cloudant authentication documentation.
Cookie
Valid only for IBM Cloudant legacy authentication (including legacy IBM Cloudant API keys).
Login session cookies can be created via the POST /_session
endpoint and
returned in the standard Set-Cookie
header. This AuthSession
cookie can
be stored and returned to the server in the Cookie
header on subsequent requests.
This process is handled automatically by IBM Cloudant's SDKs and other cookie aware
HTTP clients like browsers.
- API Key
- Cookie
- AuthSession
IAM
Valid only for Cloud Identity and Access Management authentication.
Authenticates with a Authorization: Bearer {access_token}
header where access_token
is
calculated from an appropriate IAM configuration (for example from
an IAM API key, or IAM profile ID).
This process is handled automatically by IBM Cloudant's SDKs.
- HTTP
- JWT
- Bearer
Authentication with external configuration
In this scenario, the configuration is defined with an external credentials file and an authenticator that is constructed by SDK's authenticator factory during client initialization. Using the external credentials file avoids hardcoded credentials within the application code.
The default name of the credentials file is ibm-credentials.env
. It is expected to be located in either the current directory or in the user's home directory. The path and name of the file can be controlled by using the IBM_CREDENTIALS_FILE
environment variable.
Cloudant configuration properties start with a chosen
service name prefix that identifies your service.
By default it is CLOUDANT
.
If you would like to rename your Cloudant service from CLOUDANT
, or
use multiple services at the same time you must use your defined
service name as the prefix for all of your Cloudant related configuration properties.
You also must use the same service name at instantiating your service.
This way each configuration property contains the service name along with
the actual attribute name in the form <service-name>_<attribute-name>
(for example CLOUDANT_APIKEY
).
It is not necessary to use a .env file. These properties can be set by using environment variables with the same name in the environment where the application is run.
Variable guide for the authentication code samples
Attribute name | Description |
---|---|
{apikey} |
IAM API key |
{username} |
Cloudant username |
{password} |
Cloudant password |
{url} |
URL of Cloudant instance |
{service-name} |
Chosen service name of your Cloudant instance. Same as the prefix of your configuration properties. Default value is CLOUDANT . |
SDK managing the IAM token. Replace {apikey} and {url}.
{service-name}_URL={url}
{service-name}_APIKEY={apikey}
import com.ibm.cloud.cloudant.v1.Cloudant;
Cloudant service = Cloudant.newInstance("{service-name}");
import { CloudantV1 } from '@ibm-cloud/cloudant';
const service = CloudantV1.newInstance({
serviceName: '{service-name}'
});
from ibmcloudant.cloudant_v1 import CloudantV1
service = CloudantV1.new_instance(service_name="{service-name}")
import (
"github.com/IBM/cloudant-go-sdk/cloudantv1"
)
service, err := cloudantv1.NewCloudantV1UsingExternalConfig(
&cloudantv1.CloudantV1Options{
ServiceName: "{service-name}",
},
)
SDK managing session cookie.
{service-name}_AUTH_TYPE=COUCHDB_SESSION
{service-name}_URL={url}
{service-name}_USERNAME={username}
{service-name}_PASSWORD={password}
import com.ibm.cloud.cloudant.v1.Cloudant;
Cloudant service = Cloudant.newInstance("{service-name}");
import { CloudantV1 } from '@ibm-cloud/cloudant';
const service = CloudantV1.newInstance({
serviceName: '{service-name}'
});
from ibmcloudant.cloudant_v1 import CloudantV1
service = CloudantV1.new_instance(service_name="{service-name}")
import (
"github.com/IBM/cloudant-go-sdk/cloudantv1"
)
service, err := cloudantv1.NewCloudantV1UsingExternalConfig(
&cloudantv1.CloudantV1Options{
ServiceName: "{service-name}",
},
)
Basic authentication.
{service-name}_AUTH_TYPE=BASIC
{service-name}_URL={url}
{service-name}_USERNAME={username}
{service-name}_PASSWORD={password}
import com.ibm.cloud.cloudant.v1.Cloudant;
Cloudant service = Cloudant.newInstance("{service-name}");
import { CloudantV1 } from '@ibm-cloud/cloudant';
const service = CloudantV1.newInstance({
serviceName: '{service-name}'
});
from ibmcloudant.cloudant_v1 import CloudantV1
service = CloudantV1.new_instance(service_name="{service-name}")
import (
"github.com/IBM/cloudant-go-sdk/cloudantv1"
)
service, err := cloudantv1.NewCloudantV1UsingExternalConfig(
&cloudantv1.CloudantV1Options{
ServiceName: "{service-name}",
},
)
Programmatic authentication
In this scenario, authentication is configured by constructing an authenticator instance, supplying the configuration attributes programmatically, and then passing this instance to a client constructor.
If you are using the IBM Cloud App Service, IBM Cloud® Continuous Delivery or IBM Cloud starter kits then you can programmatically configure your SDK using the IBMCloudEnv
tool to obtain the configuration information from bound services. The IBMCloudEnv
tool is available for Go, Java&trade (Spring), Node.js, and Python.
SDK managing the IAM token.
import com.ibm.cloud.cloudant.v1.Cloudant;
import com.ibm.cloud.sdk.core.security.IamAuthenticator;
IamAuthenticator authenticator = new IamAuthenticator.Builder()
.apikey("{apikey}")
.build();
Cloudant service = new Cloudant(Cloudant.DEFAULT_SERVICE_NAME, authenticator);
service.setServiceUrl("{url}");
import { CloudantV1 } from '@ibm-cloud/cloudant';
import { IamAuthenticator } from 'ibm-cloud-sdk-core';
const authenticator = new IamAuthenticator({
apikey: '{apikey}'
});
const service = new CloudantV1({
authenticator: authenticator
});
service.setServiceUrl('{url}');
from ibmcloudant.cloudant_v1 import CloudantV1
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
authenticator = IAMAuthenticator('{apikey}')
service = CloudantV1(authenticator=authenticator)
service.set_service_url('{url}')
import (
"github.com/IBM/cloudant-go-sdk/cloudantv1"
"github.com/IBM/go-sdk-core/core"
)
authenticator := &core.IamAuthenticator{
ApiKey: "{apikey}",
}
service, err := cloudantv1.NewCloudantV1(
&cloudantv1.CloudantV1Options{
URL: "{url}",
Authenticator: authenticator,
},
)
if err != nil {
panic(err)
}
SDK managing session cookie.
import com.ibm.cloud.cloudant.v1.Cloudant;
import com.ibm.cloud.sdk.core.security.Authenticator;
import com.ibm.cloud.cloudant.security.CouchDbSessionAuthenticator;
Authenticator authenticator = CouchDbSessionAuthenticator.newAuthenticator("{username}", "{password}");
Cloudant service = new Cloudant(Cloudant.DEFAULT_SERVICE_NAME, authenticator);
service.setServiceUrl("{url}");
import { CloudantV1, CouchdbSessionAuthenticator } from '@ibm-cloud/cloudant';
const authenticator = new CouchdbSessionAuthenticator({
username: '{username}',
password: '{password}'
});
const service = new CloudantV1({
authenticator: authenticator
});
service.setServiceUrl('{url}');
from ibmcloudant.cloudant_v1 import CloudantV1
from ibmcloudant import CouchDbSessionAuthenticator
authenticator = CouchDbSessionAuthenticator('{username}', '{password}')
service = CloudantV1(authenticator=authenticator)
service.set_service_url('{url}')
import (
"github.com/IBM/cloudant-go-sdk/cloudantv1"
"github.com/IBM/cloudant-go-sdk/auth"
)
authenticator, err := auth.NewCouchDbSessionAuthenticator(
"{username}",
"{password}",
)
if err != nil {
panic(err)
}
service, err := cloudantv1.NewCloudantV1(
&cloudantv1.CloudantV1Options{
URL: "{url}",
Authenticator: authenticator,
},
)
if err != nil {
panic(err)
}
Basic authentication.
import com.ibm.cloud.cloudant.v1.Cloudant;
import com.ibm.cloud.sdk.core.security.BasicAuthenticator;
BasicAuthenticator authenticator = new BasicAuthenticator.Builder()
.username("{username}")
.password("{password}")
.build();
Cloudant service = new Cloudant(Cloudant.DEFAULT_SERVICE_NAME, authenticator);
service.setServiceUrl("{url}");
import { CloudantV1 } from '@ibm-cloud/cloudant';
import { BasicAuthenticator } from 'ibm-cloud-sdk-core';
const authenticator = new BasicAuthenticator({
username: '{username}',
password: '{password}'
});
const service = new CloudantV1({
authenticator: authenticator
});
service.setServiceUrl('{url}');
from ibmcloudant.cloudant_v1 import CloudantV1
from ibm_cloud_sdk_core.authenticators import BasicAuthenticator
authenticator = BasicAuthenticator('{username}', '{password}')
service = CloudantV1(authenticator=authenticator)
service.set_service_url('{url}')
import (
"github.com/IBM/cloudant-go-sdk/cloudantv1"
"github.com/IBM/go-sdk-core/core"
)
authenticator, err := core.NewBasicAuthenticator(
"{username}",
"{password}",
)
if err != nil {
panic(err)
}
service, err := cloudantv1.NewCloudantV1(
&cloudantv1.CloudantV1Options{
URL: "{url}",
Authenticator: authenticator,
},
)
if err != nil {
panic(err)
}
Error handling
IBM Cloudant operation uses standard HTTP response codes to indicate the status of the requested method. HTTP response codes in the 2xx range indicate success. A 4xx range indicates a failure, and a 5xx range usually indicates an internal system error. More detailed information can be found in the body of the response.
List of HTTP codes
HTTP Code | Meaning |
---|---|
200 - OK |
Request completed successfully. |
201 - Created |
Resource that is created or updated successfully. The resource could be a database or a document, for example. |
202 - Accepted |
Request was accepted, but the quorum for the operation was not met. |
206 - Partial Content |
Request was successful and the body contains the ranges of data, as described in the Range header of the request. |
304 - Not Modified |
The content that is requested was not modified. This error is used with the ETag system to identify the version of information returned. |
400 - Bad Request |
Bad request structure. The error can indicate an error with the request URL, path, or headers. Differences in the supplied MD5 hash and content also trigger this error, as this error might indicate message corruption. |
401 - Unauthorized |
The item requested was not available with the supplied authorization, or authorization was not supplied. |
402 - Payment required |
Either the data quota on the Lite plan was exceeded, or the account is in arrears. You can delete data or upgrade to the Standard plan, or bring the account up to date. |
403 - Forbidden |
The requested item or operation is forbidden. |
404 - Not Found |
The requested resource could not be found. The content includes further information as a JSON object, if available. The structure contains two keys, error and reason , similar to the following example: { "error":"not_found", "reason":"no_db_file" } |
405 - Resource Not Allowed |
A request was made by using an invalid HTTP request type for the URL requested. For example, you requested a PUT when a POST is expected. Errors of this type can also be triggered by invalid URL strings. |
406 - Not Acceptable |
The requested content type is not supported by the server. |
408 - Request Timeout |
Timeout during reading client request. |
410 - Gone |
The requested resource is no longer available. |
409 - Conflict |
Request resulted in an update conflict. The two most common causes are: 1. Trying to update or delete a document without providing a revision. 2. The latest revision of the document on the server changed in between a fetch and an update. |
412 - Precondition Failed |
The request headers from the client and the capabilities of the server do not match. Alternatively, a request to create a database was denied because the database exists. |
413 - Request Entity Too Large |
The request size exceeded the limit for the IBM Cloudant API. |
415 - Bad Content Type |
The content types supported and the content type of the information that was requested or submitted. The error indicates that the content type is not supported. |
416 - Requested Range Not Satisfiable |
The range that is specified in the request header cannot be satisfied by the server. |
429 - Too Many Requests |
The user sent too many requests in a specific amount of time. More information is available in the corresponding RFC 6585. |
500 - Internal Server Error |
The request could not be completed by the server. It could be due to an internal error or in some cases invalid data in the request. Alternatively, a replication was canceled while in progress. |
502 - Bad Gateway |
The server while acting as a gateway or proxy, received an invalid response from the upstream server. |
503 - Service Unavailable |
The request could not be processed. Seeing this response might indicate a misspelled IBM Cloudant account name. |
504 - Gateway Timeout |
Timeout when the server is acting as a gateway and cannot get a response in time. |
Error response
Name | Description |
---|---|
error string |
the error message returned in the response |
reason string |
a more detailed description about the cause of the failure |
caused_by (optional) string |
the cause of the error |
Error Responses specific to /_api/v2/
endpoints
Name | Description |
---|---|
code integer |
HTTP error code |
error string |
a more detailed description about the cause of the failure |
Name | Description |
---|---|
message string |
detailed description about the cause of the failure |
Error Response
{
"error":"bad_request",
"reason":"invalid UTF-8 JSON"
}
Error Responses specific to /_api/v2/
endpoints
{
"code": 404,
"error": "Could not find Cloudant user"
}
{
"message": "The method is not allowed for the requested URL."
}
Code example
If an error response is received from the server endpoint, the Go SDK will create an error
object that contains either the HTTP response error message or a generic error message.
An additional detailedResponse
will be returned by the service
that will contain the following fields:
Field | Description |
---|---|
StatusCode | HTTP response status code |
Result | JSON error response object unmarshalled as map[string]interface{} |
RawResult | raw non-JSON error response object as []byte |
Example error handling
_, detailedResponse, err := // Invoke a Cloudant method request
if err != nil {
if (detailedResponse != nil) {
fmt.Println("Error status code: ", detailedResponse.StatusCode)
fmt.Println("Error message: ", err.Error())
errorMap, ok := detailedResponse.GetResultAsMap(); if ok {
fmt.Println("Reason: ", errorMap["reason"])
}
} else {
// Handle other error conditions
fmt.Println("Error message: ", err.Error())
}
}
Code example
If an error response is received from the server endpoint, the Java&trade SDK will throw
an exception from the com.ibm.cloud.sdk.core.service.exception
package.
The base class for all exception classes is ServiceResponseException
- that derives
from RuntimeException
- to handle any error response from the server.
Here is a list about predefined exceptions and
their corresponding statusCode
and message
content.
Exception | Status Code and default error message |
---|---|
ServiceResponseException | Base class for all exceptions |
BadRequestException | 400 Bad Request |
UnauthorizedException | 401 Unauthorized |
ForbiddenException | 403 Forbidden |
NotFoundException | 404 Not found |
ConflictException | 409 Conflict |
UnsupportedException | 415 Unsupported media type |
InternalServerErrorException | 500 Internal server error |
IllegalArgumentException | An invalid argument was passed to the method. |
All service exceptions contain the following fields:
Field | Description |
---|---|
statusCode | HTTP response status code |
message | the error message returned in the response |
debuggingInfo | a Map<String, Object> which contains the unmarshalled error response object if a JSON error response is returned.This will provide more information beyond the error message. |
Example error handling
import com.ibm.cloud.sdk.core.service.exception.BadRequestException;
import com.ibm.cloud.sdk.core.service.exception.NotFoundException;
import com.ibm.cloud.sdk.core.service.exception.ServiceResponseException;
import com.ibm.cloud.sdk.core.service.exception.UnauthorizedException;
import com.ibm.cloud.sdk.core.service.exception.IllegalArgumentException;
try {
// Invoke a Cloudant method request
} catch (BadRequestException e) {
// Handle Bad Request (400) exception
} catch (UnauthorizedException e) {
// Handle Unauthorized (401) exception
} catch (NotFoundException e) {
// Handle Not Found (404) exception
} catch (ServiceResponseException se) {
System.out.println("Service returned status code "
+ se.getStatusCode() + ": " + se.getMessage());
System.out.println("Detailed error info: " + se.getDebuggingInfo().getOrDefault("reason", "")););
} catch (RuntimeException re) {
// Handle other error conditions
System.out.println("Unexpected Exception:\n" + re.getMessage());
} catch (IllegalArgumentException iae) {
// Handle invalid argument value
System.out.println("Invalid argument value:\n" + iae.getMessage());
}
Code example
If an error response is received from the server endpoint, the Node SDK will create
an Error
object that contains either the HTTP response error message or a generic error message.
In case of network problems the axios
package will generate an Error
object.
This Error
object is passed as the first parameter to the callback function,
its failure describing content is as shown in the following table.
Field | Description |
---|---|
status | HTTP response status code |
statusText | a text description of the status code |
message | generic error message |
result | error JSON response body as an object |
Example error handling
service.CloudantMethod(params)
.then((response) => {
// ...handle successful response...
})
.catch(error => {
if (error.code !== undefined && error.code === "ERR_INVALID_ARG_VALUE") {
// The request was not sent, so there is no error status code, text and body
console.log("Invalid argument value: \n" + error.message);
} else {
console.log(`Error status code: ${error.status}`);
console.log(`Error status text: ${error.statusText}`);
console.log(`Error message: ${error.message}`);
console.log(`Cloudant error: ${error.result.error}`);
console.log(`Cloudant error reason: ${error.result.reason}`);
}
});
Code example
If an error response is received from the server endpoint, the Python SDK
will throw an ApiException
that includes more information about the cause
of the failure. It provides the following details:
Field | Description |
---|---|
status_code | HTTP response status code |
message | the error message returned in the response |
reason | a more detailed description about the cause of the failure |
Example error handling
from ibm_cloud_sdk_core import ApiException
try:
# Invoke a Cloudant method request
except ApiException as ae:
print("Method failed")
print(" - status code: " + str(ae.status_code))
print(" - error message: " + ae.message)
if ("reason" in ae.http_response.json()):
print(" - reason: " + ae.http_response.json()["reason"])
Other errors
HTTP API requests may also not complete successfully due to error conditions in the network. This condition will cause IBM Cloudant request to fail.
An example would be an HTTP request timeout. In this case the request returns detailedResponse
with only
StatusCode
- Result
and RawResult
elements will be nil
.
Argument validation prevents invalid values and stops the request from being sent.
This results in Result
and RawResult
objects being nil
, and a returned
error message with no status code or reason.
In all other cases, detailedResponse
will be nil
because it is returned only by
IBM Cloudant Service.
In this case, an IOException
will be thrown and will be wrapped in a RuntimeException
.
Argument validation prevents invalid values and stops the request from being sent.
Invalid argument values raise an IllegalArgumentException
exception.
In this case, the status
will be undefined
and body
content will
be non-JSON formatted error description.
Argument validation prevents invalid values and stops the request from being sent.
Invalid argument values raise an Error
object containing a code
field with
the value ERR_INVALID_ARG_VALUE
.
In this case, the requests
package will raise specific exceptions for these problems.
Argument validation prevents invalid values and stops the request from being sent.
Invalid argument values raise an ValueError
exception.
from requests import ConnectionError, ReadTimeout, RequestException, ValueError
try:
# Invoke a Cloudant method request
except ConnectionError as cerr:
print("Connection error occurred:")
print(cerr)
except ReadTimeout as rt:
# The server did not send any data in the allotted amount of time.
print("Read timed out:")
print(rt)
except RequestException as re:
# Handle other request failures
print("Request Exception:")
print(re)
except ValueError as ve:
print("Invalid argument value:\n" + ve.message)
Auditing
You can monitor API activity within your account by using the IBM Cloud® Activity Tracker service. An event is generated for most of the API endpoints when they are called, and you can then track and audit from within Activity Tracker. The specific event type is listed for each individual method. For methods that don't list any events, no events are generated.
For more information about how to track IBM Cloudant activity, see Audit logging.
Additional headers
Because IBM Cloudant uses HTTP for all external communication, you need to ensure that the correct HTTP request headers are supplied and processed on retrieval. This course of action ensures that you get the correct format and encoding. Different environments and clients are more or less strict on the effect of these HTTP headers, especially when they are not present. To reduce the likelihood of problems or unexpected behavior, you must be as specific as possible.
Request headers
The supported HTTP request headers are shown in the following list:
Accept
Content-Type
Content-Encoding
If-None-Match
Range
Accept
The Accept
header specifies the list of potential data types that are returned by the server that would be
accepted and understood by the client.
The format is a list of one or more MIME types,
which are separated by colons.
For the most requests,
the accepted list must include JSON data (application/json
).
For attachments,
you can either specify the MIME type explicitly,
or use */*
to specify that all file types are supported.
If the Accept
header is not supplied,
then the server assumes the */*
MIME type,
which means that the client accepts all formats.
See the following example of sending a request without an explicit Accept
header, or when you specify */*
:
GET /recipes HTTP/1.1
Host: username.cloudant.com
Accept: */*
See the following example of a returned header when the client is assumed to accept all formats:
The returned content type is text/plain
even though the information that is returned by the request is in JSON format.
Server: CouchDB/1.0.2 (Erlang OTP/R14B)
Date: Thu, 13 Jan 2011 13:39:34 GMT
Content-Type: text/plain;charset=utf-8
Content-Length: #7
Cache-Control: must-revalidate
The use of Accept
in queries to IBM Cloudant is not required,
but is highly recommended as it helps to ensure that the data returned can be processed by the client.
If you specify a data type that uses the Accept
header,
IBM Cloudant honors the specified type in the Content-type
header field of responses.
For example,
if you explicitly request application/json
in the Accept
of a request,
the returned HTTP headers use this value in the returned Content-type
field.
See the following example request that explicitly specifies the Accept
header:
GET /recipes HTTP/1.1
Host: username.cloudant.com
Accept: application/json
See the following example of the headers returned in response, including the application/json
content type:
Server: CouchDB/1.0.2 (Erlang OTP/R14B)
Date: Thu, 13 Jan 2011 13:40:11 GMT
Content-Type: application/json
Content-Length: #7
Cache-Control: must-revalidate
Content-Type for request headers
The Content-Type
header specifies the content type of the information that is supplied within the request.
The specification uses MIME type specifications.
For most requests,
the content type is JSON (application/json
).
For some settings, the MIME type is plain text.
In particular,
when you upload attachments the type must be the corresponding
MIME type for the attachment or binary (application/octet-stream
).
The use of the Content-Type
on a request is highly recommended.
Content-Encoding
The Content-Encoding
header specifies the encoding of the request body.
The supported value is gzip
.
If the header is used,
the request body must be encoded with the corresponding format.
See the following example of creating a compressed (gzipped
) request body:
# create gzipped document
echo '{"foo":"bar"}' | gzip > doc.gzip
See the following example of sending a gzip-encoded request body to create a document by using HTTP:
PUT /db/doc HTTP/1.1
HOST: $ACCOUNT.cloudant.com
Content-Encoding: gzip
See the following example of sending a gzip-encoded request body to create a document by using the command line:
curl "https://$ACCOUNT.cloudant.com/db/doc" \
-X PUT \
-T doc.gzip \
-H "Content-Encoding: gzip"
Range
The Range
header specifies the parts of an attachment that the server should return. Several parts can be requested at the same time in one Range
header, and the server may send back these ranges in a multipart document. If the server sends back ranges, it uses the status line 206 Partial Content
for the response.
If-None-Match
The If-None-Match
header is optional.
You might send it to determine whether a document was modified since it was last read or updated.
The value of the If-None-Match
header must match the last Etag
value received.
If the value matches the current revision of the document,
the server sends a 304 Not Modified
status code,
and the response itself has no body.
If the document was modified,
you get a normal 200
response,
provided the document still exists and no other errors occurred.
Response headers
Response headers are returned by the server when you send back content. They include a number of different fields. Many of the fields are standard HTTP response headers and have no significance regarding how IBM Cloudant operates. The supported HTTP response headers that are important to IBM Cloudant are as shown in the following list.
Cache-Control
Content-Length
Content-Range
Content-Type
Etag
Via
X-Content-Type-Options
X-Couch-Request-ID
X-Cloudant-Action
X-Cloudant-Backend
X-Cloudant-Request-Class
X-Frame-Options
The IBM Cloudant design document API and its functions return HTML (for example as part of a show or list). After which, you can include custom HTTP headers through the headers
field of the return object.
Cache-Control
The Cache-Control
HTTP response header provides a suggestion for the client cache mechanisms
on how to treat the returned information.
IBM Cloudant typically returns the must-revalidate
value,
which indicates that the information must be revalidated if possible.
Revalidation ensures that the dynamic nature of the content is correctly updated.
Content-Length
The Content-Length
header reports the length in bytes of the returned content.
Content-Type for response headers
The Content-Type
header specifies the MIME type of the returned data.
For most request,
the returned MIME type is text/plain
.
All text is encoded in Unicode (UTF-8),
which is explicitly stated in the returned Content-Type
as text/plain;charset=utf-8
.
Content-Range
The Content-Range
header specifies where in the full document's attachment a partial content belongs.
The value is in the form of bytes <range>/<total content length>
.
The Range
request header is required to specify the partial content to be returned.
Etag
The Etag
header is used to show the revision for a document,
or the response from a show function.
For documents,
the value is identical to the revision of the document.
The value can be used with an If-None-Match
request header
to get a 304 Not Modified
response if the revision is still current.
ETags cannot currently be used with views or lists, since the ETags returned from those requests are random numbers that change on every request.
Via
A name of an individual reverse proxy server that processed the request.
X-Content-Type-Options
The X-Content-Type-Options
response HTTP header is a marker
used by the server to indicate that the MIME types advertised
in the Content-Type
headers should be followed and not be changed.
This is a security feature to block content sniffing that could transform
non-executable MIME types into executable MIME types.
By default Cloudant returns X-Content-Type-Options: nosniff
that blocks
a request if the request destination is of type style and the MIME type
is not text/css
, or of type script and the MIME type is not
a JavaScript MIME type.
X-Couch-Request-ID
A unique identifier for the request.
X-Cloudant-Action
An auditing event's action name generated for the request.
X-Cloudant-Backend
A name of an individual backend server that processed the request.
X-Cloudant-Request-Class
A request class assigned to the request that count towards the instance's throughput capacity's budget.
X-Frame-Options
The X-Frame-Options
is a response header that controls whether
an HTTP response can be embedded in a <frame>
, <iframe>
or <object>
.
This is a security feature to help against clickjacking.
Cloudant returns X-Frame-Options: DENY
by default.
Paging on all documents and on views
The following endpoints have the limit
and skip
parameters which allow you to define how many documents you would
like to see on a page, and the offset into the range you want to start the page from, but this pattern gets
progressively slower the larger the value of skip
gets.
There are a couple of options which are more efficient than using the limit
/skip
pattern:
either fetch one extra document, and use this document's id
as the startKey
of your request for the next page of results ("fetch one document too many"); or append \u0000
to the startKey
, using the last id
of the last document from your previous page of results ("the \u0000
trick").
The following endpoints have the Limit
and Skip
parameters which allow you to define how many documents you would
like to see on a page, and the offset into the range you want to start the page from, but this pattern gets
progressively slower the larger the value of Skip
gets.
There are a couple of options which are more efficient than using the Limit
/Skip
pattern:
either fetch one extra document, and use this document's ID
as the StartKey
of your request for the next page of results ("fetch one document too many"); or append \u0000
to the StartKey
, using the last ID
of the last document from your previous page of results ("the \u0000
trick").
- GET /{db}/_all_docs
- POST /{db}/_all_docs
- GET /{db}/_partition/{partition_key}/_all_docs
- POST /{db}/_partition/{partition_key}/_all_docs
- GET /{db}/_design/{ddoc}/_view/{view}
- POST /{db}/_design/{ddoc}/_view/{view}
- GET /{db}/_partition/{partition_key}/_design/{ddoc}/_view/{view}
- POST /{db}/_partition/{partition_key}/_design/{ddoc}/_view/{view}
You can find examples and more explanation for both tricks in the Cloudant docs:
We recommend to use "the \u0000 trick" over "fetch one document too many".
Paging with bookmarks
The following endpoints use bookmarks as the key to access the next page of results from the result set. If you want to learn about the usage of bookmarks we recommend reading how IBM Cloudant bookmarks work.
Rate limiting
Rate limits for API requests are enforced on a per-service-instance basis. If the number of requests for a particular request class (read
, write
or global query
) reaches the limit within the given time window, no further requests of that class are accepted until the next time window.
You can view your usage by using the Retrieve the current provisioned throughput capacity consumption API or the IBM Cloudant dashboard. IBM Cloudant does return an x-cloudant-request-class
response header related to limiting.
x-cloudant-request-class
response header returns the following request classes: read
, write
, global query
, or unlimited
.
If you want to learn more about these request classes, see the Request classes documentation.
A 429
HTTP status code indicates that the rate limit has been exceeded.
The number of allowed requests varies by request class. The reference information for each endpoint and method specifies the request class that applies to the request. The rate limit for each request class is determined by the account plan.
Related APIs
Most requests and responses to and from IBM® Cloudant® for IBM Cloud® use JavaScript Object Notation (JSON) for formatting the content and structure of the data and responses.
In IBM Cloudant databases, the JSON object is used to represent various structures, including all documents in a database.
Parsing JSON into a JavaScript object is supported through the JSON.parse()
function in JavaScript, or through various libraries that perform the parsing of the content into a JavaScript object for you. Libraries for parsing and generating JSON are available for many major programming languages.
JSON is used because it's the simplest and easiest solution for working with data that uses a web browser. As a result, JSON structures can be evaluated and used as JavaScript objects within the web browser environment. JSON also integrates with the server-side JavaScript used within IBM Cloudant. JSON documents are always UTF-8 encoded.
Be careful to follow these guidelines:
- Your JSON structures are valid.
- You normalize strings in JSON documents retrieved from IBM Cloudant.
JSON supports the same basic types that are supported by JavaScript: numbers, strings, Booleans, arrays, and objects.
Objects
A set of key-value
pairs,
such as an associative array,
or a hash.
The key must be a string,
but the value can be any of the supported JSON values.
Example of a JSON object
{
"servings" : 4,
"subtitle" : "Easy to make in advance, and then cook when ready",
"cooktime" : 60,
"title" : "Chicken Coriander"
}
Logging
A basic logging facility is provided by the Go core library with levels Error, Info, Warn, and Debug. If Debug level is enabled, it displays HTTP request and response messages and retry attempts.
The Go core library also defines a Logger
interface, where you can supply your own logging implementation. For example, you can direct the log messages to a file instead of the console.
The logging detail level can be configured by using the HttpConfigOptions
class.
The SDK is using debug package for logging. In order to see the log output, set the environment variable DEBUG
including the wanted log level.
To enable logging, import the logging package and then setting the log level to DEBUG.
// Enable Debug logging
core.SetLoggingLevel(core.LevelDebug)
HttpConfigOptions options =
new HttpConfigOptions.Builder()
.loggingLevel(HttpConfigOptions.LoggingLevel.BASIC)
.build();
service.configureClient(options);
DEBUG=ibm-cloud-sdk-core:error // enables error logs
DEBUG=ibm-cloud-sdk-core:warning // enables warning logs and below
DEBUG=ibm-cloud-sdk-core:info // enables info logs and below
DEBUG=ibm-cloud-sdk-core:verbose // enables verbose logs and below
DEBUG=ibm-cloud-sdk-core:debug // enables debug logs and below
import logging
logging.basicConfig(level=logging.DEBUG)
Methods
Retrieve server instance information
When you access the root of an instance, IBM Cloudant returns meta-information about the instance. The response includes a JSON structure that contains information about the server, including a welcome message and the server's version.
Tip: The authentication for this endpoint is only enforced when using IAM.
When you access the root of an instance, IBM Cloudant returns meta-information about the instance. The response includes a JSON structure that contains information about the server, including a welcome message and the server's version.
Tip: The authentication for this endpoint is only enforced when using IAM.
When you access the root of an instance, IBM Cloudant returns meta-information about the instance. The response includes a JSON structure that contains information about the server, including a welcome message and the server's version.
Tip: The authentication for this endpoint is only enforced when using IAM.
When you access the root of an instance, IBM Cloudant returns meta-information about the instance. The response includes a JSON structure that contains information about the server, including a welcome message and the server's version.
Tip: The authentication for this endpoint is only enforced when using IAM.
When you access the root of an instance, IBM Cloudant returns meta-information about the instance. The response includes a JSON structure that contains information about the server, including a welcome message and the server's version.
Tip: The authentication for this endpoint is only enforced when using IAM.
GET /
(cloudant *CloudantV1) GetServerInformation(getServerInformationOptions *GetServerInformationOptions) (result *ServerInformation, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) GetServerInformationWithContext(ctx context.Context, getServerInformationOptions *GetServerInformationOptions) (result *ServerInformation, response *core.DetailedResponse, err error)
ServiceCall<ServerInformation> getServerInformation()
getServerInformation(params)
get_server_information(
self,
**kwargs,
) -> DetailedResponse
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
No Request Parameters
No Request Parameters
No Request Parameters
No Request Parameters
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } getServerInformationOptions := service.NewGetServerInformationOptions() serverInformation, response, err := service.GetServerInformation(getServerInformationOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(serverInformation, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.ServerInformation;
Cloudant service = Cloudant.newInstance(); ServerInformation response = service.getServerInformation().execute().getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.getServerInformation().then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.get_server_information().get_result() print(response)
Response
Schema for information about the server instance.
Welcome message.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
List of enabled optional features.
Possible values: 0 ≤ number of items ≤ 4294967295, 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
List of feature flags.
Possible values: 1 ≤ number of items ≤ 4294967295, 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Schema for server vendor information.
- vendor
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Apache CouchDB version.
Possible values: 5 ≤ length ≤ 7168, Value must match regular expression
^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$
Schema for information about the server instance.
Welcome message.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
List of enabled optional features.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
List of feature flags.
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for server vendor information.
- Vendor
Vendor name.
Possible values: length = 12, Value must match regular expression
/^IBM Cloudant$/
Vendor variant.
Possible values: [
paas
]Vendor version.
Possible values: 1 ≤ length ≤ 9, Value must match regular expression
/^\\d+$/
Apache CouchDB version.
Possible values: 5 ≤ length ≤ 7168, Value must match regular expression
/^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-([0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?(?:\\+[0-9A-Za-z-]+)?$/
Schema for information about the server instance.
Welcome message.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
List of enabled optional features.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
List of feature flags.
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for server vendor information.
- vendor
Vendor name.
Possible values: length = 12, Value must match regular expression
/^IBM Cloudant$/
Vendor variant.
Possible values: [
paas
]Vendor version.
Possible values: 1 ≤ length ≤ 9, Value must match regular expression
/^\\d+$/
Apache CouchDB version.
Possible values: 5 ≤ length ≤ 7168, Value must match regular expression
/^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-([0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?(?:\\+[0-9A-Za-z-]+)?$/
Schema for information about the server instance.
Welcome message.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
List of enabled optional features.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
List of feature flags.
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for server vendor information.
- vendor
Vendor name.
Possible values: length = 12, Value must match regular expression
/^IBM Cloudant$/
Vendor variant.
Possible values: [
paas
]Vendor version.
Possible values: 1 ≤ length ≤ 9, Value must match regular expression
/^\\d+$/
Apache CouchDB version.
Possible values: 5 ≤ length ≤ 7168, Value must match regular expression
/^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-([0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?(?:\\+[0-9A-Za-z-]+)?$/
Schema for information about the server instance.
Welcome message.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
List of enabled optional features.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
List of feature flags.
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for server vendor information.
- vendor
Vendor name.
Possible values: length = 12, Value must match regular expression
/^IBM Cloudant$/
Vendor variant.
Possible values: [
paas
]Vendor version.
Possible values: 1 ≤ length ≤ 9, Value must match regular expression
/^\\d+$/
Apache CouchDB version.
Possible values: 5 ≤ length ≤ 7168, Value must match regular expression
/^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-([0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?(?:\\+[0-9A-Za-z-]+)?$/
Status Code
HTTP response for
/
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example ServerInformation response.
{ "couchdb": "Welcome", "features": [ "access-ready", "iam", "partitioned", "pluggable-storage-engines", "scheduler" ], "features_flags": [ "partitioned" ], "vendor": { "name": "IBM Cloudant", "variant": "paas", "version": "8162" }, "version": "2.1.1" }
Example ServerInformation response.
{ "couchdb": "Welcome", "features": [ "access-ready", "iam", "partitioned", "pluggable-storage-engines", "scheduler" ], "features_flags": [ "partitioned" ], "vendor": { "name": "IBM Cloudant", "variant": "paas", "version": "8162" }, "version": "2.1.1" }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve the HTTP headers for a server instance
Retrieves the HTTP headers for a server instance.
HEAD /
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for
/
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Retrieve provisioned throughput capacity information
View the amount of provisioned throughput capacity that is allocated to an IBM Cloudant instance and what is the target provisioned throughput capacity.
View the amount of provisioned throughput capacity that is allocated to an IBM Cloudant instance and what is the target provisioned throughput capacity.
View the amount of provisioned throughput capacity that is allocated to an IBM Cloudant instance and what is the target provisioned throughput capacity.
View the amount of provisioned throughput capacity that is allocated to an IBM Cloudant instance and what is the target provisioned throughput capacity.
View the amount of provisioned throughput capacity that is allocated to an IBM Cloudant instance and what is the target provisioned throughput capacity.
GET /_api/v2/user/capacity/throughput
(cloudant *CloudantV1) GetCapacityThroughputInformation(getCapacityThroughputInformationOptions *GetCapacityThroughputInformationOptions) (result *CapacityThroughputInformation, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) GetCapacityThroughputInformationWithContext(ctx context.Context, getCapacityThroughputInformationOptions *GetCapacityThroughputInformationOptions) (result *CapacityThroughputInformation, response *core.DetailedResponse, err error)
ServiceCall<CapacityThroughputInformation> getCapacityThroughputInformation()
getCapacityThroughputInformation(params)
get_capacity_throughput_information(
self,
**kwargs,
) -> DetailedResponse
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
No Request Parameters
No Request Parameters
No Request Parameters
No Request Parameters
ibmcloud cloudant capacity
curl -H "Authorization: Bearer $API_BEARER_TOKEN" "$SERVICE_URL/_api/v2/user/capacity/throughput"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } getCapacityThroughputInformationOptions := service.NewGetCapacityThroughputInformationOptions() capacityThroughputInformation, response, err := service.GetCapacityThroughputInformation(getCapacityThroughputInformationOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(capacityThroughputInformation, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.CapacityThroughputInformation;
Cloudant service = Cloudant.newInstance(); CapacityThroughputInformation response = service.getCapacityThroughputInformation().execute().getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.getCapacityThroughputInformation().then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.get_capacity_throughput_information().get_result() print(response)
Response
Schema for information about the currently provisioned and target throughput capacity.
Detailed information about provisioned throughput capacity.
Detailed information about target throughput capacity.
Schema for information about the currently provisioned and target throughput capacity.
Detailed information about provisioned throughput capacity.
- Current
Schema for detailed information about throughput capacity with breakdown by specific throughput requests classes.
- Throughput
A number of blocks of throughput units. A block consists of 100 reads/sec, 50 writes/sec, and 5 global queries/sec of provisioned throughput capacity. Not available for some plans.
Possible values: 1 ≤ value ≤ 100
Provisioned global queries capacity in operations per second.
Possible values: 0 ≤ value ≤ 2500
Provisioned reads capacity in operations per second.
Possible values: 0 ≤ value ≤ 50000
Provisioned writes capacity in operations per second.
Possible values: 0 ≤ value ≤ 25000
Detailed information about target throughput capacity.
- Target
Schema for detailed information about throughput capacity with breakdown by specific throughput requests classes.
- Throughput
A number of blocks of throughput units. A block consists of 100 reads/sec, 50 writes/sec, and 5 global queries/sec of provisioned throughput capacity. Not available for some plans.
Possible values: 1 ≤ value ≤ 100
Provisioned global queries capacity in operations per second.
Possible values: 0 ≤ value ≤ 2500
Provisioned reads capacity in operations per second.
Possible values: 0 ≤ value ≤ 50000
Provisioned writes capacity in operations per second.
Possible values: 0 ≤ value ≤ 25000
Schema for information about the currently provisioned and target throughput capacity.
Detailed information about provisioned throughput capacity.
- current
Schema for detailed information about throughput capacity with breakdown by specific throughput requests classes.
- throughput
A number of blocks of throughput units. A block consists of 100 reads/sec, 50 writes/sec, and 5 global queries/sec of provisioned throughput capacity. Not available for some plans.
Possible values: 1 ≤ value ≤ 100
Provisioned global queries capacity in operations per second.
Possible values: 0 ≤ value ≤ 2500
Provisioned reads capacity in operations per second.
Possible values: 0 ≤ value ≤ 50000
Provisioned writes capacity in operations per second.
Possible values: 0 ≤ value ≤ 25000
Detailed information about target throughput capacity.
- target
Schema for detailed information about throughput capacity with breakdown by specific throughput requests classes.
- throughput
A number of blocks of throughput units. A block consists of 100 reads/sec, 50 writes/sec, and 5 global queries/sec of provisioned throughput capacity. Not available for some plans.
Possible values: 1 ≤ value ≤ 100
Provisioned global queries capacity in operations per second.
Possible values: 0 ≤ value ≤ 2500
Provisioned reads capacity in operations per second.
Possible values: 0 ≤ value ≤ 50000
Provisioned writes capacity in operations per second.
Possible values: 0 ≤ value ≤ 25000
Schema for information about the currently provisioned and target throughput capacity.
Detailed information about provisioned throughput capacity.
- current
Schema for detailed information about throughput capacity with breakdown by specific throughput requests classes.
- throughput
A number of blocks of throughput units. A block consists of 100 reads/sec, 50 writes/sec, and 5 global queries/sec of provisioned throughput capacity. Not available for some plans.
Possible values: 1 ≤ value ≤ 100
Provisioned global queries capacity in operations per second.
Possible values: 0 ≤ value ≤ 2500
Provisioned reads capacity in operations per second.
Possible values: 0 ≤ value ≤ 50000
Provisioned writes capacity in operations per second.
Possible values: 0 ≤ value ≤ 25000
Detailed information about target throughput capacity.
- target
Schema for detailed information about throughput capacity with breakdown by specific throughput requests classes.
- throughput
A number of blocks of throughput units. A block consists of 100 reads/sec, 50 writes/sec, and 5 global queries/sec of provisioned throughput capacity. Not available for some plans.
Possible values: 1 ≤ value ≤ 100
Provisioned global queries capacity in operations per second.
Possible values: 0 ≤ value ≤ 2500
Provisioned reads capacity in operations per second.
Possible values: 0 ≤ value ≤ 50000
Provisioned writes capacity in operations per second.
Possible values: 0 ≤ value ≤ 25000
Schema for information about the currently provisioned and target throughput capacity.
Detailed information about provisioned throughput capacity.
- current
Schema for detailed information about throughput capacity with breakdown by specific throughput requests classes.
- throughput
A number of blocks of throughput units. A block consists of 100 reads/sec, 50 writes/sec, and 5 global queries/sec of provisioned throughput capacity. Not available for some plans.
Possible values: 1 ≤ value ≤ 100
Provisioned global queries capacity in operations per second.
Possible values: 0 ≤ value ≤ 2500
Provisioned reads capacity in operations per second.
Possible values: 0 ≤ value ≤ 50000
Provisioned writes capacity in operations per second.
Possible values: 0 ≤ value ≤ 25000
Detailed information about target throughput capacity.
- target
Schema for detailed information about throughput capacity with breakdown by specific throughput requests classes.
- throughput
A number of blocks of throughput units. A block consists of 100 reads/sec, 50 writes/sec, and 5 global queries/sec of provisioned throughput capacity. Not available for some plans.
Possible values: 1 ≤ value ≤ 100
Provisioned global queries capacity in operations per second.
Possible values: 0 ≤ value ≤ 2500
Provisioned reads capacity in operations per second.
Possible values: 0 ≤ value ≤ 50000
Provisioned writes capacity in operations per second.
Possible values: 0 ≤ value ≤ 25000
Status Code
HTTP response for getCapacityThroughputInformation.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example CapacityThroughputInformation response.
{ "current": { "throughput": { "blocks": 5, "query": 25, "read": 500, "write": 250 } }, "target": { "throughput": { "blocks": 10, "query": 50, "read": 1000, "write": 500 } } }
Example CapacityThroughputInformation response.
{ "current": { "throughput": { "blocks": 5, "query": 25, "read": 500, "write": 250 } }, "target": { "throughput": { "blocks": 10, "query": 50, "read": 1000, "write": 500 } } }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Update the target provisioned throughput capacity
Sets the target provisioned throughput capacity for an IBM Cloudant instance. When target capacity is changed, the current capacity asynchronously changes to meet the target capacity.
Sets the target provisioned throughput capacity for an IBM Cloudant instance. When target capacity is changed, the current capacity asynchronously changes to meet the target capacity.
Sets the target provisioned throughput capacity for an IBM Cloudant instance. When target capacity is changed, the current capacity asynchronously changes to meet the target capacity.
Sets the target provisioned throughput capacity for an IBM Cloudant instance. When target capacity is changed, the current capacity asynchronously changes to meet the target capacity.
Sets the target provisioned throughput capacity for an IBM Cloudant instance. When target capacity is changed, the current capacity asynchronously changes to meet the target capacity.
PUT /_api/v2/user/capacity/throughput
(cloudant *CloudantV1) PutCapacityThroughputConfiguration(putCapacityThroughputConfigurationOptions *PutCapacityThroughputConfigurationOptions) (result *CapacityThroughputInformation, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PutCapacityThroughputConfigurationWithContext(ctx context.Context, putCapacityThroughputConfigurationOptions *PutCapacityThroughputConfigurationOptions) (result *CapacityThroughputInformation, response *core.DetailedResponse, err error)
ServiceCall<CapacityThroughputInformation> putCapacityThroughputConfiguration(PutCapacityThroughputConfigurationOptions putCapacityThroughputConfigurationOptions)
putCapacityThroughputConfiguration(params)
put_capacity_throughput_configuration(
self,
blocks: int,
**kwargs,
) -> DetailedResponse
Request
Instantiate the PutCapacityThroughputConfigurationOptions
struct and set the fields to provide parameter values for the PutCapacityThroughputConfiguration
method.
Use the PutCapacityThroughputConfigurationOptions.Builder
to create a PutCapacityThroughputConfigurationOptions
object that contains the parameter values for the putCapacityThroughputConfiguration
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
HTTP request body for putCapacityThroughputConfiguration.
Example CapacityThroughputConfiguration request.
{
"blocks": 10
}
A number of blocks of throughput units. A block consists of 100 reads/sec, 50 writes/sec, and 5 global queries/sec of provisioned throughput capacity. Not available for some plans.
Possible values: 1 ≤ value ≤ 100
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The PutCapacityThroughputConfiguration options.
A number of blocks of throughput units. A block consists of 100 reads/sec, 50 writes/sec, and 5 global queries/sec of provisioned throughput capacity. Not available for some plans.
Possible values: 1 ≤ value ≤ 100
Examples:10
The putCapacityThroughputConfiguration options.
A number of blocks of throughput units. A block consists of 100 reads/sec, 50 writes/sec, and 5 global queries/sec of provisioned throughput capacity. Not available for some plans.
Possible values: 1 ≤ value ≤ 100
Examples:10
parameters
A number of blocks of throughput units. A block consists of 100 reads/sec, 50 writes/sec, and 5 global queries/sec of provisioned throughput capacity. Not available for some plans.
Possible values: 1 ≤ value ≤ 100
Examples:
parameters
A number of blocks of throughput units. A block consists of 100 reads/sec, 50 writes/sec, and 5 global queries/sec of provisioned throughput capacity. Not available for some plans.
Possible values: 1 ≤ value ≤ 100
Examples:
ibmcloud cloudant capacity-update --blocks 10
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X PUT -H "Content-Type: application/json" "$SERVICE_URL/_api/v2/user/capacity/throughput" --data '{"blocks": 1}'
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } putCapacityThroughputConfigurationOptions := service.NewPutCapacityThroughputConfigurationOptions( 1, ) capacityThroughputConfiguration, response, err := service.PutCapacityThroughputConfiguration(putCapacityThroughputConfigurationOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(capacityThroughputConfiguration, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.CapacityThroughputInformation; import com.ibm.cloud.cloudant.v1.model.PutCapacityThroughputConfigurationOptions;
Cloudant service = Cloudant.newInstance(); PutCapacityThroughputConfigurationOptions options = new PutCapacityThroughputConfigurationOptions.Builder() .blocks(1) .build(); CapacityThroughputInformation response = service.putCapacityThroughputConfiguration(options).execute().getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.putCapacityThroughputConfiguration({ blocks: 1, }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.put_capacity_throughput_configuration( blocks=1 ).get_result() print(response)
Response
Schema for information about the currently provisioned and target throughput capacity.
Detailed information about provisioned throughput capacity.
Detailed information about target throughput capacity.
Schema for information about the currently provisioned and target throughput capacity.
Detailed information about provisioned throughput capacity.
- Current
Schema for detailed information about throughput capacity with breakdown by specific throughput requests classes.
- Throughput
A number of blocks of throughput units. A block consists of 100 reads/sec, 50 writes/sec, and 5 global queries/sec of provisioned throughput capacity. Not available for some plans.
Possible values: 1 ≤ value ≤ 100
Provisioned global queries capacity in operations per second.
Possible values: 0 ≤ value ≤ 2500
Provisioned reads capacity in operations per second.
Possible values: 0 ≤ value ≤ 50000
Provisioned writes capacity in operations per second.
Possible values: 0 ≤ value ≤ 25000
Detailed information about target throughput capacity.
- Target
Schema for detailed information about throughput capacity with breakdown by specific throughput requests classes.
- Throughput
A number of blocks of throughput units. A block consists of 100 reads/sec, 50 writes/sec, and 5 global queries/sec of provisioned throughput capacity. Not available for some plans.
Possible values: 1 ≤ value ≤ 100
Provisioned global queries capacity in operations per second.
Possible values: 0 ≤ value ≤ 2500
Provisioned reads capacity in operations per second.
Possible values: 0 ≤ value ≤ 50000
Provisioned writes capacity in operations per second.
Possible values: 0 ≤ value ≤ 25000
Schema for information about the currently provisioned and target throughput capacity.
Detailed information about provisioned throughput capacity.
- current
Schema for detailed information about throughput capacity with breakdown by specific throughput requests classes.
- throughput
A number of blocks of throughput units. A block consists of 100 reads/sec, 50 writes/sec, and 5 global queries/sec of provisioned throughput capacity. Not available for some plans.
Possible values: 1 ≤ value ≤ 100
Provisioned global queries capacity in operations per second.
Possible values: 0 ≤ value ≤ 2500
Provisioned reads capacity in operations per second.
Possible values: 0 ≤ value ≤ 50000
Provisioned writes capacity in operations per second.
Possible values: 0 ≤ value ≤ 25000
Detailed information about target throughput capacity.
- target
Schema for detailed information about throughput capacity with breakdown by specific throughput requests classes.
- throughput
A number of blocks of throughput units. A block consists of 100 reads/sec, 50 writes/sec, and 5 global queries/sec of provisioned throughput capacity. Not available for some plans.
Possible values: 1 ≤ value ≤ 100
Provisioned global queries capacity in operations per second.
Possible values: 0 ≤ value ≤ 2500
Provisioned reads capacity in operations per second.
Possible values: 0 ≤ value ≤ 50000
Provisioned writes capacity in operations per second.
Possible values: 0 ≤ value ≤ 25000
Schema for information about the currently provisioned and target throughput capacity.
Detailed information about provisioned throughput capacity.
- current
Schema for detailed information about throughput capacity with breakdown by specific throughput requests classes.
- throughput
A number of blocks of throughput units. A block consists of 100 reads/sec, 50 writes/sec, and 5 global queries/sec of provisioned throughput capacity. Not available for some plans.
Possible values: 1 ≤ value ≤ 100
Provisioned global queries capacity in operations per second.
Possible values: 0 ≤ value ≤ 2500
Provisioned reads capacity in operations per second.
Possible values: 0 ≤ value ≤ 50000
Provisioned writes capacity in operations per second.
Possible values: 0 ≤ value ≤ 25000
Detailed information about target throughput capacity.
- target
Schema for detailed information about throughput capacity with breakdown by specific throughput requests classes.
- throughput
A number of blocks of throughput units. A block consists of 100 reads/sec, 50 writes/sec, and 5 global queries/sec of provisioned throughput capacity. Not available for some plans.
Possible values: 1 ≤ value ≤ 100
Provisioned global queries capacity in operations per second.
Possible values: 0 ≤ value ≤ 2500
Provisioned reads capacity in operations per second.
Possible values: 0 ≤ value ≤ 50000
Provisioned writes capacity in operations per second.
Possible values: 0 ≤ value ≤ 25000
Schema for information about the currently provisioned and target throughput capacity.
Detailed information about provisioned throughput capacity.
- current
Schema for detailed information about throughput capacity with breakdown by specific throughput requests classes.
- throughput
A number of blocks of throughput units. A block consists of 100 reads/sec, 50 writes/sec, and 5 global queries/sec of provisioned throughput capacity. Not available for some plans.
Possible values: 1 ≤ value ≤ 100
Provisioned global queries capacity in operations per second.
Possible values: 0 ≤ value ≤ 2500
Provisioned reads capacity in operations per second.
Possible values: 0 ≤ value ≤ 50000
Provisioned writes capacity in operations per second.
Possible values: 0 ≤ value ≤ 25000
Detailed information about target throughput capacity.
- target
Schema for detailed information about throughput capacity with breakdown by specific throughput requests classes.
- throughput
A number of blocks of throughput units. A block consists of 100 reads/sec, 50 writes/sec, and 5 global queries/sec of provisioned throughput capacity. Not available for some plans.
Possible values: 1 ≤ value ≤ 100
Provisioned global queries capacity in operations per second.
Possible values: 0 ≤ value ≤ 2500
Provisioned reads capacity in operations per second.
Possible values: 0 ≤ value ≤ 50000
Provisioned writes capacity in operations per second.
Possible values: 0 ≤ value ≤ 25000
Status Code
HTTP response for getCapacityThroughputInformation.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example CapacityThroughputInformation response.
{ "current": { "throughput": { "blocks": 5, "query": 25, "read": 500, "write": 250 } }, "target": { "throughput": { "blocks": 10, "query": 50, "read": 1000, "write": 500 } } }
Example CapacityThroughputInformation response.
{ "current": { "throughput": { "blocks": 5, "query": 25, "read": 500, "write": 250 } }, "target": { "throughput": { "blocks": 10, "query": 50, "read": 1000, "write": 500 } } }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Sets a valid account plan for the user
Sets a valid account plan for the user. IBM Cloudant server administrators can change a user's plan across plan groups, whereas a regular IBM Cloudant user can only change between plans within the same plan group.
PUT /_api/v2/user/plan
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
HTTP request body for putUserPlan.
Example putUserPlan request.
{
"plan": "billing.tiered.bluemix.standard",
"plan_multiple": 25
}
The name of the new plan for the account.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The optional plan multiplier.
Possible values: 1 ≤ value ≤ 100
Response
Schema for an OK result.
ok
Status Code
HTTP response for Ok operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example Ok response.
{ "ok": true }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve information about cluster reshard operations
Retrieves a summary of the shard splitting operations for the whole cluster.
GET /_reshard
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Response
Schema for the shard splitting cluster summary.
Number of complete jobs.
Possible values: 0 ≤ value ≤ 9007199254740992
Number of failed jobs.
Possible values: 0 ≤ value ≤ 9007199254740992
Number of running jobs.
Possible values: 0 ≤ value ≤ 48
States of the shard splitting application. When shard splitting is running on the cluster then all the jobs that haven't been individually stopped will be running as well. When shard splitting is stopped then all the shard splitting jobs will be stopped on the cluster.
Possible values: [
running
,stopped
]State reason.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Number of stopped jobs.
Possible values: 0 ≤ value ≤ 9007199254740992
Total number of jobs.
Possible values: 0 ≤ value ≤ 9007199254740992
Status Code
HTTP response for
/_reshard
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example ReshardInformation response.
{ "completed": 3, "failed": 4, "running": 0, "state": "stopped", "state_reason": "Manual rebalancing.", "stopped": 0, "total": 7 }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve HTTP headers for cluster reshard operations
Retrieves the HTTP headers for cluster reshard operations.
HEAD /_reshard
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for
/_reshard
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Response
Schema for a list of shard splitting jobs.
Offset where the list started.
Possible values: 0 ≤ value ≤ 9007199254740992
Total number of shard splitting jobs.
Possible values: 0 ≤ value ≤ 4294967295
All split jobs.
Possible values: 0 ≤ number of items ≤ 48
Status Code
HTTP response for
/_reshard/jobs
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example ReshardJobsInformation response.
{ "jobs": [ { "history": [ { "detail": null, "timestamp": "2019-02-06T22:28:06Z", "type": "new" }, { "detail": null, "timestamp": "2019-02-06T22:28:10Z", "type": "completed" } ], "id": "001-0a308ef9f7bd24bd4887d6e619682a6d3bb3d0fd94625866c5216ec1167b4e23", "job_state": "completed", "node": "node1@127.0.0.1", "source": "shards/00000000-ffffffff/db1.1549492084", "split_state": "completed", "start_time": "2019-02-06T22:28:06Z", "state_info": {}, "target": [ "shards/00000000-7fffffff/db1.1549492084", "shards/80000000-ffffffff/db1.1549492084" ], "type": "split", "update_time": "2019-02-06T22:28:10Z" } ], "offset": 0, "total_rows": 1 }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve HTTP headers of shard splitting jobs
Retrieves the HTTP headers for shard splitting jobs.
HEAD /_reshard/jobs
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for
/_reshard/jobs
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
HTTP request body for postReshardJobsConfiguration.
Example ReshardJobs request.
{
"db": "db1",
"node": "node1@127.0.0.1",
"range": "80000000-bfffffff",
"type": "split"
}
Job type. Currently the only type accepted is split.
Allowable values: [
split
]Schema for a database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Node name.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^.+$
Shard range.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Database shard.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Response
Schema for the result of a shard splitting jobs response.
Node name.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^.+$
Database shard.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
ok
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Status Code
HTTP response for postReshardJobsConfiguration.
HTTP response for postReshardJobsConfiguration.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example postReshardJobsConfiguration response.
[ { "id": "001-30d7848a6feeb826d5e3ea5bb7773d672af226fd34fd84a8fb1ca736285df557", "node": "node1@127.0.0.1", "ok": "true,", "shard": "shards/80000000-ffffffff/db3.1554148353" }, { "id": "001-40d7848a6feeb826d5e3ea5bb7773d672af226fd34fd84a8fb1ca736285df600", "node": "node2@127.0.0.1", "ok": "true,", "shard": "shards/80000000-ffffffff/db3.1554148353" } ]
Example postReshardJobsConfiguration response.
[ { "id": "001-30d7848a6feeb826d5e3ea5bb7773d672af226fd34fd84a8fb1ca736285df557", "node": "node1@127.0.0.1", "ok": "true,", "shard": "shards/80000000-ffffffff/db3.1554148353" }, { "id": "001-40d7848a6feeb826d5e3ea5bb7773d672af226fd34fd84a8fb1ca736285df600", "node": "node2@127.0.0.1", "ok": "true,", "shard": "shards/80000000-ffffffff/db3.1554148353" } ]
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Delete a shard splitting job
Stop and remove a shard splitting job.
DELETE /_reshard/jobs/{reshard_job_id}
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the shard splitting job ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Response
Schema for an OK result.
ok
Status Code
HTTP response for Ok operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example Ok response.
{ "ok": true }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve information about a shard splitting job
Retrieves the state of a shard splitting job.
GET /_reshard/jobs/{reshard_job_id}
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the shard splitting job ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Response
Schema for the state of a shard splitting job.
The timeline of job state transitions with a timestamp and additional details (if available).
Possible values: 0 ≤ number of items ≤ 20
The ID of the job.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
This is the running state of the job.
Possible values: [
completed
,failed
,new
,running
,stopped
]Node where this job is running.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^.+$
Source shard.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
How far along the shard splitting process has progressed.
Possible values: [
build_indices
,completed
,copy_local_docs
,initial_copy
,new
,source_delete
,topoff1
,topoff2
,topoff3
,update_shard_map
,wait_source_close
]Time when job had started running last. A job might have been stopped or the node restarted to this time might not match with the creation time.
Possible values: 1 ≤ length ≤ 26
Additional information about the current running state. On retry it will include the last error that cause the retry to happen.
- state_info
Target shards.
Possible values: 0 ≤ number of items ≤ 4294967295, 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Job type. Currently the only type accepted is split.
Possible values: [
split
]Time of the last update to the job state.
Possible values: 1 ≤ length ≤ 26
Status Code
HTTP response for
/_reshard/jobs/{reshard_job_id}
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example ReshardJobInformation response.
{ "history": [ { "detail": null, "timestamp": "2019-02-06T22:28:06Z", "type": "new" }, { "detail": null, "timestamp": "2019-02-06T22:28:10Z", "type": "completed" } ], "id": "001-0a308ef9f7bd24bd4887d6e619682a6d3bb3d0fd94625866c5216ec1167b4e23", "job_state": "completed", "node": "node1@127.0.0.1", "source": "shards/00000000-ffffffff/db1.1549492084", "split_state": "completed", "start_time": "2019-02-06T22:28:06Z", "state_info": {}, "target": [ "shards/00000000-7fffffff/db1.1549492084", "shards/80000000-ffffffff/db1.1549492084" ], "type": "split", "update_time": "2019-02-06T22:28:10Z" }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve information about a shard splitting job
Retrieves the state of a shard splitting job.
HEAD /_reshard/jobs/{reshard_job_id}
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the shard splitting job ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for
/_reshard/jobs/{reshard_job_id}
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Retrieve the running state of a shard splitting job
Retrieves the running state of a shard splitting job.
GET /_reshard/jobs/{reshard_job_id}/state
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the shard splitting job ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Response
Schema for the state information of a shard splitting job.
Reason for job state.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Job state.
Possible values: [
completed
,failed
,running
,stopped
]
Status Code
HTTP response for
/_reshard/state
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example request or response body for the state of cluster resharding.
{ "reason": "Pause resharding across the cluster.", "state": "stopped" }
Example request or response body for the state of a reshard job.
{ "reason": "Pause this job for now.", "state": "stopped" }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve HTTP headers of a shard splitting job
Retrieves the HTTP headers of a shard splitting job.
HEAD /_reshard/jobs/{reshard_job_id}/state
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the shard splitting job ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for
/_reshard/state
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Update the running state of a shard splitting job
Update the running state of a shard splitting job. The state can be changed from stopped to running or from running to stopped. If an individual job is stopped via this API it will stay stopped even after the global resharding state is toggled from stopped to running. If the job is already completed its state will stay completed.
PUT /_reshard/jobs/{reshard_job_id}/state
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the shard splitting job ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
HTTP request body for putReshardState or putReshardJobState.
Example request or response body for the state of cluster resharding.
{
"reason": "Pause resharding across the cluster.",
"state": "stopped"
}
Example request or response body for the state of a reshard job.
{
"reason": "Pause this job for now.",
"state": "stopped"
}
Reason for job state.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Job state.
Allowable values: [
completed
,failed
,running
,stopped
]
Response
Schema for an OK result.
ok
Status Code
HTTP response for Ok operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example Ok response.
{ "ok": true }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve the state of shard splitting across the cluster
Retrieves the state of shard splitting across the cluster.
GET /_reshard/state
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Response
Schema for the state information of a shard splitting job.
Reason for job state.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Job state.
Possible values: [
completed
,failed
,running
,stopped
]
Status Code
HTTP response for
/_reshard/state
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example request or response body for the state of cluster resharding.
{ "reason": "Pause resharding across the cluster.", "state": "stopped" }
Example request or response body for the state of a reshard job.
{ "reason": "Pause this job for now.", "state": "stopped" }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve HTTP headers of shard splitting across the cluster
Retrieves the HTTP headers of shard splitting across the cluster.
HEAD /_reshard/state
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for
/_reshard/state
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Enable/disable shard splitting across the cluster
Enable/disable shard splitting across the cluster. The states are stopped or running. This starts and stops global resharding on all the nodes of the cluster. If there are any running jobs, they will be stopped when the state changes to stopped. When the state changes back to running those job will continue running.
PUT /_reshard/state
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
HTTP request body for putReshardState or putReshardJobState.
Example request or response body for the state of cluster resharding.
{
"reason": "Pause resharding across the cluster.",
"state": "stopped"
}
Example request or response body for the state of a reshard job.
{
"reason": "Pause this job for now.",
"state": "stopped"
}
Reason for job state.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Job state.
Allowable values: [
completed
,failed
,running
,stopped
]
Response
Schema for an OK result.
ok
Status Code
HTTP response for Ok operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example Ok response.
{ "ok": true }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve one or more UUIDs
Requests one or more Universally Unique Identifiers (UUIDs) from the instance. The response is a JSON object that provides a list of UUIDs.
Tip: The authentication for this endpoint is only enforced when using IAM.
Requests one or more Universally Unique Identifiers (UUIDs) from the instance. The response is a JSON object that provides a list of UUIDs.
Tip: The authentication for this endpoint is only enforced when using IAM.
Requests one or more Universally Unique Identifiers (UUIDs) from the instance. The response is a JSON object that provides a list of UUIDs.
Tip: The authentication for this endpoint is only enforced when using IAM.
Requests one or more Universally Unique Identifiers (UUIDs) from the instance. The response is a JSON object that provides a list of UUIDs.
Tip: The authentication for this endpoint is only enforced when using IAM.
Requests one or more Universally Unique Identifiers (UUIDs) from the instance. The response is a JSON object that provides a list of UUIDs.
Tip: The authentication for this endpoint is only enforced when using IAM.
GET /_uuids
(cloudant *CloudantV1) GetUuids(getUuidsOptions *GetUuidsOptions) (result *UuidsResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) GetUuidsWithContext(ctx context.Context, getUuidsOptions *GetUuidsOptions) (result *UuidsResult, response *core.DetailedResponse, err error)
ServiceCall<UuidsResult> getUuids(GetUuidsOptions getUuidsOptions)
getUuids(params)
get_uuids(
self,
*,
count: Optional[int] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the GetUuidsOptions
struct and set the fields to provide parameter values for the GetUuids
method.
Use the GetUuidsOptions.Builder
to create a GetUuidsOptions
object that contains the parameter values for the getUuids
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Query Parameters
Query parameter to specify the number of UUIDs to return.
Possible values: 0 ≤ value ≤ 1000
Default:
1
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The GetUuids options.
Query parameter to specify the number of UUIDs to return.
Possible values: 0 ≤ value ≤ 1000
Default:
1
The getUuids options.
Query parameter to specify the number of UUIDs to return.
Possible values: 0 ≤ value ≤ 1000
Default:
1
parameters
Query parameter to specify the number of UUIDs to return.
Possible values: 0 ≤ value ≤ 1000
Default:
1
parameters
Query parameter to specify the number of UUIDs to return.
Possible values: 0 ≤ value ≤ 1000
Default:
1
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/_uuids?count=10"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } getUuidsOptions := service.NewGetUuidsOptions() getUuidsOptions.SetCount(10) uuidsResult, response, err := service.GetUuids(getUuidsOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(uuidsResult, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.GetUuidsOptions; import com.ibm.cloud.cloudant.v1.model.UuidsResult;
Cloudant service = Cloudant.newInstance(); GetUuidsOptions uuidsOptions = new GetUuidsOptions.Builder() .count(10) .build(); UuidsResult response = service.getUuids(uuidsOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); const uuidsParams: CloudantV1.GetUuidsParams = { count: 10 }; service.getUuids(uuidsParams).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.get_uuids(count=10).get_result() print(response)
Response
Schema for a set of uuids generated by the server.
uuids
Possible values: 0 ≤ number of items ≤ 1000, length = 32, Value must match regular expression
^[\da-f]{32}$
Schema for a set of uuids generated by the server.
uuids.
Possible values: 0 ≤ number of items ≤ 1000, length = 32, Value must match regular expression
/^[\\da-f]{32}$/
Schema for a set of uuids generated by the server.
uuids.
Possible values: 0 ≤ number of items ≤ 1000, length = 32, Value must match regular expression
/^[\\da-f]{32}$/
Schema for a set of uuids generated by the server.
uuids.
Possible values: 0 ≤ number of items ≤ 1000, length = 32, Value must match regular expression
/^[\\da-f]{32}$/
Schema for a set of uuids generated by the server.
uuids.
Possible values: 0 ≤ number of items ≤ 1000, length = 32, Value must match regular expression
/^[\\da-f]{32}$/
Status Code
HTTP response for
/_uuids
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example UuidsResult response.
{ "uuids": [ "75480ca477454894678e22eec6002413", "75480ca477454894678e22eec600250b", "75480ca477454894678e22eec6002c41", "75480ca477454894678e22eec6003b90", "75480ca477454894678e22eec6003fca", "75480ca477454894678e22eec6004bef", "75480ca477454894678e22eec600528f", "75480ca477454894678e22eec6005e0b", "75480ca477454894678e22eec6006158", "75480ca477454894678e22eec6006161" ] }
Example UuidsResult response.
{ "uuids": [ "75480ca477454894678e22eec6002413", "75480ca477454894678e22eec600250b", "75480ca477454894678e22eec6002c41", "75480ca477454894678e22eec6003b90", "75480ca477454894678e22eec6003fca", "75480ca477454894678e22eec6004bef", "75480ca477454894678e22eec600528f", "75480ca477454894678e22eec6005e0b", "75480ca477454894678e22eec6006158", "75480ca477454894678e22eec6006161" ] }
Example error response for a bad request for too many UUIDs.
{ "error": "bad_request", "reason": "count parameter too large" }
Example error response for a bad request for too many UUIDs.
{ "error": "bad_request", "reason": "count parameter too large" }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve HTTP headers for one or more UUIDs
Retrieves the HTTP headers for one or more UUIDs.
HEAD /_uuids
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the ETag for a resource.
Examples:Double quoted base64 encoded attachment digest.
"MEHlNHhicVt9efOzyvsz0Q=="
Double quoted document revision identifier.
"2-240fc93fad07083c338c7e0ea55791b3"
Double quoted local document tag.
"6APCCGX4B76OFFD5972MSBFHD"
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for
/_uuids
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Query a list of all database names in the instance
Query to retrieve a list of database names from the instance.
Query to retrieve a list of database names from the instance.
Query to retrieve a list of database names from the instance.
Query to retrieve a list of database names from the instance.
Query to retrieve a list of database names from the instance.
GET /_all_dbs
(cloudant *CloudantV1) GetAllDbs(getAllDbsOptions *GetAllDbsOptions) (result []string, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) GetAllDbsWithContext(ctx context.Context, getAllDbsOptions *GetAllDbsOptions) (result []string, response *core.DetailedResponse, err error)
ServiceCall<List<String>> getAllDbs(GetAllDbsOptions getAllDbsOptions)
getAllDbs(params)
get_all_dbs(
self,
*,
descending: Optional[bool] = None,
end_key: Optional[str] = None,
limit: Optional[int] = None,
skip: Optional[int] = None,
start_key: Optional[str] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the GetAllDbsOptions
struct and set the fields to provide parameter values for the GetAllDbs
method.
Use the GetAllDbsOptions.Builder
to create a GetAllDbsOptions
object that contains the parameter values for the getAllDbs
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Query Parameters
Query parameter to specify whether to return the documents in descending by key order.
Default:
false
Query parameter to specify to stop returning records when the specified key is reached. String representation of any JSON type that matches the key type emitted by the view function.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Query parameter to specify to start returning records from the specified key. String representation of any JSON type that matches the key type emitted by the view function.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The GetAllDbs options.
Query parameter to specify whether to return the documents in descending by key order.
Default:
false
Query parameter to specify to stop returning records when the specified key is reached. String representation of any JSON type that matches the key type emitted by the view function.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Query parameter to specify to start returning records from the specified key. String representation of any JSON type that matches the key type emitted by the view function.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The getAllDbs options.
Query parameter to specify whether to return the documents in descending by key order.
Default:
false
Query parameter to specify to stop returning records when the specified key is reached. String representation of any JSON type that matches the key type emitted by the view function.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Query parameter to specify to start returning records from the specified key. String representation of any JSON type that matches the key type emitted by the view function.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
parameters
Query parameter to specify whether to return the documents in descending by key order.
Default:
false
Query parameter to specify to stop returning records when the specified key is reached. String representation of any JSON type that matches the key type emitted by the view function.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Query parameter to specify to start returning records from the specified key. String representation of any JSON type that matches the key type emitted by the view function.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
parameters
Query parameter to specify whether to return the documents in descending by key order.
Default:
false
Query parameter to specify to stop returning records when the specified key is reached. String representation of any JSON type that matches the key type emitted by the view function.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Query parameter to specify to start returning records from the specified key. String representation of any JSON type that matches the key type emitted by the view function.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/_all_dbs"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } getAllDbsOptions := service.NewGetAllDbsOptions() result, response, err := service.GetAllDbs(getAllDbsOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(result, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import java.util.List;
Cloudant service = Cloudant.newInstance(); List<String> response = service.getAllDbs().execute().getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.getAllDbs().then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.get_all_dbs().get_result() print(response)
Response
Response type: []string
Response type: List<String>
Response type: string[]
Response type: List[str]
Schema for a list of database names.
Status Code
HTTP response for
/_all_dbs
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example AllDbs response.
[ "events", "orders", "products", "stores", "users" ]
Example AllDbs response.
[ "events", "orders", "products", "stores", "users" ]
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve the HTTP headers for all database names in the instance
Retrieve the HTTP headers for the _all_dbs endpoint.
HEAD /_all_dbs
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the ETag for a resource.
Examples:Double quoted base64 encoded attachment digest.
"MEHlNHhicVt9efOzyvsz0Q=="
Double quoted document revision identifier.
"2-240fc93fad07083c338c7e0ea55791b3"
Double quoted local document tag.
"6APCCGX4B76OFFD5972MSBFHD"
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for
/_all_dbs
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Query information about multiple databases
This operation enables you to request information about multiple databases in a single request, instead of issuing multiple GET /{db}
requests. It returns a list that contains an information object for each database specified in the request.
This operation enables you to request information about multiple databases in a single request, instead of issuing multiple GET /{db}
requests. It returns a list that contains an information object for each database specified in the request.
This operation enables you to request information about multiple databases in a single request, instead of issuing multiple GET /{db}
requests. It returns a list that contains an information object for each database specified in the request.
This operation enables you to request information about multiple databases in a single request, instead of issuing multiple GET /{db}
requests. It returns a list that contains an information object for each database specified in the request.
This operation enables you to request information about multiple databases in a single request, instead of issuing multiple GET /{db}
requests. It returns a list that contains an information object for each database specified in the request.
POST /_dbs_info
(cloudant *CloudantV1) PostDbsInfo(postDbsInfoOptions *PostDbsInfoOptions) (result []DbsInfoResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostDbsInfoWithContext(ctx context.Context, postDbsInfoOptions *PostDbsInfoOptions) (result []DbsInfoResult, response *core.DetailedResponse, err error)
ServiceCall<List<DbsInfoResult>> postDbsInfo(PostDbsInfoOptions postDbsInfoOptions)
postDbsInfo(params)
post_dbs_info(
self,
keys: List[str],
**kwargs,
) -> DetailedResponse
Request
Instantiate the PostDbsInfoOptions
struct and set the fields to provide parameter values for the PostDbsInfo
method.
Use the PostDbsInfoOptions.Builder
to create a PostDbsInfoOptions
object that contains the parameter values for the postDbsInfo
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
HTTP request body for postDbsInfo.
Example DbsInfoQuery request.
{
"keys": [
"products",
"users",
"orders"
]
}
A list of database names
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The PostDbsInfo options.
A list of database names.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Examples:[ "products", "users", "orders" ]
The postDbsInfo options.
A list of database names.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Examples:[ "products", "users", "orders" ]
parameters
A list of database names.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Examples:
parameters
A list of database names.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Examples:
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X POST "$SERVICE_URL/_dbs_info" -H "Content-Type: application/json" --data '{ "keys": ["products", "users", "orders"] }'
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } postDbsInfoOptions := service.NewPostDbsInfoOptions([]string{ "products", "users", "orders", }) dbsInfoResult, response, err := service.PostDbsInfo(postDbsInfoOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(dbsInfoResult, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.DbsInfoResult; import com.ibm.cloud.cloudant.v1.model.PostDbsInfoOptions; import java.util.Arrays; import java.util.List;
Cloudant service = Cloudant.newInstance(); PostDbsInfoOptions dbsInfoOptions = new PostDbsInfoOptions.Builder() .keys(Arrays.asList("products", "users", "orders")) .build(); List<DbsInfoResult> response = service.postDbsInfo(dbsInfoOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.postDbsInfo({ keys: ['products', 'users', 'orders'] }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.post_dbs_info( keys=['products', 'users', 'orders'] ).get_result() print(response)
Response
Response type: []DbsInfoResult
Response type: List<DbsInfoResult>
Response type: DbsInfoResult[]
Response type: List[DbsInfoResult]
Schema for a list of database information objects.
Schema for a database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Schema for information about a database.
Status Code
HTTP response for postDbsInfo.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example DbsInfoResults response.
[ { "info": { "cluster": { "n": 3, "q": 1, "r": 1, "w": 1 }, "compact_running": false, "db_name": "products", "disk_format_version": 8, "doc_count": 5, "doc_del_count": 1, "instance_start_time": "0", "partitioned_indexes": { "count": 4, "indexes": { "search": 2, "view": 2 }, "limit": 10 }, "props": { "partitioned": true }, "purge_seq": "8-g1AAAALReJyd0T8OgjAUBvCKjq6ewM2BQPyz6hUUeoAWSExDIDE4ewqvoNBLeAouwRmE58diQprY4PR16C9f-17KGJufpzFbxjLKL8khljs3SvNrLLLC8_zv2c2SIsVlRzC54DxUwhmyzW_WIy5XWldKTEYV9kjLPVFnSFsnEEn0Bob0LRIolErrUgk2lGuLBKrkjag1pK0TqMtm7MT53XivpRUsAEM8MSxjN5YJg5VgiDfRa-xmwVowxJHz-o9ufLhGPLRujJltrRofbhDYNGFq6gOYofZj", "sizes": { "active": 8887, "external": 1872, "file": 685680 }, "update_seq": "89-g1AAAALReJyd0T8OgjAUBvCKjq6ewM2BQPyz6hUUeoAWSExDIDE4ewqvoNBLeAouwRmE58diQprY4PR16C9f-17KGJufpzFbxjLKL8khljs3SvNrLLLC8_zv2c2SIsVlRzC54DxUwhmyzW_WIy5XWldKTEYV9kjLPVFnSFsnEEn0Bob0LRIolErrUgk2lGuLBKrkjag1pK0TqMtm7MT53XivpRUsAEM8MSxjN5YJg5VgiDfRa-xmwVowxJHz-o9ufLhGPLRujJltrRofbhDYNGFq6gOYofZj" }, "key": "products" }, { "info": { "cluster": { "n": 3, "q": 8, "r": 2, "w": 2 }, "compact_running": false, "db_name": "users", "disk_format_version": 8, "doc_count": 11, "doc_del_count": 0, "instance_start_time": "0", "props": {}, "purge_seq": "8-g1AAAALReJyd0T8OgjAUBvCKjq6ewM2BQPyz6hUUeoAWSExDIDE4ewqvoNBLeAouwRmE58diQprY4PR16C9f-17KGJufpzFbxjLKL8khljs3SvNrLLLC8_zv2c2SIsVlRzC54DxUwhmyzW_WIy5XWldKTEYV9kjLPVFnSFsnEEn0Bob0LRIolErrUgk2lGuLBKrkjag1pK0TqMtm7MT53XivpRUsAEM8MSxjN5YJg5VgiDfRa-xmwVowxJHz-o9ufLhGPLRujJltrRofbhDYNGFq6gOYofZj", "sizes": { "active": 67475, "external": 2339, "file": 3872387 }, "update_seq": "13-g1AAAALReJyd0T8OgjAUBvCKjq6ewM2BQPyz6hUUeoAWSExDIDE4ewqvoNBLeAouwRmE58diQprY4PR16C9f-17KGJufpzFbxjLKL8khljs3SvNrLLLC8_zv2c2SIsVlRzC54DxUwhmyzW_WIy5XWldKTEYV9kjLPVFnSFsnEEn0Bob0LRIolErrUgk2lGuLBKrkjag1pK0TqMtm7MT53XivpRUsAEM8MSxjN5YJg5VgiDfRa-xmwVowxJHz-o9ufLhGPLRujJltrRofbhDYNGFq6gOYofZj" }, "key": "users" }, { "info": { "cluster": { "n": 3, "q": 8, "r": 2, "w": 2 }, "compact_running": false, "db_name": "orders", "disk_format_version": 8, "doc_count": 5, "doc_del_count": 0, "instance_start_time": "0", "props": {}, "purge_seq": "8-g1AAAALReJyd0T8OgjAUBvCKjq6ewM2BQPyz6hUUeoAWSExDIDE4ewqvoNBLeAouwRmE58diQprY4PR16C9f-17KGJufpzFbxjLKL8khljs3SvNrLLLC8_zv2c2SIsVlRzC54DxUwhmyzW_WIy5XWldKTEYV9kjLPVFnSFsnEEn0Bob0LRIolErrUgk2lGuLBKrkjag1pK0TqMtm7MT53XivpRUsAEM8MSxjN5YJg5VgiDfRa-xmwVowxJHz-o9ufLhGPLRujJltrRofbhDYNGFq6gOYofZj", "sizes": { "active": 44475, "external": 1339, "file": 133970 }, "update_seq": "13-g1AAAALReJyd0T8OgjAUBvCKjq6ewM2BQPyz6hUUeoAWSExDIDE4ewqvoNBLeAouwRmE58diQprY4PR16C9f-17KGJufpzFbxjLKL8khljs3SvNrLLLC8_zv2c2SIsVlRzC54DxUwhmyzW_WIy5XWldKTEYV9kjLPVFnSFsnEEn0Bob0LRIolErrUgk2lGuLBKrkjag1pK0TqMtm7MT53XivpRUsAEM8MSxjN5YJg5VgiDfRa-xmwVowxJHz-o9ufLhGPLRujJltrRofbhDYNGFq6gOYofZj" }, "key": "orders" } ]
Example DbsInfoResults response.
[ { "info": { "cluster": { "n": 3, "q": 1, "r": 1, "w": 1 }, "compact_running": false, "db_name": "products", "disk_format_version": 8, "doc_count": 5, "doc_del_count": 1, "instance_start_time": "0", "partitioned_indexes": { "count": 4, "indexes": { "search": 2, "view": 2 }, "limit": 10 }, "props": { "partitioned": true }, "purge_seq": "8-g1AAAALReJyd0T8OgjAUBvCKjq6ewM2BQPyz6hUUeoAWSExDIDE4ewqvoNBLeAouwRmE58diQprY4PR16C9f-17KGJufpzFbxjLKL8khljs3SvNrLLLC8_zv2c2SIsVlRzC54DxUwhmyzW_WIy5XWldKTEYV9kjLPVFnSFsnEEn0Bob0LRIolErrUgk2lGuLBKrkjag1pK0TqMtm7MT53XivpRUsAEM8MSxjN5YJg5VgiDfRa-xmwVowxJHz-o9ufLhGPLRujJltrRofbhDYNGFq6gOYofZj", "sizes": { "active": 8887, "external": 1872, "file": 685680 }, "update_seq": "89-g1AAAALReJyd0T8OgjAUBvCKjq6ewM2BQPyz6hUUeoAWSExDIDE4ewqvoNBLeAouwRmE58diQprY4PR16C9f-17KGJufpzFbxjLKL8khljs3SvNrLLLC8_zv2c2SIsVlRzC54DxUwhmyzW_WIy5XWldKTEYV9kjLPVFnSFsnEEn0Bob0LRIolErrUgk2lGuLBKrkjag1pK0TqMtm7MT53XivpRUsAEM8MSxjN5YJg5VgiDfRa-xmwVowxJHz-o9ufLhGPLRujJltrRofbhDYNGFq6gOYofZj" }, "key": "products" }, { "info": { "cluster": { "n": 3, "q": 8, "r": 2, "w": 2 }, "compact_running": false, "db_name": "users", "disk_format_version": 8, "doc_count": 11, "doc_del_count": 0, "instance_start_time": "0", "props": {}, "purge_seq": "8-g1AAAALReJyd0T8OgjAUBvCKjq6ewM2BQPyz6hUUeoAWSExDIDE4ewqvoNBLeAouwRmE58diQprY4PR16C9f-17KGJufpzFbxjLKL8khljs3SvNrLLLC8_zv2c2SIsVlRzC54DxUwhmyzW_WIy5XWldKTEYV9kjLPVFnSFsnEEn0Bob0LRIolErrUgk2lGuLBKrkjag1pK0TqMtm7MT53XivpRUsAEM8MSxjN5YJg5VgiDfRa-xmwVowxJHz-o9ufLhGPLRujJltrRofbhDYNGFq6gOYofZj", "sizes": { "active": 67475, "external": 2339, "file": 3872387 }, "update_seq": "13-g1AAAALReJyd0T8OgjAUBvCKjq6ewM2BQPyz6hUUeoAWSExDIDE4ewqvoNBLeAouwRmE58diQprY4PR16C9f-17KGJufpzFbxjLKL8khljs3SvNrLLLC8_zv2c2SIsVlRzC54DxUwhmyzW_WIy5XWldKTEYV9kjLPVFnSFsnEEn0Bob0LRIolErrUgk2lGuLBKrkjag1pK0TqMtm7MT53XivpRUsAEM8MSxjN5YJg5VgiDfRa-xmwVowxJHz-o9ufLhGPLRujJltrRofbhDYNGFq6gOYofZj" }, "key": "users" }, { "info": { "cluster": { "n": 3, "q": 8, "r": 2, "w": 2 }, "compact_running": false, "db_name": "orders", "disk_format_version": 8, "doc_count": 5, "doc_del_count": 0, "instance_start_time": "0", "props": {}, "purge_seq": "8-g1AAAALReJyd0T8OgjAUBvCKjq6ewM2BQPyz6hUUeoAWSExDIDE4ewqvoNBLeAouwRmE58diQprY4PR16C9f-17KGJufpzFbxjLKL8khljs3SvNrLLLC8_zv2c2SIsVlRzC54DxUwhmyzW_WIy5XWldKTEYV9kjLPVFnSFsnEEn0Bob0LRIolErrUgk2lGuLBKrkjag1pK0TqMtm7MT53XivpRUsAEM8MSxjN5YJg5VgiDfRa-xmwVowxJHz-o9ufLhGPLRujJltrRofbhDYNGFq6gOYofZj", "sizes": { "active": 44475, "external": 1339, "file": 133970 }, "update_seq": "13-g1AAAALReJyd0T8OgjAUBvCKjq6ewM2BQPyz6hUUeoAWSExDIDE4ewqvoNBLeAouwRmE58diQprY4PR16C9f-17KGJufpzFbxjLKL8khljs3SvNrLLLC8_zv2c2SIsVlRzC54DxUwhmyzW_WIy5XWldKTEYV9kjLPVFnSFsnEEn0Bob0LRIolErrUgk2lGuLBKrkjag1pK0TqMtm7MT53XivpRUsAEM8MSxjN5YJg5VgiDfRa-xmwVowxJHz-o9ufLhGPLRujJltrRofbhDYNGFq6gOYofZj" }, "key": "orders" } ]
Example error response for a bad request missing keys.
{ "error": "bad_request", "reason": "`keys` member must exist." }
Example error response for a bad request missing keys.
{ "error": "bad_request", "reason": "`keys` member must exist." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Delete a database
Deletes the specified database and all documents and attachments contained within it. To avoid deleting a database, the server responds with a 400 HTTP status code when the request URL includes a ?rev=
parameter. This response suggests that a user wanted to delete a document but forgot to add the document ID to the URL.
Deletes the specified database and all documents and attachments contained within it. To avoid deleting a database, the server responds with a 400 HTTP status code when the request URL includes a ?rev=
parameter. This response suggests that a user wanted to delete a document but forgot to add the document ID to the URL.
Deletes the specified database and all documents and attachments contained within it. To avoid deleting a database, the server responds with a 400 HTTP status code when the request URL includes a ?rev=
parameter. This response suggests that a user wanted to delete a document but forgot to add the document ID to the URL.
Deletes the specified database and all documents and attachments contained within it. To avoid deleting a database, the server responds with a 400 HTTP status code when the request URL includes a ?rev=
parameter. This response suggests that a user wanted to delete a document but forgot to add the document ID to the URL.
Deletes the specified database and all documents and attachments contained within it. To avoid deleting a database, the server responds with a 400 HTTP status code when the request URL includes a ?rev=
parameter. This response suggests that a user wanted to delete a document but forgot to add the document ID to the URL.
DELETE /{db}
(cloudant *CloudantV1) DeleteDatabase(deleteDatabaseOptions *DeleteDatabaseOptions) (result *Ok, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) DeleteDatabaseWithContext(ctx context.Context, deleteDatabaseOptions *DeleteDatabaseOptions) (result *Ok, response *core.DetailedResponse, err error)
ServiceCall<Ok> deleteDatabase(DeleteDatabaseOptions deleteDatabaseOptions)
deleteDatabase(params)
delete_database(
self,
db: str,
**kwargs,
) -> DetailedResponse
Request
Instantiate the DeleteDatabaseOptions
struct and set the fields to provide parameter values for the DeleteDatabase
method.
Use the DeleteDatabaseOptions.Builder
to create a DeleteDatabaseOptions
object that contains the parameter values for the deleteDatabase
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The DeleteDatabase options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
The deleteDatabase options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X DELETE "$SERVICE_URL/$DB_NAME"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } deleteDatabaseOptions := service.NewDeleteDatabaseOptions( "<db-name>", ) ok, response, err := service.DeleteDatabase(deleteDatabaseOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(ok, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.DeleteDatabaseOptions; import com.ibm.cloud.cloudant.v1.model.Ok;
Cloudant service = Cloudant.newInstance(); DeleteDatabaseOptions databaseOptions = new DeleteDatabaseOptions.Builder() .db("<db-name>") .build(); Ok response = service.deleteDatabase(databaseOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.deleteDatabase({db: '<db-name>'}).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.delete_database(db='<db-name>').get_result() print(response)
Response
Schema for an OK result.
ok
Schema for an OK result.
ok.
Schema for an OK result.
ok.
Schema for an OK result.
ok.
Schema for an OK result.
ok.
Status Code
HTTP response for Ok operations.
HTTP response for Ok operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example Ok response.
{ "ok": true }
Example Ok response.
{ "ok": true }
Example Ok response.
{ "ok": true }
Example Ok response.
{ "ok": true }
Example error response for a bad request deleting a database with a document rev.
{ "error": "bad_request", "reason": "You tried to DELETE a database with a ?=rev parameter. Did you mean to DELETE a document instead?" }
Example error response for a bad request deleting a database with a document rev.
{ "error": "bad_request", "reason": "You tried to DELETE a database with a ?=rev parameter. Did you mean to DELETE a document instead?" }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve information about a database
Retrieve detailed information about the database.
Retrieve detailed information about the database.
Retrieve detailed information about the database.
Retrieve detailed information about the database.
Retrieve detailed information about the database.
GET /{db}
(cloudant *CloudantV1) GetDatabaseInformation(getDatabaseInformationOptions *GetDatabaseInformationOptions) (result *DatabaseInformation, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) GetDatabaseInformationWithContext(ctx context.Context, getDatabaseInformationOptions *GetDatabaseInformationOptions) (result *DatabaseInformation, response *core.DetailedResponse, err error)
ServiceCall<DatabaseInformation> getDatabaseInformation(GetDatabaseInformationOptions getDatabaseInformationOptions)
getDatabaseInformation(params)
get_database_information(
self,
db: str,
**kwargs,
) -> DetailedResponse
Request
Instantiate the GetDatabaseInformationOptions
struct and set the fields to provide parameter values for the GetDatabaseInformation
method.
Use the GetDatabaseInformationOptions.Builder
to create a GetDatabaseInformationOptions
object that contains the parameter values for the getDatabaseInformation
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The GetDatabaseInformation options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
The getDatabaseInformation options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/products"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } getDatabaseInformationOptions := service.NewGetDatabaseInformationOptions( "products", ) databaseInformation, response, err := service.GetDatabaseInformation(getDatabaseInformationOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(databaseInformation, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.DatabaseInformation; import com.ibm.cloud.cloudant.v1.model.GetDatabaseInformationOptions;
Cloudant service = Cloudant.newInstance(); GetDatabaseInformationOptions databaseInfoOptions = new GetDatabaseInformationOptions.Builder() .db("products") .build(); DatabaseInformation response = service.getDatabaseInformation(databaseInfoOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.getDatabaseInformation({db: 'products'}).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.get_database_information(db='products').get_result() print(response)
Response
Schema for information about a database.
Schema for database cluster information.
True if the database compaction routine is operating on this database.
Schema for a database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
The version of the physical format used for the data when it is stored on disk.
Possible values: 1 ≤ value ≤ 9007199254740992
A count of the documents in the specified database.
Possible values: 0 ≤ value ≤ 9007199254740992
Number of deleted documents
Possible values: 0 ≤ value ≤ 9007199254740992
An opaque string to detect whether a database has been recreated. The field name is for compatibility with old replicator versions. Do not use the value to infer timing infromation. Typically only used by replicators.
Possible values: 1 ≤ length ≤ 10, Value must match regular expression
^\d+$
Schema for database properties.
An opaque string that describes the purge state of the database. Do not rely on this string for counting the number of purge operations.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Schema for size information of content.
An opaque string that describes the state of the database. Do not rely on this string for counting the number of updates.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
An opaque string that describes the committed state of the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
An opaque string that describes the compaction state of the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
The engine used for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Information about database's partitioned indexes.
The UUID of the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Schema for information about a database.
Schema for database cluster information.
- Cluster
Schema for the number of replicas of a database in a cluster. The cluster is using the default value and it cannot be changed by the user.
Possible values: value = 3
Schema for the number of shards in a database. Each shard is a partition of the hash value range.
Possible values: 1 ≤ value ≤ 120
Read quorum. The number of consistent copies of a document that need to be read before a successful reply.
Possible values: 1 ≤ value ≤ 3
Write quorum. The number of copies of a document that need to be written before a successful reply.
Possible values: 1 ≤ value ≤ 3
An opaque string that describes the committed state of the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
True if the database compaction routine is operating on this database.
An opaque string that describes the compaction state of the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
The version of the physical format used for the data when it is stored on disk.
Possible values: 1 ≤ value ≤ 9007199254740992
A count of the documents in the specified database.
Possible values: 0 ≤ value ≤ 9007199254740992
Number of deleted documents.
Possible values: 0 ≤ value ≤ 9007199254740992
The engine used for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An opaque string to detect whether a database has been recreated. The field name is for compatibility with old replicator versions. Do not use the value to infer timing infromation. Typically only used by replicators.
Possible values: 1 ≤ length ≤ 10, Value must match regular expression
/^\\d+$/
Information about database's partitioned indexes.
- PartitionedIndexes
Total number of partitioned indexes in the database.
Possible values: 0 ≤ value ≤ 10
Number of partitioned indexes by type.
- Indexes
Number of partitioned indexes of search type.
Possible values: 0 ≤ value ≤ 10
Number of partitioned indexes of view type.
Possible values: 0 ≤ value ≤ 10
Maximum allowed number of partitioned indexes in the database.
Possible values: 0 ≤ value ≤ 10
Schema for database properties.
- Props
The value is
true
for a partitioned database.
Schema for size information of content.
- Sizes
The active size of the content, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740992
The total uncompressed size of the content, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740992
The total size of the content as stored on disk, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740992
An opaque string that describes the state of the database. Do not rely on this string for counting the number of updates.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
The UUID of the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for information about a database.
Schema for database cluster information.
- cluster
Schema for the number of replicas of a database in a cluster. The cluster is using the default value and it cannot be changed by the user.
Possible values: value = 3
Schema for the number of shards in a database. Each shard is a partition of the hash value range.
Possible values: 1 ≤ value ≤ 120
Read quorum. The number of consistent copies of a document that need to be read before a successful reply.
Possible values: 1 ≤ value ≤ 3
Write quorum. The number of copies of a document that need to be written before a successful reply.
Possible values: 1 ≤ value ≤ 3
An opaque string that describes the committed state of the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
True if the database compaction routine is operating on this database.
An opaque string that describes the compaction state of the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
The version of the physical format used for the data when it is stored on disk.
Possible values: 1 ≤ value ≤ 9007199254740992
A count of the documents in the specified database.
Possible values: 0 ≤ value ≤ 9007199254740992
Number of deleted documents.
Possible values: 0 ≤ value ≤ 9007199254740992
The engine used for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An opaque string to detect whether a database has been recreated. The field name is for compatibility with old replicator versions. Do not use the value to infer timing infromation. Typically only used by replicators.
Possible values: 1 ≤ length ≤ 10, Value must match regular expression
/^\\d+$/
Information about database's partitioned indexes.
- partitionedIndexes
Total number of partitioned indexes in the database.
Possible values: 0 ≤ value ≤ 10
Number of partitioned indexes by type.
- indexes
Number of partitioned indexes of search type.
Possible values: 0 ≤ value ≤ 10
Number of partitioned indexes of view type.
Possible values: 0 ≤ value ≤ 10
Maximum allowed number of partitioned indexes in the database.
Possible values: 0 ≤ value ≤ 10
Schema for database properties.
- props
The value is
true
for a partitioned database.
Schema for size information of content.
- sizes
The active size of the content, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740992
The total uncompressed size of the content, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740992
The total size of the content as stored on disk, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740992
An opaque string that describes the state of the database. Do not rely on this string for counting the number of updates.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
The UUID of the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for information about a database.
Schema for database cluster information.
- cluster
Schema for the number of replicas of a database in a cluster. The cluster is using the default value and it cannot be changed by the user.
Possible values: value = 3
Schema for the number of shards in a database. Each shard is a partition of the hash value range.
Possible values: 1 ≤ value ≤ 120
Read quorum. The number of consistent copies of a document that need to be read before a successful reply.
Possible values: 1 ≤ value ≤ 3
Write quorum. The number of copies of a document that need to be written before a successful reply.
Possible values: 1 ≤ value ≤ 3
An opaque string that describes the committed state of the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
True if the database compaction routine is operating on this database.
An opaque string that describes the compaction state of the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
The version of the physical format used for the data when it is stored on disk.
Possible values: 1 ≤ value ≤ 9007199254740992
A count of the documents in the specified database.
Possible values: 0 ≤ value ≤ 9007199254740992
Number of deleted documents.
Possible values: 0 ≤ value ≤ 9007199254740992
The engine used for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An opaque string to detect whether a database has been recreated. The field name is for compatibility with old replicator versions. Do not use the value to infer timing infromation. Typically only used by replicators.
Possible values: 1 ≤ length ≤ 10, Value must match regular expression
/^\\d+$/
Information about database's partitioned indexes.
- partitionedIndexes
Total number of partitioned indexes in the database.
Possible values: 0 ≤ value ≤ 10
Number of partitioned indexes by type.
- indexes
Number of partitioned indexes of search type.
Possible values: 0 ≤ value ≤ 10
Number of partitioned indexes of view type.
Possible values: 0 ≤ value ≤ 10
Maximum allowed number of partitioned indexes in the database.
Possible values: 0 ≤ value ≤ 10
Schema for database properties.
- props
The value is
true
for a partitioned database.
Schema for size information of content.
- sizes
The active size of the content, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740992
The total uncompressed size of the content, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740992
The total size of the content as stored on disk, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740992
An opaque string that describes the state of the database. Do not rely on this string for counting the number of updates.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
The UUID of the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for information about a database.
Schema for database cluster information.
- cluster
Schema for the number of replicas of a database in a cluster. The cluster is using the default value and it cannot be changed by the user.
Possible values: value = 3
Schema for the number of shards in a database. Each shard is a partition of the hash value range.
Possible values: 1 ≤ value ≤ 120
Read quorum. The number of consistent copies of a document that need to be read before a successful reply.
Possible values: 1 ≤ value ≤ 3
Write quorum. The number of copies of a document that need to be written before a successful reply.
Possible values: 1 ≤ value ≤ 3
An opaque string that describes the committed state of the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
True if the database compaction routine is operating on this database.
An opaque string that describes the compaction state of the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
The version of the physical format used for the data when it is stored on disk.
Possible values: 1 ≤ value ≤ 9007199254740992
A count of the documents in the specified database.
Possible values: 0 ≤ value ≤ 9007199254740992
Number of deleted documents.
Possible values: 0 ≤ value ≤ 9007199254740992
The engine used for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An opaque string to detect whether a database has been recreated. The field name is for compatibility with old replicator versions. Do not use the value to infer timing infromation. Typically only used by replicators.
Possible values: 1 ≤ length ≤ 10, Value must match regular expression
/^\\d+$/
Information about database's partitioned indexes.
- partitioned_indexes
Total number of partitioned indexes in the database.
Possible values: 0 ≤ value ≤ 10
Number of partitioned indexes by type.
- indexes
Number of partitioned indexes of search type.
Possible values: 0 ≤ value ≤ 10
Number of partitioned indexes of view type.
Possible values: 0 ≤ value ≤ 10
Maximum allowed number of partitioned indexes in the database.
Possible values: 0 ≤ value ≤ 10
Schema for database properties.
- props
The value is
true
for a partitioned database.
Schema for size information of content.
- sizes
The active size of the content, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740992
The total uncompressed size of the content, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740992
The total size of the content as stored on disk, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740992
An opaque string that describes the state of the database. Do not rely on this string for counting the number of updates.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
The UUID of the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Status Code
HTTP response for DatabaseInformation.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example DatabaseInformation response.
{ "cluster": { "n": 3, "q": 8, "r": 2, "w": 2 }, "compact_running": false, "db_name": "products", "disk_format_version": 8, "doc_count": 5, "doc_del_count": 1, "instance_start_time": "0", "partitioned_indexes": { "count": 4, "indexes": { "search": 2, "view": 2 }, "limit": 10 }, "props": { "partitioned": true }, "purge_seq": "8-g1AAAALReJyd0T8OgjAUBvCKjq6ewM2BQPyz6hUUeoAWSExDIDE4ewqvoNBLeAouwRmE58diQprY4PR16C9f-17KGJufpzFbxjLKL8khljs3SvNrLLLC8_zv2c2SIsVlRzC54DxUwhmyzW_WIy5XWldKTEYV9kjLPVFnSFsnEEn0Bob0LRIolErrUgk2lGuLBKrkjag1pK0TqMtm7MT53XivpRUsAEM8MSxjN5YJg5VgiDfRa-xmwVowxJHz-o9ufLhGPLRujJltrRofbhDYNGFq6gOYofZj", "sizes": { "active": 8887, "external": 1872, "file": 685680 }, "update_seq": "89-g1AAAAIjeJzLYWBg4MhgTmHQTklKzi9KdUhJMtbLzCtJTS9KLMnMzysuSS0uMTAw1EvOyS9NScwr0ctLLckBamLKYwGSDA-A1H8gyErkRDXFkBRTDkBMuY9hihEppiyAmLI_K1GQAh81QEyZn5XIRZaPkhKAZFI9tjAh0jdJDiAT4rGZQKRPkhRAJtiDTRAkyxeJDEnyEAdkAQCgLLsf" }
Example DatabaseInformation response.
{ "cluster": { "n": 3, "q": 8, "r": 2, "w": 2 }, "compact_running": false, "db_name": "products", "disk_format_version": 8, "doc_count": 5, "doc_del_count": 1, "instance_start_time": "0", "partitioned_indexes": { "count": 4, "indexes": { "search": 2, "view": 2 }, "limit": 10 }, "props": { "partitioned": true }, "purge_seq": "8-g1AAAALReJyd0T8OgjAUBvCKjq6ewM2BQPyz6hUUeoAWSExDIDE4ewqvoNBLeAouwRmE58diQprY4PR16C9f-17KGJufpzFbxjLKL8khljs3SvNrLLLC8_zv2c2SIsVlRzC54DxUwhmyzW_WIy5XWldKTEYV9kjLPVFnSFsnEEn0Bob0LRIolErrUgk2lGuLBKrkjag1pK0TqMtm7MT53XivpRUsAEM8MSxjN5YJg5VgiDfRa-xmwVowxJHz-o9ufLhGPLRujJltrRofbhDYNGFq6gOYofZj", "sizes": { "active": 8887, "external": 1872, "file": 685680 }, "update_seq": "89-g1AAAAIjeJzLYWBg4MhgTmHQTklKzi9KdUhJMtbLzCtJTS9KLMnMzysuSS0uMTAw1EvOyS9NScwr0ctLLckBamLKYwGSDA-A1H8gyErkRDXFkBRTDkBMuY9hihEppiyAmLI_K1GQAh81QEyZn5XIRZaPkhKAZFI9tjAh0jdJDiAT4rGZQKRPkhRAJtiDTRAkyxeJDEnyEAdkAQCgLLsf" }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a database does not exist.
{ "error": "not_found", "reason": "Database does not exist." }
Example error response for a database does not exist.
{ "error": "not_found", "reason": "Database does not exist." }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve the HTTP headers for a database
Returns the HTTP headers that contain a minimal amount of information about the specified database. Since the response body is empty, using the HEAD method is a lightweight way to check if the database exists or not.
Returns the HTTP headers that contain a minimal amount of information about the specified database. Since the response body is empty, using the HEAD method is a lightweight way to check if the database exists or not.
Returns the HTTP headers that contain a minimal amount of information about the specified database. Since the response body is empty, using the HEAD method is a lightweight way to check if the database exists or not.
Returns the HTTP headers that contain a minimal amount of information about the specified database. Since the response body is empty, using the HEAD method is a lightweight way to check if the database exists or not.
Returns the HTTP headers that contain a minimal amount of information about the specified database. Since the response body is empty, using the HEAD method is a lightweight way to check if the database exists or not.
HEAD /{db}
(cloudant *CloudantV1) HeadDatabase(headDatabaseOptions *HeadDatabaseOptions) (response *core.DetailedResponse, err error)
(cloudant *CloudantV1) HeadDatabaseWithContext(ctx context.Context, headDatabaseOptions *HeadDatabaseOptions) (response *core.DetailedResponse, err error)
ServiceCall<Void> headDatabase(HeadDatabaseOptions headDatabaseOptions)
headDatabase(params)
head_database(
self,
db: str,
**kwargs,
) -> DetailedResponse
Request
Instantiate the HeadDatabaseOptions
struct and set the fields to provide parameter values for the HeadDatabase
method.
Use the HeadDatabaseOptions.Builder
to create a HeadDatabaseOptions
object that contains the parameter values for the headDatabase
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The HeadDatabase options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
The headDatabase options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
curl -H "Authorization: Bearer $API_BEARER_TOKEN" --head "$SERVICE_URL/products"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } headDatabaseOptions := service.NewHeadDatabaseOptions( "products", ) response, err := service.HeadDatabase(headDatabaseOptions) if err != nil { panic(err) } fmt.Println(response.StatusCode)
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.HeadDatabaseOptions;
Cloudant service = Cloudant.newInstance(); HeadDatabaseOptions databaseOptions = new HeadDatabaseOptions.Builder() .db("products") .build(); int statusCode = service.headDatabase(databaseOptions).execute().getStatusCode(); System.out.println(statusCode);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.headDatabase({db: 'products'}).then(response => { console.log(response.status); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.head_database(db='products') print(response.get_status_code())
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for DatabaseInformation.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Create a database
Create a new database with the requested properties.
Create a new database with the requested properties.
Create a new database with the requested properties.
Create a new database with the requested properties.
Create a new database with the requested properties.
PUT /{db}
(cloudant *CloudantV1) PutDatabase(putDatabaseOptions *PutDatabaseOptions) (result *Ok, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PutDatabaseWithContext(ctx context.Context, putDatabaseOptions *PutDatabaseOptions) (result *Ok, response *core.DetailedResponse, err error)
ServiceCall<Ok> putDatabase(PutDatabaseOptions putDatabaseOptions)
putDatabase(params)
put_database(
self,
db: str,
*,
partitioned: Optional[bool] = None,
q: Optional[int] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the PutDatabaseOptions
struct and set the fields to provide parameter values for the PutDatabase
method.
Use the PutDatabaseOptions.Builder
to create a PutDatabaseOptions
object that contains the parameter values for the putDatabase
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Query Parameters
Query parameter to specify whether to enable database partitions when creating a database.
Before using read the FAQs to understand the limitations and appropriate use cases.
Default:
false
The number of replicas of the database in the cluster. The default is 3, unless overridden in the
cluster config
.Possible values: value = 3
Default:
3
The number of shards in the database. Each shard is a partition of the hash value range. Cloudant recommends using the default value for most databases. However, if your database is expected to be larger than 250 GB or have a lot of indexes, you may need to adjust the settings. In these cases, it's best to reach out to IBM Cloudant customer support for guidance on how to meet your specific needs and requirements.
Possible values: 1 ≤ value ≤ 120
Default:
16
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The PutDatabase options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Query parameter to specify whether to enable database partitions when creating a database.
Before using read the FAQs to understand the limitations and appropriate use cases.
Default:
false
The number of shards in the database. Each shard is a partition of the hash value range. Cloudant recommends using the default value for most databases. However, if your database is expected to be larger than 250 GB or have a lot of indexes, you may need to adjust the settings. In these cases, it's best to reach out to IBM Cloudant customer support for guidance on how to meet your specific needs and requirements.
Possible values: 1 ≤ value ≤ 120
Default:
16
The putDatabase options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Query parameter to specify whether to enable database partitions when creating a database.
Before using read the FAQs to understand the limitations and appropriate use cases.
Default:
false
The number of shards in the database. Each shard is a partition of the hash value range. Cloudant recommends using the default value for most databases. However, if your database is expected to be larger than 250 GB or have a lot of indexes, you may need to adjust the settings. In these cases, it's best to reach out to IBM Cloudant customer support for guidance on how to meet your specific needs and requirements.
Possible values: 1 ≤ value ≤ 120
Default:
16
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Query parameter to specify whether to enable database partitions when creating a database.
Before using read the FAQs to understand the limitations and appropriate use cases.
Default:
false
The number of shards in the database. Each shard is a partition of the hash value range. Cloudant recommends using the default value for most databases. However, if your database is expected to be larger than 250 GB or have a lot of indexes, you may need to adjust the settings. In these cases, it's best to reach out to IBM Cloudant customer support for guidance on how to meet your specific needs and requirements.
Possible values: 1 ≤ value ≤ 120
Default:
16
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Query parameter to specify whether to enable database partitions when creating a database.
Before using read the FAQs to understand the limitations and appropriate use cases.
Default:
false
The number of shards in the database. Each shard is a partition of the hash value range. Cloudant recommends using the default value for most databases. However, if your database is expected to be larger than 250 GB or have a lot of indexes, you may need to adjust the settings. In these cases, it's best to reach out to IBM Cloudant customer support for guidance on how to meet your specific needs and requirements.
Possible values: 1 ≤ value ≤ 120
Default:
16
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X PUT "$SERVICE_URL/products"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } putDatabaseOptions := service.NewPutDatabaseOptions( "events", ) putDatabaseOptions.SetPartitioned(true) ok, response, err := service.PutDatabase(putDatabaseOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(ok, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.Ok; import com.ibm.cloud.cloudant.v1.model.PutDatabaseOptions;
Cloudant service = Cloudant.newInstance(); PutDatabaseOptions databaseOptions = new PutDatabaseOptions.Builder() .db("events") .partitioned(true) .build(); Ok response = service.putDatabase(databaseOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.putDatabase({ db: 'events', partitioned: true }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.put_database(db='events', partitioned=True).get_result() print(response)
Response
Schema for an OK result.
ok
Schema for an OK result.
ok.
Schema for an OK result.
ok.
Schema for an OK result.
ok.
Schema for an OK result.
ok.
Status Code
HTTP response for database creation operation.
HTTP response for database creation operation.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for precondition failed.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example Ok response.
{ "ok": true }
Example Ok response.
{ "ok": true }
Example Ok response.
{ "ok": true }
Example Ok response.
{ "ok": true }
Example error response for an invalid database name.
{ "error": "illegal_database_name", "reason": "Only lowercase characters (a-z), digits (0-9), and any of the characters _, $, (, ), +, -, and / are allowed. Must begin with a letter." }
Example error response for an invalid database name.
{ "error": "illegal_database_name", "reason": "Only lowercase characters (a-z), digits (0-9), and any of the characters _, $, (, ), +, -, and / are allowed. Must begin with a letter." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a database already existing.
{ "error": "file_exists", "reason": "The database could not be created, the file already exists." }
Example error response for a database already existing.
{ "error": "file_exists", "reason": "The database could not be created, the file already exists." }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Query the database document changes feed (GET)
Returns a sorted list of changes made to documents in the database, in time order of application. Only the most recent change for a specific document is included in the list. For example, if you add fields to a document and then delete them, an API client that checks for changes might not know about the intermediate state of added documents. These checks listen for updates to the database for post processing or synchronization, and for practical purposes, a continuously connected _changes
feed is a reasonable approach for generating a real-time log for most applications.
Note
Before using the changes feed read the FAQs to understand the limitations and appropriate use cases.
To use some filter types you must use the
POST
version of this request.
GET /{db}/_changes
Request
Custom Headers
Header parameter to specify the ID of the last events received by the server on a previous connection. Overrides
since
query parameter.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Query Parameters
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Query parameter to specify whether to return the documents in descending by key order.
Default:
false
Query parameter to specify a JSON array list of document IDs to restrict the changes feed to. Used with the
_doc_ids
filter. Since length of URL is limited, it is better to use POST/{db}/_changes
instead.Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].*$
Query parameter to specify the changes feed type.
Allowable values: [
continuous
,eventsource
,longpoll
,normal
]Default:
normal
Query parameter to specify a filter to emit only specific events from the changes stream.
The built-in filter types are:
_design
- Returns only changes to design documents._doc_ids
- Returns changes for documents with an ID matching one specified indoc_ids
request body parameter. (POST
only)_selector
- Returns changes for documents that match theselector
request body parameter. The selector syntax is the same as used for_find
. (POST
only)_view
- Returns changes for documents that match an existing map function in the view specified by the query parameterview
.
Additionally, the value can be the name of a JS filter function from a design document. For example:
design_doc/filtername
.Note: For better performance use the built-in
_selector
,_design
or_doc_ids
filters rather than JS based_view
or design document filters. If you need to pass values to change the filtered content use the_selector
filter type.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^_design|_docs_ids|_selector|_view|.*\/.*$
Query parameter to specify the period in milliseconds after which an empty line is sent in the results. Off by default and only applicable for
continuous
andeventsource
feeds. Overrides any timeout to keep the feed alive indefinitely. May also betrue
to use a value of60000
.Note: Delivery of heartbeats cannot be relied on at specific intervals. If your application runs in an environment where idle network connections may break,
heartbeat
is not suitable as a keepalive mechanism. Instead, consider one of the following options:- Use the
timeout
parameter with a value that is compatible with your network environment. - Switch to scheduled usage of one of the non-continuous changes feed types
(
normal
orlongpoll
). - Use TCP keepalive.
Possible values: 1 ≤ value ≤ 60000
- Use the
Query parameter to specify whether to include the full content of the documents in the response.
Default:
false
Query parameter to specify the ID of the last events received by the server on a previous connection. Alias of
Last-Event-ID
header.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify that the update seq should only be calculated with every Nth result returned. When fetching changes in a batch, setting
seq_interval=<batch size>
, where <batch size> is the number of results requested per batch, load can be reduced on the source database as computing the seq value across many shards (especially in highly-sharded databases) is expensive.Possible values: 1 ≤ value ≤ 4294967295
Query parameter to specify to start the results from the change immediately after the given update sequence. Can be a valid update sequence or
now
value. Default is0
i.e. all changes.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Example:
0
Query parameter to specify how many revisions are returned in the changes array. The default,
main_only
, will only return the current "winning" revision; all_docs will return all leaf revisions (including conflicts and deleted former conflicts).Allowable values: [
main_only
,all_docs
]Default:
main_only
Query parameter to specify the maximum period in milliseconds to wait for a change before the response is sent, even if there are no results. Only applicable for
longpoll
orcontinuous
feeds. Default value is specified byhttpd/changes_timeout
configuration option. Note that60000
value is also the default maximum timeout to prevent undetected dead connections.Possible values: 0 ≤ value ≤ 60000
Default:
60000
Query parameter to specify a view function as a filter. Documents pass the filter if the view's map function emits at least one record for them.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].*$
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/orders/_changes?limit=1"
Response
Schema for normal changes feed result.
last_seq
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
pending
Possible values: 0 ≤ value ≤ 9007199254740992
results
Possible values: 0 ≤ number of items ≤ 4294967295
Status Code
HTTP response for
/{db}/_changes
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example ChangesResult response.
{ "last_seq": "7-g1AAAAPveJy1kk9OAjEYxSuYGBO3nsCdC9LOP5yVXkGhB-jXdoKTsSQG1p7CKyj0Ep6CS3AGob5hwYSNMJOwek3T971fXr-KMXYz6Rt2Z0hP3-2ToWygq-ncKDfjXOzPA2dnFR73FKNbKcelYoe2-H9bbZJ07_2ynPTVxRvurjTPhU6i06YcpkVH0hDk6TGEbWtOmAKBddRwUpw-iKE4ByeCxlR6v2jNCdOSPkLY1JxsxykyLlKuDLueO2OLV2dNq6-tx23dJXuR8rMtD2wj2CDfqL5m6u2Ycp1HQ5N26e4ILaIWiIL8hvDTgXcDG-RZylXDm8V5IbLkPLwodgX58n7dgRfFriHYz9DsZpqQtQWdNqn8A1TdTOE", "pending": 3, "results": [ { "changes": [ { "rev": "7-7a5191bfeb2f6eed6b3b6fa83f4810f5" } ], "deleted": true, "id": "0007741142412418284", "seq": "1-g1AAAAMFeJydkcENgjAUhquYePHqBN48EEBj4klXUOgAbSExDUJi8OwUrqDQJZyCJZhBqD8XE0Iiwulvmvf1e68vJITMToZPFj4X8SXY-3xjijC--ixKLMv-ns0oSEIUjxnhc0o9yUgTW_3GaojypVKZPBlsdMbdVFhbW6yd_15p2pwOG0SK77SuevcJSHP06rbILicgj0ul0t5OQBm_aV22yI5l1FAVTciR0ntfKzAXGOKJz-prBpYCQ7y1fg1wl8AQB0rzAW4MnCMeShUD3Bi4QGDTGrT8AMkPBk0" } ] }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve HTTP headers for the database document changes feed (GET)
Retrieves the HTTP headers for the database document changes feed (GET).
HEAD /{db}/_changes
Request
Custom Headers
Header parameter to specify the ID of the last events received by the server on a previous connection. Overrides
since
query parameter.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the ETag for a resource.
Examples:Double quoted base64 encoded attachment digest.
"MEHlNHhicVt9efOzyvsz0Q=="
Double quoted document revision identifier.
"2-240fc93fad07083c338c7e0ea55791b3"
Double quoted local document tag.
"6APCCGX4B76OFFD5972MSBFHD"
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for
/{db}/_changes
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Query the database document changes feed
Requests the database changes feed in the same way as GET /{db}/_changes
does. It is widely used with the filter
query parameter because it allows one to pass more information to the filter.
Note
Before using the changes feed read the FAQs to understand the limitations and appropriate use cases.
If you need to pass parameters to dynamically change the filtered
content use the _selector
filter type for better performance and
compatibility. The SDKs have full support for change requests using
selector filters, but don't support passing parameters to design
document filters.
Requests the database changes feed in the same way as GET /{db}/_changes
does. It is widely used with the filter
query parameter because it allows one to pass more information to the filter.
Note
Before using the changes feed read the FAQs to understand the limitations and appropriate use cases.
If you need to pass parameters to dynamically change the filtered content use the _selector
filter type for better performance and compatibility. The SDKs have full support for change requests using selector filters, but don't support passing parameters to design document filters.
Requests the database changes feed in the same way as GET /{db}/_changes
does. It is widely used with the filter
query parameter because it allows one to pass more information to the filter.
Note
Before using the changes feed read the FAQs to understand the limitations and appropriate use cases.
If you need to pass parameters to dynamically change the filtered content use the _selector
filter type for better performance and compatibility. The SDKs have full support for change requests using selector filters, but don't support passing parameters to design document filters.
Requests the database changes feed in the same way as GET /{db}/_changes
does. It is widely used with the filter
query parameter because it allows one to pass more information to the filter.
Note
Before using the changes feed read the FAQs to understand the limitations and appropriate use cases.
If you need to pass parameters to dynamically change the filtered content use the _selector
filter type for better performance and compatibility. The SDKs have full support for change requests using selector filters, but don't support passing parameters to design document filters.
Requests the database changes feed in the same way as GET /{db}/_changes
does. It is widely used with the filter
query parameter because it allows one to pass more information to the filter.
Note
Before using the changes feed read the FAQs to understand the limitations and appropriate use cases.
If you need to pass parameters to dynamically change the filtered content use the _selector
filter type for better performance and compatibility. The SDKs have full support for change requests using selector filters, but don't support passing parameters to design document filters.
POST /{db}/_changes
(cloudant *CloudantV1) PostChanges(postChangesOptions *PostChangesOptions) (result *ChangesResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostChangesWithContext(ctx context.Context, postChangesOptions *PostChangesOptions) (result *ChangesResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostChangesAsStream(postChangesOptions *PostChangesOptions) (result io.ReadCloser, response *core.DetailedResponse, err error)
ServiceCall<ChangesResult> postChanges(PostChangesOptions postChangesOptions)
ServiceCall<InputStream> postChangesAsStream(PostChangesOptions postChangesOptions)
postChanges(params)
postChangesAsStream(params)
post_changes(
self,
db: str,
*,
doc_ids: Optional[List[str]] = None,
fields: Optional[List[str]] = None,
selector: Optional[dict] = None,
last_event_id: Optional[str] = None,
att_encoding_info: Optional[bool] = None,
attachments: Optional[bool] = None,
conflicts: Optional[bool] = None,
descending: Optional[bool] = None,
feed: Optional[str] = None,
filter: Optional[str] = None,
heartbeat: Optional[int] = None,
include_docs: Optional[bool] = None,
limit: Optional[int] = None,
seq_interval: Optional[int] = None,
since: Optional[str] = None,
style: Optional[str] = None,
timeout: Optional[int] = None,
view: Optional[str] = None,
**kwargs,
) -> DetailedResponse
post_changes_as_stream(
self,
db: str,
*,
doc_ids: Optional[List[str]] = None,
fields: Optional[List[str]] = None,
selector: Optional[dict] = None,
last_event_id: Optional[str] = None,
att_encoding_info: Optional[bool] = None,
attachments: Optional[bool] = None,
conflicts: Optional[bool] = None,
descending: Optional[bool] = None,
feed: Optional[str] = None,
filter: Optional[str] = None,
heartbeat: Optional[int] = None,
include_docs: Optional[bool] = None,
limit: Optional[int] = None,
seq_interval: Optional[int] = None,
since: Optional[str] = None,
style: Optional[str] = None,
timeout: Optional[int] = None,
view: Optional[str] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the PostChangesOptions
struct and set the fields to provide parameter values for the PostChanges
method.
Use the PostChangesOptions.Builder
to create a PostChangesOptions
object that contains the parameter values for the postChanges
method.
Custom Headers
Header parameter to specify the ID of the last events received by the server on a previous connection. Overrides
since
query parameter.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Query Parameters
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Query parameter to specify whether to return the documents in descending by key order.
Default:
false
Query parameter to specify the changes feed type.
Allowable values: [
continuous
,eventsource
,longpoll
,normal
]Default:
normal
Query parameter to specify a filter to emit only specific events from the changes stream.
The built-in filter types are:
_design
- Returns only changes to design documents._doc_ids
- Returns changes for documents with an ID matching one specified indoc_ids
request body parameter. (POST
only)_selector
- Returns changes for documents that match theselector
request body parameter. The selector syntax is the same as used for_find
. (POST
only)_view
- Returns changes for documents that match an existing map function in the view specified by the query parameterview
.
Additionally, the value can be the name of a JS filter function from a design document. For example:
design_doc/filtername
.Note: For better performance use the built-in
_selector
,_design
or_doc_ids
filters rather than JS based_view
or design document filters. If you need to pass values to change the filtered content use the_selector
filter type.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^_design|_docs_ids|_selector|_view|.*\/.*$
Query parameter to specify the period in milliseconds after which an empty line is sent in the results. Off by default and only applicable for
continuous
andeventsource
feeds. Overrides any timeout to keep the feed alive indefinitely. May also betrue
to use a value of60000
.Note: Delivery of heartbeats cannot be relied on at specific intervals. If your application runs in an environment where idle network connections may break,
heartbeat
is not suitable as a keepalive mechanism. Instead, consider one of the following options:- Use the
timeout
parameter with a value that is compatible with your network environment. - Switch to scheduled usage of one of the non-continuous changes feed types
(
normal
orlongpoll
). - Use TCP keepalive.
Possible values: 1 ≤ value ≤ 60000
- Use the
Query parameter to specify whether to include the full content of the documents in the response.
Default:
false
Query parameter to specify the ID of the last events received by the server on a previous connection. Alias of
Last-Event-ID
header.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify that the update seq should only be calculated with every Nth result returned. When fetching changes in a batch, setting
seq_interval=<batch size>
, where <batch size> is the number of results requested per batch, load can be reduced on the source database as computing the seq value across many shards (especially in highly-sharded databases) is expensive.Possible values: 1 ≤ value ≤ 4294967295
Query parameter to specify to start the results from the change immediately after the given update sequence. Can be a valid update sequence or
now
value. Default is0
i.e. all changes.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Example:
0
Query parameter to specify how many revisions are returned in the changes array. The default,
main_only
, will only return the current "winning" revision; all_docs will return all leaf revisions (including conflicts and deleted former conflicts).Allowable values: [
main_only
,all_docs
]Default:
main_only
Query parameter to specify the maximum period in milliseconds to wait for a change before the response is sent, even if there are no results. Only applicable for
longpoll
orcontinuous
feeds. Default value is specified byhttpd/changes_timeout
configuration option. Note that60000
value is also the default maximum timeout to prevent undetected dead connections.Possible values: 0 ≤ value ≤ 60000
Default:
60000
Query parameter to specify a view function as a filter. Documents pass the filter if the view's map function emits at least one record for them.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].*$
HTTP request body for postChanges.
Example ChangesQuery request if ?filter=_doc_ids
is used.
{
"doc_ids": [
"0007741142412418284"
]
}
Example ChangesQuery request if ?filter=_selector
is used.
{
"fields": [
"type",
"user"
],
"selector": {
"_id": {
"$regex": "^0+7741142412418284"
}
}
}
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate
the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax
- selector
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The PostChanges options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Examples:[ "0007741142412418284" ]
JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Header parameter to specify the ID of the last events received by the server on a previous connection. Overrides
since
query parameter.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Query parameter to specify whether to return the documents in descending by key order.
Default:
false
Query parameter to specify the changes feed type.
Allowable values: [
continuous
,eventsource
,longpoll
,normal
]Default:
normal
Query parameter to specify a filter to emit only specific events from the changes stream.
The built-in filter types are:
_design
- Returns only changes to design documents._doc_ids
- Returns changes for documents with an ID matching one specified indoc_ids
request body parameter. (POST
only)_selector
- Returns changes for documents that match theselector
request body parameter. The selector syntax is the same as used for_find
. (POST
only)_view
- Returns changes for documents that match an existing map function in the view specified by the query parameterview
.
Additionally, the value can be the name of a JS filter function from a design document. For example:
design_doc/filtername
.Note: For better performance use the built-in
_selector
,_design
or_doc_ids
filters rather than JS based_view
or design document filters. If you need to pass values to change the filtered content use the_selector
filter type.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^_design|_docs_ids|_selector|_view|.*\/.*$/
Query parameter to specify the period in milliseconds after which an empty line is sent in the results. Off by default and only applicable for
continuous
andeventsource
feeds. Overrides any timeout to keep the feed alive indefinitely. May also betrue
to use a value of60000
.Note: Delivery of heartbeats cannot be relied on at specific intervals. If your application runs in an environment where idle network connections may break,
heartbeat
is not suitable as a keepalive mechanism. Instead, consider one of the following options:- Use the
timeout
parameter with a value that is compatible with your network environment. - Switch to scheduled usage of one of the non-continuous changes feed types
(
normal
orlongpoll
). - Use TCP keepalive.
Possible values: 1 ≤ value ≤ 60000
- Use the
Query parameter to specify whether to include the full content of the documents in the response.
Default:
false
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify that the update seq should only be calculated with every Nth result returned. When fetching changes in a batch, setting
seq_interval=<batch size>
, where <batch size> is the number of results requested per batch, load can be reduced on the source database as computing the seq value across many shards (especially in highly-sharded databases) is expensive.Possible values: 1 ≤ value ≤ 4294967295
Query parameter to specify to start the results from the change immediately after the given update sequence. Can be a valid update sequence or
now
value. Default is0
i.e. all changes.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Examples:0
Query parameter to specify how many revisions are returned in the changes array. The default,
main_only
, will only return the current "winning" revision; all_docs will return all leaf revisions (including conflicts and deleted former conflicts).Allowable values: [
main_only
,all_docs
]Default:
main_only
Query parameter to specify the maximum period in milliseconds to wait for a change before the response is sent, even if there are no results. Only applicable for
longpoll
orcontinuous
feeds. Default value is specified byhttpd/changes_timeout
configuration option. Note that60000
value is also the default maximum timeout to prevent undetected dead connections.Possible values: 0 ≤ value ≤ 60000
Default:
60000
Query parameter to specify a view function as a filter. Documents pass the filter if the view's map function emits at least one record for them.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
The postChanges options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Examples:[ "0007741142412418284" ]
JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Header parameter to specify the ID of the last events received by the server on a previous connection. Overrides
since
query parameter.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Query parameter to specify whether to return the documents in descending by key order.
Default:
false
Query parameter to specify the changes feed type.
Allowable values: [
continuous
,eventsource
,longpoll
,normal
]Default:
normal
Query parameter to specify a filter to emit only specific events from the changes stream.
The built-in filter types are:
_design
- Returns only changes to design documents._doc_ids
- Returns changes for documents with an ID matching one specified indoc_ids
request body parameter. (POST
only)_selector
- Returns changes for documents that match theselector
request body parameter. The selector syntax is the same as used for_find
. (POST
only)_view
- Returns changes for documents that match an existing map function in the view specified by the query parameterview
.
Additionally, the value can be the name of a JS filter function from a design document. For example:
design_doc/filtername
.Note: For better performance use the built-in
_selector
,_design
or_doc_ids
filters rather than JS based_view
or design document filters. If you need to pass values to change the filtered content use the_selector
filter type.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^_design|_docs_ids|_selector|_view|.*\/.*$/
Query parameter to specify the period in milliseconds after which an empty line is sent in the results. Off by default and only applicable for
continuous
andeventsource
feeds. Overrides any timeout to keep the feed alive indefinitely. May also betrue
to use a value of60000
.Note: Delivery of heartbeats cannot be relied on at specific intervals. If your application runs in an environment where idle network connections may break,
heartbeat
is not suitable as a keepalive mechanism. Instead, consider one of the following options:- Use the
timeout
parameter with a value that is compatible with your network environment. - Switch to scheduled usage of one of the non-continuous changes feed types
(
normal
orlongpoll
). - Use TCP keepalive.
Possible values: 1 ≤ value ≤ 60000
- Use the
Query parameter to specify whether to include the full content of the documents in the response.
Default:
false
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify that the update seq should only be calculated with every Nth result returned. When fetching changes in a batch, setting
seq_interval=<batch size>
, where <batch size> is the number of results requested per batch, load can be reduced on the source database as computing the seq value across many shards (especially in highly-sharded databases) is expensive.Possible values: 1 ≤ value ≤ 4294967295
Query parameter to specify to start the results from the change immediately after the given update sequence. Can be a valid update sequence or
now
value. Default is0
i.e. all changes.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Examples:0
Query parameter to specify how many revisions are returned in the changes array. The default,
main_only
, will only return the current "winning" revision; all_docs will return all leaf revisions (including conflicts and deleted former conflicts).Allowable values: [
main_only
,all_docs
]Default:
main_only
Query parameter to specify the maximum period in milliseconds to wait for a change before the response is sent, even if there are no results. Only applicable for
longpoll
orcontinuous
feeds. Default value is specified byhttpd/changes_timeout
configuration option. Note that60000
value is also the default maximum timeout to prevent undetected dead connections.Possible values: 0 ≤ value ≤ 60000
Default:
60000
Query parameter to specify a view function as a filter. Documents pass the filter if the view's map function emits at least one record for them.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Examples:JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Header parameter to specify the ID of the last events received by the server on a previous connection. Overrides
since
query parameter.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Query parameter to specify whether to return the documents in descending by key order.
Default:
false
Query parameter to specify the changes feed type.
Allowable values: [
continuous
,eventsource
,longpoll
,normal
]Default:
normal
Query parameter to specify a filter to emit only specific events from the changes stream.
The built-in filter types are:
_design
- Returns only changes to design documents._doc_ids
- Returns changes for documents with an ID matching one specified indoc_ids
request body parameter. (POST
only)_selector
- Returns changes for documents that match theselector
request body parameter. The selector syntax is the same as used for_find
. (POST
only)_view
- Returns changes for documents that match an existing map function in the view specified by the query parameterview
.
Additionally, the value can be the name of a JS filter function from a design document. For example:
design_doc/filtername
.Note: For better performance use the built-in
_selector
,_design
or_doc_ids
filters rather than JS based_view
or design document filters. If you need to pass values to change the filtered content use the_selector
filter type.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^_design|_docs_ids|_selector|_view|.*\/.*$/
Query parameter to specify the period in milliseconds after which an empty line is sent in the results. Off by default and only applicable for
continuous
andeventsource
feeds. Overrides any timeout to keep the feed alive indefinitely. May also betrue
to use a value of60000
.Note: Delivery of heartbeats cannot be relied on at specific intervals. If your application runs in an environment where idle network connections may break,
heartbeat
is not suitable as a keepalive mechanism. Instead, consider one of the following options:- Use the
timeout
parameter with a value that is compatible with your network environment. - Switch to scheduled usage of one of the non-continuous changes feed types
(
normal
orlongpoll
). - Use TCP keepalive.
Possible values: 1 ≤ value ≤ 60000
- Use the
Query parameter to specify whether to include the full content of the documents in the response.
Default:
false
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify that the update seq should only be calculated with every Nth result returned. When fetching changes in a batch, setting
seq_interval=<batch size>
, where <batch size> is the number of results requested per batch, load can be reduced on the source database as computing the seq value across many shards (especially in highly-sharded databases) is expensive.Possible values: 1 ≤ value ≤ 4294967295
Query parameter to specify to start the results from the change immediately after the given update sequence. Can be a valid update sequence or
now
value. Default is0
i.e. all changes.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Examples:Query parameter to specify how many revisions are returned in the changes array. The default,
main_only
, will only return the current "winning" revision; all_docs will return all leaf revisions (including conflicts and deleted former conflicts).Allowable values: [
main_only
,all_docs
]Default:
main_only
Query parameter to specify the maximum period in milliseconds to wait for a change before the response is sent, even if there are no results. Only applicable for
longpoll
orcontinuous
feeds. Default value is specified byhttpd/changes_timeout
configuration option. Note that60000
value is also the default maximum timeout to prevent undetected dead connections.Possible values: 0 ≤ value ≤ 60000
Default:
60000
Query parameter to specify a view function as a filter. Documents pass the filter if the view's map function emits at least one record for them.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Examples:JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Header parameter to specify the ID of the last events received by the server on a previous connection. Overrides
since
query parameter.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Query parameter to specify whether to return the documents in descending by key order.
Default:
false
Query parameter to specify the changes feed type.
Allowable values: [
continuous
,eventsource
,longpoll
,normal
]Default:
normal
Query parameter to specify a filter to emit only specific events from the changes stream.
The built-in filter types are:
_design
- Returns only changes to design documents._doc_ids
- Returns changes for documents with an ID matching one specified indoc_ids
request body parameter. (POST
only)_selector
- Returns changes for documents that match theselector
request body parameter. The selector syntax is the same as used for_find
. (POST
only)_view
- Returns changes for documents that match an existing map function in the view specified by the query parameterview
.
Additionally, the value can be the name of a JS filter function from a design document. For example:
design_doc/filtername
.Note: For better performance use the built-in
_selector
,_design
or_doc_ids
filters rather than JS based_view
or design document filters. If you need to pass values to change the filtered content use the_selector
filter type.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^_design|_docs_ids|_selector|_view|.*\/.*$/
Query parameter to specify the period in milliseconds after which an empty line is sent in the results. Off by default and only applicable for
continuous
andeventsource
feeds. Overrides any timeout to keep the feed alive indefinitely. May also betrue
to use a value of60000
.Note: Delivery of heartbeats cannot be relied on at specific intervals. If your application runs in an environment where idle network connections may break,
heartbeat
is not suitable as a keepalive mechanism. Instead, consider one of the following options:- Use the
timeout
parameter with a value that is compatible with your network environment. - Switch to scheduled usage of one of the non-continuous changes feed types
(
normal
orlongpoll
). - Use TCP keepalive.
Possible values: 1 ≤ value ≤ 60000
- Use the
Query parameter to specify whether to include the full content of the documents in the response.
Default:
false
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify that the update seq should only be calculated with every Nth result returned. When fetching changes in a batch, setting
seq_interval=<batch size>
, where <batch size> is the number of results requested per batch, load can be reduced on the source database as computing the seq value across many shards (especially in highly-sharded databases) is expensive.Possible values: 1 ≤ value ≤ 4294967295
Query parameter to specify to start the results from the change immediately after the given update sequence. Can be a valid update sequence or
now
value. Default is0
i.e. all changes.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Examples:Query parameter to specify how many revisions are returned in the changes array. The default,
main_only
, will only return the current "winning" revision; all_docs will return all leaf revisions (including conflicts and deleted former conflicts).Allowable values: [
main_only
,all_docs
]Default:
main_only
Query parameter to specify the maximum period in milliseconds to wait for a change before the response is sent, even if there are no results. Only applicable for
longpoll
orcontinuous
feeds. Default value is specified byhttpd/changes_timeout
configuration option. Note that60000
value is also the default maximum timeout to prevent undetected dead connections.Possible values: 0 ≤ value ≤ 60000
Default:
60000
Query parameter to specify a view function as a filter. Documents pass the filter if the view's map function emits at least one record for them.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X POST "$SERVICE_URL/orders/_changes" -H "Content-Type: application/json" --data '{ "doc_ids": [ "small-appliances:1000042" ] }'
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } postChangesOptions := service.NewPostChangesOptions( "orders", ) changesResult, response, err := service.PostChanges(postChangesOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(changesResult, "", " ") fmt.Println(string(b))
import ( "encoding/json" "fmt" "io" "os" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } postChangesOptions := service.NewPostChangesOptions( "orders", ) changesResult, response, err := service.PostChangesAsStream(postChangesOptions) if err != nil { panic(err) } if changesResult != nil { defer changesResult.Close() outFile, err := os.Create("result.json") if err != nil { panic(err) } defer outFile.Close() if _, err = io.Copy(outFile, changesResult); err != nil { panic(err) } }
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.ChangesResult; import com.ibm.cloud.cloudant.v1.model.PostChangesOptions;
Cloudant service = Cloudant.newInstance(); PostChangesOptions changesOptions = new PostChangesOptions.Builder() .db("orders") .build(); ChangesResult response = service.postChanges(changesOptions).execute() .getResult(); System.out.println(response);
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.PostChangesOptions; import java.io.InputStream; import java.io.File; import java.nio.file.StandardCopyOption;
Cloudant service = Cloudant.newInstance(); PostChangesOptions changesOptions = new PostChangesOptions.Builder() .db("orders") .build(); File file = new File("result.json"); try (InputStream response = service.postChangesAsStream(changesOptions).execute() .getResult()) { java.nio.file.Files.copy( response, file.toPath(), StandardCopyOption.REPLACE_EXISTING); }
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.postChanges({ db: 'orders' }).then(response => { console.log(response.result); });
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.postChangesAsStream({ db: 'orders' }).then(response => { let stream = fs.createWriteStream("result.json"); response.result.pipe(stream); response.result.on('end', () => stream.end()); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.post_changes( db='orders' ).get_result() print(response)
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() result = service.post_changes_as_stream( db='orders' ).get_result() with open('result.json', 'wb') as f: for chunk in result.iter_content(): f.write(chunk)
Response
Response type for PostChanges
: ChangesResult
Response type for PostChangesAsStream
: io.ReadCloser
Response type for postChanges
: ChangesResult
Response type for postChangesAsStream
: InputStream
Response type for postChanges
: ChangesResult
Response type for postChangesAsStream
: NodeJS.ReadableStream
Response type for post_changes
: ChangesResult
Response type for post_changes_as_stream
: BinaryIO
Schema for normal changes feed result.
last_seq
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
pending
Possible values: 0 ≤ value ≤ 9007199254740992
results
Possible values: 0 ≤ number of items ≤ 4294967295
Schema for normal changes feed result.
last_seq.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
pending.
Possible values: 0 ≤ value ≤ 9007199254740992
results.
Possible values: number of items ≥ 0
- Results
List of document's leaves with single field rev.
Possible values: number of items ≥ 1
- Changes
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
if
true
then the document is deleted.Schema for a document.
- Doc
Schema for a map of attachment name to attachment metadata.
- Attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- Revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- RevsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Update sequence.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for normal changes feed result.
last_seq.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
pending.
Possible values: 0 ≤ value ≤ 9007199254740992
results.
Possible values: number of items ≥ 0
- results
List of document's leaves with single field rev.
Possible values: number of items ≥ 1
- changes
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
if
true
then the document is deleted.Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- revsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Update sequence.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for normal changes feed result.
last_seq.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
pending.
Possible values: 0 ≤ value ≤ 9007199254740992
results.
Possible values: number of items ≥ 0
- results
List of document's leaves with single field rev.
Possible values: number of items ≥ 1
- changes
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
if
true
then the document is deleted.Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Update sequence.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for normal changes feed result.
last_seq.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
pending.
Possible values: 0 ≤ value ≤ 9007199254740992
results.
Possible values: number of items ≥ 0
- results
List of document's leaves with single field rev.
Possible values: number of items ≥ 1
- changes
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
if
true
then the document is deleted.Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Update sequence.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Status Code
HTTP response for
/{db}/_changes
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example ChangesResult response.
{ "last_seq": "7-g1AAAAPveJy1kk9OAjEYxSuYGBO3nsCdC9LOP5yVXkGhB-jXdoKTsSQG1p7CKyj0Ep6CS3AGob5hwYSNMJOwek3T971fXr-KMXYz6Rt2Z0hP3-2ToWygq-ncKDfjXOzPA2dnFR73FKNbKcelYoe2-H9bbZJ07_2ynPTVxRvurjTPhU6i06YcpkVH0hDk6TGEbWtOmAKBddRwUpw-iKE4ByeCxlR6v2jNCdOSPkLY1JxsxykyLlKuDLueO2OLV2dNq6-tx23dJXuR8rMtD2wj2CDfqL5m6u2Ycp1HQ5N26e4ILaIWiIL8hvDTgXcDG-RZylXDm8V5IbLkPLwodgX58n7dgRfFriHYz9DsZpqQtQWdNqn8A1TdTOE", "pending": 3, "results": [ { "changes": [ { "rev": "7-7a5191bfeb2f6eed6b3b6fa83f4810f5" } ], "deleted": true, "id": "0007741142412418284", "seq": "1-g1AAAAMFeJydkcENgjAUhquYePHqBN48EEBj4klXUOgAbSExDUJi8OwUrqDQJZyCJZhBqD8XE0Iiwulvmvf1e68vJITMToZPFj4X8SXY-3xjijC--ixKLMv-ns0oSEIUjxnhc0o9yUgTW_3GaojypVKZPBlsdMbdVFhbW6yd_15p2pwOG0SK77SuevcJSHP06rbILicgj0ul0t5OQBm_aV22yI5l1FAVTciR0ntfKzAXGOKJz-prBpYCQ7y1fg1wl8AQB0rzAW4MnCMeShUD3Bi4QGDTGrT8AMkPBk0" } ] }
Example ChangesResult response.
{ "last_seq": "7-g1AAAAPveJy1kk9OAjEYxSuYGBO3nsCdC9LOP5yVXkGhB-jXdoKTsSQG1p7CKyj0Ep6CS3AGob5hwYSNMJOwek3T971fXr-KMXYz6Rt2Z0hP3-2ToWygq-ncKDfjXOzPA2dnFR73FKNbKcelYoe2-H9bbZJ07_2ynPTVxRvurjTPhU6i06YcpkVH0hDk6TGEbWtOmAKBddRwUpw-iKE4ByeCxlR6v2jNCdOSPkLY1JxsxykyLlKuDLueO2OLV2dNq6-tx23dJXuR8rMtD2wj2CDfqL5m6u2Ycp1HQ5N26e4ILaIWiIL8hvDTgXcDG-RZylXDm8V5IbLkPLwodgX58n7dgRfFriHYz9DsZpqQtQWdNqn8A1TdTOE", "pending": 3, "results": [ { "changes": [ { "rev": "7-7a5191bfeb2f6eed6b3b6fa83f4810f5" } ], "deleted": true, "id": "0007741142412418284", "seq": "1-g1AAAAMFeJydkcENgjAUhquYePHqBN48EEBj4klXUOgAbSExDUJi8OwUrqDQJZyCJZhBqD8XE0Iiwulvmvf1e68vJITMToZPFj4X8SXY-3xjijC--ixKLMv-ns0oSEIUjxnhc0o9yUgTW_3GaojypVKZPBlsdMbdVFhbW6yd_15p2pwOG0SK77SuevcJSHP06rbILicgj0ul0t5OQBm_aV22yI5l1FAVTciR0ntfKzAXGOKJz-prBpYCQ7y1fg1wl8AQB0rzAW4MnCMeShUD3Bi4QGDTGrT8AMkPBk0" } ] }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Create or modify a document in a database
Creates or modifies a document in the specified database by using the supplied JSON document.
For creation, you may specify the document ID but you should not specify the revision. If you don't specify the document ID, then the server generates an ID for your document.
For modification, you must specify the document ID and a revision identifier in the JSON document.
If your document ID includes the _local/
or _design/
prefix, then
this operation creates or modifies a local or a design document
respectively.
Creates or modifies a document in the specified database by using the supplied JSON document.
For creation, you may specify the document ID but you should not specify the revision. If you don't specify the document ID, then the server generates an ID for your document.
For modification, you must specify the document ID and a revision identifier in the JSON document.
If your document ID includes the _local/
or _design/
prefix, then this operation creates or modifies a local or a design document respectively.
Creates or modifies a document in the specified database by using the supplied JSON document.
For creation, you may specify the document ID but you should not specify the revision. If you don't specify the document ID, then the server generates an ID for your document.
For modification, you must specify the document ID and a revision identifier in the JSON document.
If your document ID includes the _local/
or _design/
prefix, then this operation creates or modifies a local or a design document respectively.
Creates or modifies a document in the specified database by using the supplied JSON document.
For creation, you may specify the document ID but you should not specify the revision. If you don't specify the document ID, then the server generates an ID for your document.
For modification, you must specify the document ID and a revision identifier in the JSON document.
If your document ID includes the _local/
or _design/
prefix, then this operation creates or modifies a local or a design document respectively.
Creates or modifies a document in the specified database by using the supplied JSON document.
For creation, you may specify the document ID but you should not specify the revision. If you don't specify the document ID, then the server generates an ID for your document.
For modification, you must specify the document ID and a revision identifier in the JSON document.
If your document ID includes the _local/
or _design/
prefix, then this operation creates or modifies a local or a design document respectively.
POST /{db}
(cloudant *CloudantV1) PostDocument(postDocumentOptions *PostDocumentOptions) (result *DocumentResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostDocumentWithContext(ctx context.Context, postDocumentOptions *PostDocumentOptions) (result *DocumentResult, response *core.DetailedResponse, err error)
ServiceCall<DocumentResult> postDocument(PostDocumentOptions postDocumentOptions)
postDocument(params)
post_document(
self,
db: str,
document: Union['Document', BinaryIO],
*,
content_type: Optional[str] = None,
batch: Optional[str] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the PostDocumentOptions
struct and set the fields to provide parameter values for the PostDocument
method.
Use the PostDocumentOptions.Builder
to create a PostDocumentOptions
object that contains the parameter values for the postDocument
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Allowable values: [
application/json
,multipart/mixed
,multipart/related
]
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Query Parameters
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]
HTTP request body for Document operations.
Example Document.
{
"_id": "exampleid",
"brand": "Foo",
"colours": [
"red",
"green",
"black",
"blue"
],
"description": "Slim Colourful Design Electronic Cooking Appliance for ...",
"image": "assets/img/0gmsnghhew.jpg",
"keywords": [
"Foo",
"Scales",
"Weight",
"Digital",
"Kitchen"
],
"name": "Digital Kitchen Scales",
"price": 14.99,
"productid": "1000042",
"taxonomy": [
"Home",
"Kitchen",
"Small Appliances"
],
"type": "product"
}
Schema for a map of attachment name to attachment metadata.
- _attachments
Schema for an attachment.
Schema for a list of document revision identifiers.
Possible values: 0 ≤ number of items ≤ 4294967295, 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Deletion flag. Available if document was removed
Schema for a list of document revision identifiers.
Possible values: 0 ≤ number of items ≤ 4294967295, 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Document's update sequence in current database. Available if requested with local_seq=true query parameter
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Schema for list of revision information.
Schema for a list of objects with information about local revisions and their status.
Possible values: 1 ≤ number of items ≤ 4294967295
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The PostDocument options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
HTTP request body for Document operations.
Examples:{ "_id": "exampleid", "brand": "Foo", "colours": [ "red", "green", "black", "blue" ], "description": "Slim Colourful Design Electronic Cooking Appliance for ...", "image": "assets/img/0gmsnghhew.jpg", "keywords": [ "Foo", "Scales", "Weight", "Digital", "Kitchen" ], "name": "Digital Kitchen Scales", "price": 14.99, "productid": "1000042", "taxonomy": [ "Home", "Kitchen", "Small Appliances" ], "type": "product" }
- Document
Schema for a map of attachment name to attachment metadata.
- Attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- Revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- RevsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Allowable values: [
available
,missing
,deleted
]
HTTP request body for Document operations.
The type of the input.
Allowable values: [
application/json
,multipart/mixed
,multipart/related
,application/octet-stream
]Default:
application/json
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]
The postDocument options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
HTTP request body for Document operations.
Examples:{ "_id": "exampleid", "brand": "Foo", "colours": [ "red", "green", "black", "blue" ], "description": "Slim Colourful Design Electronic Cooking Appliance for ...", "image": "assets/img/0gmsnghhew.jpg", "keywords": [ "Foo", "Scales", "Weight", "Digital", "Kitchen" ], "name": "Digital Kitchen Scales", "price": 14.99, "productid": "1000042", "taxonomy": [ "Home", "Kitchen", "Small Appliances" ], "type": "product" }
- document
Schema for a map of attachment name to attachment metadata.
- attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- revsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Allowable values: [
available
,missing
,deleted
]
HTTP request body for Document operations.
The type of the input.
Allowable values: [
application/json
,multipart/mixed
,multipart/related
,application/octet-stream
]Default:
application/json
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
HTTP request body for Document operations.
Examples:- document
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Allowable values: [
available
,missing
,deleted
]
The type of the input.
Allowable values: [
application/json
,multipart/mixed
,multipart/related
,application/octet-stream
]Default:
application/json
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Schema for a document.
- document
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Allowable values: [
available
,missing
,deleted
]
The type of the input.
Allowable values: [
application/json
,multipart/mixed
,multipart/related
,application/octet-stream
]Default:
application/json
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X POST "$SERVICE_URL/products" -H "Content-Type: application/json" --data '{ "_id": "small-appliances:1000042", "type": "product", "productid": "1000042", "brand": "Salter", "name": "Digital Kitchen Scales", "description": "Slim Colourful Design Electronic Cooking Appliance for Home / Kitchen, Weigh up to 5kg + Aquatronic for Liquids ml + fl. oz. 15Yr Guarantee - Green", "price: 14.99, "image": "assets/img/0gmsnghhew.jpg" }'
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" "github.com/IBM/go-sdk-core/v5/core" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } productsDoc := cloudantv1.Document{ ID: core.StringPtr("1000042"), } productsDoc.SetProperty("type", "product") productsDoc.SetProperty("productId", "1000042") productsDoc.SetProperty("brand", "Salter") productsDoc.SetProperty("name", "Digital Kitchen Scales") productsDoc.SetProperty("description", "Slim Colourful Design Electronic Cooking Appliance for Home / Kitchen, Weigh up to 5kg + Aquatronic for Liquids ml + fl. oz. 15Yr Guarantee - Green") productsDoc.SetProperty("price", 14.99) productsDoc.SetProperty("image", "assets/img/0gmsnghhew.jpg") postDocumentOptions := service.NewPostDocumentOptions( "products", ) postDocumentOptions.SetDocument(&productsDoc) documentResult, response, err := service.PostDocument(postDocumentOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(documentResult, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.Document; import com.ibm.cloud.cloudant.v1.model.DocumentResult; import com.ibm.cloud.cloudant.v1.model.PostDocumentOptions;
Cloudant service = Cloudant.newInstance(); Document productsDocument = new Document(); productsDocument.setId("1000042"); productsDocument.put("type", "product"); productsDocument.put("productId", "1000042"); productsDocument.put("brand", "Salter"); productsDocument.put("name", "Digital Kitchen Scales"); productsDocument.put("description", "Slim Colourful Design Electronic" + "Cooking Appliance for Home / Kitchen, Weigh up to 5kg + Aquatronic" + "for Liquids ml + fl. oz. 15Yr Guarantee - Green"); productsDocument.put("price", 14.99); productsDocument.put("image", "assets/img/0gmsnghhew.jpg"); PostDocumentOptions documentOptions = new PostDocumentOptions.Builder() .db("products") .document(productsDocument) .build(); DocumentResult response = service.postDocument(documentOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); const productsDoc: CloudantV1.Document = { _id: '1000042', type: 'product', productId: '1000042', brand: 'Salter', name: 'Digital Kitchen Scales', description: 'Slim Colourful Design Electronic Cooking Appliance for Home / Kitchen, Weigh up to 5kg + Aquatronic for Liquids ml + fl. oz. 15Yr Guarantee - Green', price: 14.99, image: 'assets/img/0gmsnghhew.jpg' }; service.postDocument({ db: 'products', document: productsDoc }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import Document, CloudantV1 service = CloudantV1.new_instance() products_doc = Document( _id="1000042", type="product", productId="1000042", brand="Salter", name="Digital Kitchen Scales", description="Slim Colourful Design Electronic Cooking Appliance for Home / Kitchen, Weigh up to 5kg + Aquatronic for Liquids ml + fl. oz. 15Yr Guarantee - Green", price=14.99, image="assets/img/0gmsnghhew.jpg") response = service.post_document(db='products', document=products_doc).get_result() print(response)
Response
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
ok
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Status Code
HTTP response for Document modification operations.
HTTP response for Document modification operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for exceeded data usage quota.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for conflict.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for writer or creator access is required.
{ "error": "unauthorized", "reason": "one of _writer, _creator is required for this request." }
Example error response for writer or creator access is required.
{ "error": "unauthorized", "reason": "one of _writer, _creator is required for this request." }
Example error response when the data quota of the plan is exceeded.
{ "error": "over_data_quota", "reason": "Account has exceeded its data usage quota. An upgrade to a paid plan is required." }
Example error response when the data quota of the plan is exceeded.
{ "error": "over_data_quota", "reason": "Account has exceeded its data usage quota. An upgrade to a paid plan is required." }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for a document update conflict.
{ "error": "conflict", "reason": "Document update conflict." }
Example error response for a document update conflict.
{ "error": "conflict", "reason": "Document update conflict." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request with a document size that exceeds the allowable limit.
{ "error": "document_too_large", "reason": "doc_id" }
Example error response for a request with a document size that exceeds the allowable limit.
{ "error": "document_too_large", "reason": "doc_id" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Query a list of all documents in a database (GET)
Queries the primary index (all document IDs). The results that match the query parameters are returned in a JSON object, including a list of matching documents with basic contents, such as the ID and revision. When no query parameters are specified, results for all documents in the database are returned. Optionally, document content or additional metadata can be included in the response.
GET /{db}/_all_docs
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Query Parameters
Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Query parameter to specify whether to return the documents in descending by key order.
Default:
false
Query parameter to specify to stop returning records when the specified key is reached. String representation of any JSON type that matches the key type emitted by the view function.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query parameter to specify to stop returning records when the specified document ID is reached.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].*$
Query parameter to specify whether to include the full content of the documents in the response.
Default:
false
Query parameter to specify whether the specified end key should be included in the result.
Default:
true
Query parameter to specify to return only documents that match the specified key. String representation of any JSON type that matches the key type emitted by the view function.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query parameter to specify returning only documents that match any of the specified keys. String representation of a JSON array of keys that match the key type emitted by the view function. Must be URL encoded.
Possible values: 2 ≤ length ≤ 7168, Value must match regular expression
^\[(".*")*\]$
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Query parameter to specify to start returning records from the specified key. String representation of any JSON type that matches the key type emitted by the view function.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query parameter to specify to start returning records from the specified document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].*$
Query parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/orders/_all_docs"
Response
Schema for the result of an all documents operation.
Offset where the list started.
Possible values: 0 ≤ value ≤ 9007199254740992
Total number of document results.
Possible values: 0 ≤ value ≤ 4294967295
List of doc results.
Possible values: 0 ≤ number of items ≤ 4294967295
Current update sequence for the database
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Status Code
HTTP response for getAllDocs and postAllDocs.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example AllDocsResult response.
{ "offset": 0, "rows": [ { "doc": { "_id": "exampleid", "_rev": "1-967a00dff5e02add41819138abb3284d" }, "id": "exampleid", "key": "exampleid", "value": { "rev": "1-967a00dff5e02add41819138abb3284d" } } ], "total_rows": 1 }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve HTTP headers of all documents in a database (GET)
Retrieves the HTTP headers of all documents in a database (GET).
HEAD /{db}/_all_docs
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for
/_all_docs
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Query a list of all documents in a database
Queries the primary index (all document IDs). The results that match the request body parameters are returned in a JSON object, including a list of matching documents with basic contents, such as the ID and revision. When no request body parameters are specified, results for all documents in the database are returned. Optionally, document content or additional metadata can be included in the response.
Queries the primary index (all document IDs). The results that match the request body parameters are returned in a JSON object, including a list of matching documents with basic contents, such as the ID and revision. When no request body parameters are specified, results for all documents in the database are returned. Optionally, document content or additional metadata can be included in the response.
Queries the primary index (all document IDs). The results that match the request body parameters are returned in a JSON object, including a list of matching documents with basic contents, such as the ID and revision. When no request body parameters are specified, results for all documents in the database are returned. Optionally, document content or additional metadata can be included in the response.
Queries the primary index (all document IDs). The results that match the request body parameters are returned in a JSON object, including a list of matching documents with basic contents, such as the ID and revision. When no request body parameters are specified, results for all documents in the database are returned. Optionally, document content or additional metadata can be included in the response.
Queries the primary index (all document IDs). The results that match the request body parameters are returned in a JSON object, including a list of matching documents with basic contents, such as the ID and revision. When no request body parameters are specified, results for all documents in the database are returned. Optionally, document content or additional metadata can be included in the response.
POST /{db}/_all_docs
(cloudant *CloudantV1) PostAllDocs(postAllDocsOptions *PostAllDocsOptions) (result *AllDocsResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostAllDocsWithContext(ctx context.Context, postAllDocsOptions *PostAllDocsOptions) (result *AllDocsResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostAllDocsAsStream(postAllDocsOptions *PostAllDocsOptions) (result io.ReadCloser, response *core.DetailedResponse, err error)
ServiceCall<AllDocsResult> postAllDocs(PostAllDocsOptions postAllDocsOptions)
ServiceCall<InputStream> postAllDocsAsStream(PostAllDocsOptions postAllDocsOptions)
postAllDocs(params)
postAllDocsAsStream(params)
post_all_docs(
self,
db: str,
*,
att_encoding_info: Optional[bool] = None,
attachments: Optional[bool] = None,
conflicts: Optional[bool] = None,
descending: Optional[bool] = None,
include_docs: Optional[bool] = None,
inclusive_end: Optional[bool] = None,
limit: Optional[int] = None,
skip: Optional[int] = None,
update_seq: Optional[bool] = None,
end_key: Optional[str] = None,
key: Optional[str] = None,
keys: Optional[List[str]] = None,
start_key: Optional[str] = None,
**kwargs,
) -> DetailedResponse
post_all_docs_as_stream(
self,
db: str,
*,
att_encoding_info: Optional[bool] = None,
attachments: Optional[bool] = None,
conflicts: Optional[bool] = None,
descending: Optional[bool] = None,
include_docs: Optional[bool] = None,
inclusive_end: Optional[bool] = None,
limit: Optional[int] = None,
skip: Optional[int] = None,
update_seq: Optional[bool] = None,
end_key: Optional[str] = None,
key: Optional[str] = None,
keys: Optional[List[str]] = None,
start_key: Optional[str] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the PostAllDocsOptions
struct and set the fields to provide parameter values for the PostAllDocs
method.
Use the PostAllDocsOptions.Builder
to create a PostAllDocsOptions
object that contains the parameter values for the postAllDocs
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
HTTP request body for postAllDocs and postPartitionAllDocs.
Example AllDocs request.
{
"limit": 10,
"start_key": "0007741142412418284"
}
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Query parameter to specify whether to sort the returned rows. Setting this to false offers a performance boost. The total_rows and offset fields are not available when this is set to false.
Default:
true
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The PostAllDocs options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Examples:10
Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Examples:0007741142412418284
The postAllDocs options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Examples:10
Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Examples:0007741142412418284
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Examples:Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Examples:
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Examples:Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Examples:
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X POST "$SERVICE_URL/orders/_all_docs" -H "Content-Type: application/json" --data '{ "include_docs": true, "startkey": "abc", "limit": 10 }'
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } postAllDocsOptions := service.NewPostAllDocsOptions( "orders", ) postAllDocsOptions.SetIncludeDocs(true) postAllDocsOptions.SetStartKey("abc") postAllDocsOptions.SetLimit(10) allDocsResult, response, err := service.PostAllDocs(postAllDocsOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(allDocsResult, "", " ") fmt.Println(string(b))
import ( "encoding/json" "fmt" "io" "os" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } postAllDocsOptions := service.NewPostAllDocsOptions( "orders", ) postAllDocsOptions.SetIncludeDocs(true) postAllDocsOptions.SetStartKey("abc") postAllDocsOptions.SetLimit(10) allDocsResult, response, err := service.PostAllDocsAsStream(postAllDocsOptions) if err != nil { panic(err) } if allDocsResult != nil { defer allDocsResult.Close() outFile, err := os.Create("result.json") if err != nil { panic(err) } defer outFile.Close() if _, err = io.Copy(outFile, allDocsResult); err != nil { panic(err) } }
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.AllDocsResult; import com.ibm.cloud.cloudant.v1.model.PostAllDocsOptions;
Cloudant service = Cloudant.newInstance(); PostAllDocsOptions docsOptions = new PostAllDocsOptions.Builder() .db("orders") .includeDocs(true) .startKey("abc") .limit(10) .build(); AllDocsResult response = service.postAllDocs(docsOptions).execute().getResult(); System.out.println(response);
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.PostAllDocsOptions; import java.io.InputStream; import java.io.File; import java.nio.file.StandardCopyOption;
Cloudant service = Cloudant.newInstance(); PostAllDocsOptions docsOptions = new PostAllDocsOptions.Builder() .db("orders") .includeDocs(true) .startKey("abc") .limit(10) .build(); File file = new File("result.json"); try (InputStream response = service.postAllDocsAsStream(docsOptions).execute() .getResult()) { java.nio.file.Files.copy( response, file.toPath(), StandardCopyOption.REPLACE_EXISTING); }
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.postAllDocs({ db: 'orders', includeDocs: true, startKey: 'abc', limit: 10 }).then(response => { console.log(response.result); });
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.postAllDocsAsStream({ db: 'orders', includeDocs: true, startKey: 'abc', limit: 10 }).then(response => { let stream = fs.createWriteStream("result.json"); response.result.pipe(stream); response.result.on('end', () => stream.end()); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.post_all_docs( db='orders', include_docs=True, start_key='abc', limit=10 ).get_result() print(response)
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() result = service.post_all_docs_as_stream( db='orders', include_docs=True, start_key='abc', limit=10 ).get_result() with open('result.json', 'wb') as f: for chunk in result.iter_content(): f.write(chunk)
Response
Response type for PostAllDocs
: AllDocsResult
Response type for PostAllDocsAsStream
: io.ReadCloser
Response type for postAllDocs
: AllDocsResult
Response type for postAllDocsAsStream
: InputStream
Response type for postAllDocs
: AllDocsResult
Response type for postAllDocsAsStream
: NodeJS.ReadableStream
Response type for post_all_docs
: AllDocsResult
Response type for post_all_docs_as_stream
: BinaryIO
Schema for the result of an all documents operation.
Offset where the list started.
Possible values: 0 ≤ value ≤ 9007199254740992
Total number of document results.
Possible values: 0 ≤ value ≤ 4294967295
List of doc results.
Possible values: 0 ≤ number of items ≤ 4294967295
Current update sequence for the database
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Schema for the result of an all documents operation.
Total number of document results.
Possible values: 0 ≤ value ≤ 4294967295
List of doc results.
Possible values: number of items ≥ 0
- Rows
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a document.
- Doc
Schema for a map of attachment name to attachment metadata.
- Attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- Revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- RevsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Value of built-in
/_all_docs
style view.- Value
If
true
then the document is deleted. Not present for undeleted documents.Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for the result of an all documents operation.
Total number of document results.
Possible values: 0 ≤ value ≤ 4294967295
List of doc results.
Possible values: number of items ≥ 0
- rows
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- revsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Value of built-in
/_all_docs
style view.- value
If
true
then the document is deleted. Not present for undeleted documents.Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for the result of an all documents operation.
Total number of document results.
Possible values: 0 ≤ value ≤ 4294967295
List of doc results.
Possible values: number of items ≥ 0
- rows
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Value of built-in
/_all_docs
style view.- value
If
true
then the document is deleted. Not present for undeleted documents.Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for the result of an all documents operation.
Total number of document results.
Possible values: 0 ≤ value ≤ 4294967295
List of doc results.
Possible values: number of items ≥ 0
- rows
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Value of built-in
/_all_docs
style view.- value
If
true
then the document is deleted. Not present for undeleted documents.Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Status Code
HTTP response for getAllDocs and postAllDocs.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example AllDocsResult response.
{ "offset": 0, "rows": [ { "doc": { "_id": "exampleid", "_rev": "1-967a00dff5e02add41819138abb3284d" }, "id": "exampleid", "key": "exampleid", "value": { "rev": "1-967a00dff5e02add41819138abb3284d" } } ], "total_rows": 1 }
Example AllDocsResult response.
{ "offset": 0, "rows": [ { "doc": { "_id": "exampleid", "_rev": "1-967a00dff5e02add41819138abb3284d" }, "id": "exampleid", "key": "exampleid", "value": { "rev": "1-967a00dff5e02add41819138abb3284d" } } ], "total_rows": 1 }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Multi-query the list of all documents in a database
Runs multiple queries using the primary index (all document IDs). Returns a JSON object that contains a list of result objects, one for each query, with a structure equivalent to that of a single _all_docs
request. This enables you to request multiple queries in a single request, in place of multiple POST /{db}/_all_docs
requests.
Runs multiple queries using the primary index (all document IDs). Returns a JSON object that contains a list of result objects, one for each query, with a structure equivalent to that of a single _all_docs
request. This enables you to request multiple queries in a single request, in place of multiple POST /{db}/_all_docs
requests.
Runs multiple queries using the primary index (all document IDs). Returns a JSON object that contains a list of result objects, one for each query, with a structure equivalent to that of a single _all_docs
request. This enables you to request multiple queries in a single request, in place of multiple POST /{db}/_all_docs
requests.
Runs multiple queries using the primary index (all document IDs). Returns a JSON object that contains a list of result objects, one for each query, with a structure equivalent to that of a single _all_docs
request. This enables you to request multiple queries in a single request, in place of multiple POST /{db}/_all_docs
requests.
Runs multiple queries using the primary index (all document IDs). Returns a JSON object that contains a list of result objects, one for each query, with a structure equivalent to that of a single _all_docs
request. This enables you to request multiple queries in a single request, in place of multiple POST /{db}/_all_docs
requests.
POST /{db}/_all_docs/queries
(cloudant *CloudantV1) PostAllDocsQueries(postAllDocsQueriesOptions *PostAllDocsQueriesOptions) (result *AllDocsQueriesResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostAllDocsQueriesWithContext(ctx context.Context, postAllDocsQueriesOptions *PostAllDocsQueriesOptions) (result *AllDocsQueriesResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostAllDocsQueriesAsStream(postAllDocsQueriesOptions *PostAllDocsQueriesOptions) (result io.ReadCloser, response *core.DetailedResponse, err error)
ServiceCall<AllDocsQueriesResult> postAllDocsQueries(PostAllDocsQueriesOptions postAllDocsQueriesOptions)
ServiceCall<InputStream> postAllDocsQueriesAsStream(PostAllDocsQueriesOptions postAllDocsQueriesOptions)
postAllDocsQueries(params)
postAllDocsQueriesAsStream(params)
post_all_docs_queries(
self,
db: str,
queries: List['AllDocsQuery'],
**kwargs,
) -> DetailedResponse
post_all_docs_queries_as_stream(
self,
db: str,
queries: List['AllDocsQuery'],
**kwargs,
) -> DetailedResponse
Request
Instantiate the PostAllDocsQueriesOptions
struct and set the fields to provide parameter values for the PostAllDocsQueries
method.
Use the PostAllDocsQueriesOptions.Builder
to create a PostAllDocsQueriesOptions
object that contains the parameter values for the postAllDocsQueries
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
HTTP request body for allDocsQueriesQuery, designDocsQueriesQuery and localDocsQueriesQuery.
Example AllDocsQueriesQuery request.
{
"queries": [
{
"keys": [
"small-appliances:1000042",
"small-appliances:1000043"
]
},
{
"limit": 3,
"skip": 2
}
]
}
An array of query objects with fields for the parameters of each individual view query to be executed. The field names and their meaning are the same as the query parameters of a regular
/_all_docs
request.Possible values: 1 ≤ number of items ≤ 65535
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The PostAllDocsQueries options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
An array of query objects with fields for the parameters of each individual view query to be executed. The field names and their meaning are the same as the query parameters of a regular
/_all_docs
request.Possible values: 1 ≤ number of items ≤ 65535
Examples:[ { "keys": [ "small-appliances:1000042", "small-appliances:1000043" ] }, { "limit": 3, "skip": 2 } ]
- Queries
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
The postAllDocsQueries options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
An array of query objects with fields for the parameters of each individual view query to be executed. The field names and their meaning are the same as the query parameters of a regular
/_all_docs
request.Possible values: 1 ≤ number of items ≤ 65535
Examples:[ { "keys": [ "small-appliances:1000042", "small-appliances:1000043" ] }, { "limit": 3, "skip": 2 } ]
- queries
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
An array of query objects with fields for the parameters of each individual view query to be executed. The field names and their meaning are the same as the query parameters of a regular
/_all_docs
request.Possible values: 1 ≤ number of items ≤ 65535
Examples:- queries
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
An array of query objects with fields for the parameters of each individual view query to be executed. The field names and their meaning are the same as the query parameters of a regular
/_all_docs
request.Possible values: 1 ≤ number of items ≤ 65535
Examples:- queries
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X POST "$SERVICE_URL/products/_all_docs/queries" -H "Content-Type: application/json" --data '{ "queries": [ { "keys": [ "small-appliances:1000042", "small-appliances:1000043" ] }, { "limit": 3, "skip": 2 } ] }'
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" "github.com/IBM/go-sdk-core/v5/core" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } allDocsQueries := []cloudantv1.AllDocsQuery{ { Keys: []string{ "1000042", "1000043", }, }, { Limit: core.Int64Ptr(3), Skip: core.Int64Ptr(2), }, } postAllDocsQueriesOptions := service.NewPostAllDocsQueriesOptions( "products", allDocsQueries, ) allDocsQueriesResult, response, err := service.PostAllDocsQueries(postAllDocsQueriesOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(allDocsQueriesResult, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.AllDocsQuery; import com.ibm.cloud.cloudant.v1.model.AllDocsQueriesResult; import com.ibm.cloud.cloudant.v1.model.PostAllDocsQueriesOptions; import java.util.Arrays;
Cloudant service = Cloudant.newInstance(); AllDocsQuery query1 = new AllDocsQuery.Builder() .keys(Arrays.asList("1000042", "1000043")) .build(); AllDocsQuery query2 = new AllDocsQuery.Builder() .limit(3) .skip(2) .build(); PostAllDocsQueriesOptions queriesOptions = new PostAllDocsQueriesOptions.Builder() .queries(Arrays.asList(query1, query2)) .db("products") .build(); AllDocsQueriesResult response = service.postAllDocsQueries(queriesOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); const allDocsQueries: CloudantV1.AllDocsQuery[] = [{ keys: ['1000042', '1000043'], }, { limit: 3, skip: 2 }]; service.postAllDocsQueries({ db: 'products', queries: allDocsQueries }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import AllDocsQuery, CloudantV1 service = CloudantV1.new_instance() all_docs_query1 = AllDocsQuery( keys=['1000042', '1000043'] ) all_docs_query2 = AllDocsQuery( limit=3, skip=2 ) response = service.post_all_docs_queries( db='products', queries=[all_docs_query1, all_docs_query2] ).get_result() print(response)
Response
Response type for PostAllDocsQueries
: AllDocsQueriesResult
Response type for PostAllDocsQueriesAsStream
: io.ReadCloser
Response type for postAllDocsQueries
: AllDocsQueriesResult
Response type for postAllDocsQueriesAsStream
: InputStream
Response type for postAllDocsQueries
: AllDocsQueriesResult
Response type for postAllDocsQueriesAsStream
: NodeJS.ReadableStream
Response type for post_all_docs_queries
: AllDocsQueriesResult
Response type for post_all_docs_queries_as_stream
: BinaryIO
Schema for the result of an all documents queries operation.
An array of result objects - one for each query. Each result object contains the same fields as the response to a regular
/_all_docs
request.Possible values: 1 ≤ number of items ≤ 65535
Schema for the result of an all documents queries operation.
An array of result objects - one for each query. Each result object contains the same fields as the response to a regular
/_all_docs
request.Possible values: 1 ≤ number of items ≤ 65535
- Results
Total number of document results.
Possible values: 0 ≤ value ≤ 4294967295
List of doc results.
Possible values: number of items ≥ 0
- Rows
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a document.
- Doc
Schema for a map of attachment name to attachment metadata.
- Attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- Revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- RevsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Value of built-in
/_all_docs
style view.- Value
If
true
then the document is deleted. Not present for undeleted documents.Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for the result of an all documents queries operation.
An array of result objects - one for each query. Each result object contains the same fields as the response to a regular
/_all_docs
request.Possible values: 1 ≤ number of items ≤ 65535
- results
Total number of document results.
Possible values: 0 ≤ value ≤ 4294967295
List of doc results.
Possible values: number of items ≥ 0
- rows
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- revsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Value of built-in
/_all_docs
style view.- value
If
true
then the document is deleted. Not present for undeleted documents.Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for the result of an all documents queries operation.
An array of result objects - one for each query. Each result object contains the same fields as the response to a regular
/_all_docs
request.Possible values: 1 ≤ number of items ≤ 65535
- results
Total number of document results.
Possible values: 0 ≤ value ≤ 4294967295
List of doc results.
Possible values: number of items ≥ 0
- rows
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Value of built-in
/_all_docs
style view.- value
If
true
then the document is deleted. Not present for undeleted documents.Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for the result of an all documents queries operation.
An array of result objects - one for each query. Each result object contains the same fields as the response to a regular
/_all_docs
request.Possible values: 1 ≤ number of items ≤ 65535
- results
Total number of document results.
Possible values: 0 ≤ value ≤ 4294967295
List of doc results.
Possible values: number of items ≥ 0
- rows
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Value of built-in
/_all_docs
style view.- value
If
true
then the document is deleted. Not present for undeleted documents.Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Status Code
HTTP response for
/_all_docs/queries
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example AllDocsQueriesResult response.
{ "results": [ { "offset": 0, "rows": [ { "id": "exampleid", "key": "exampleid", "value": { "rev": "1-5005d65514fe9e90f8eccf174af5dd64" } }, { "id": "exampleid2", "key": "exampleid2", "value": { "rev": "1-2d7810b054babeda4812b3924428d6d6" } } ], "total_rows": 5 }, { "offset": 2, "rows": [ { "id": "exampleid3", "key": "exampleid3", "value": { "rev": "1-5005d65514fe9e90f8eccf174af5dd64" } }, { "id": "exampleid4", "key": "exampleid4", "value": { "rev": "1-2d7810b054babeda4812b3924428d6d6" } } ], "total_rows": 5 } ] }
Example AllDocsQueriesResult response.
{ "results": [ { "offset": 0, "rows": [ { "id": "exampleid", "key": "exampleid", "value": { "rev": "1-5005d65514fe9e90f8eccf174af5dd64" } }, { "id": "exampleid2", "key": "exampleid2", "value": { "rev": "1-2d7810b054babeda4812b3924428d6d6" } } ], "total_rows": 5 }, { "offset": 2, "rows": [ { "id": "exampleid3", "key": "exampleid3", "value": { "rev": "1-5005d65514fe9e90f8eccf174af5dd64" } }, { "id": "exampleid4", "key": "exampleid4", "value": { "rev": "1-2d7810b054babeda4812b3924428d6d6" } } ], "total_rows": 5 } ] }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Bulk modify multiple documents in a database
The bulk document API allows you to create, update, and delete multiple documents at the same time within a single request. The basic operation is similar to creating, updating, or deleting a single document, except that you batch the document structure and information.
The bulk document API allows you to create, update, and delete multiple documents at the same time within a single request. The basic operation is similar to creating, updating, or deleting a single document, except that you batch the document structure and information.
The bulk document API allows you to create, update, and delete multiple documents at the same time within a single request. The basic operation is similar to creating, updating, or deleting a single document, except that you batch the document structure and information.
The bulk document API allows you to create, update, and delete multiple documents at the same time within a single request. The basic operation is similar to creating, updating, or deleting a single document, except that you batch the document structure and information.
The bulk document API allows you to create, update, and delete multiple documents at the same time within a single request. The basic operation is similar to creating, updating, or deleting a single document, except that you batch the document structure and information.
POST /{db}/_bulk_docs
(cloudant *CloudantV1) PostBulkDocs(postBulkDocsOptions *PostBulkDocsOptions) (result []DocumentResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostBulkDocsWithContext(ctx context.Context, postBulkDocsOptions *PostBulkDocsOptions) (result []DocumentResult, response *core.DetailedResponse, err error)
ServiceCall<List<DocumentResult>> postBulkDocs(PostBulkDocsOptions postBulkDocsOptions)
postBulkDocs(params)
post_bulk_docs(
self,
db: str,
bulk_docs: Union['BulkDocs', BinaryIO],
**kwargs,
) -> DetailedResponse
Request
Instantiate the PostBulkDocsOptions
struct and set the fields to provide parameter values for the PostBulkDocs
method.
Use the PostBulkDocsOptions.Builder
to create a PostBulkDocsOptions
object that contains the parameter values for the postBulkDocs
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
HTTP request body for postBulkDocs.
Example BulkDocs request: create and update documents
{
"docs": [
{
"_id": "0007241142412418284",
"date": "2019-01-28T10:44:22.000Z",
"eventType": "addedToBasket",
"productId": "1000042",
"type": "event",
"userid": "abc123"
},
{
"_id": "0008001142412418285",
"date": "2019-01-28T12:30:00.000Z",
"eventType": "addedToBasket",
"productId": "1000043",
"type": "event",
"userid": "def456"
}
]
}
Example BulkDocs request: delete documents
{
"docs": [
{
"_deleted": true,
"_id": "0007241142412418284",
"_rev": "1-5005d65514fe9e90f8eccf174af5dd64"
},
{
"_deleted": true,
"_id": "0008001142412418285",
"_rev": "1-2d7810b054babeda4812b3924428d6d6"
}
]
}
Array of documents
Possible values: 0 ≤ number of items ≤ 65535
- docs
If
false
, prevents the database from assigning them new revision IDs. Default istrue
.Avoid using this parameter, since this option applies document revisions without checking for conflicts, so it is very easy to accidentally end up with a large number of conflicts.
Default:
true
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The PostBulkDocs options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
HTTP request body for postBulkDocs.
Examples:{ "docs": [ { "_id": "0007241142412418284", "date": "2019-01-28T10:44:22.000Z", "eventType": "addedToBasket", "productId": "1000042", "type": "event", "userid": "abc123" }, { "_id": "0008001142412418285", "date": "2019-01-28T12:30:00.000Z", "eventType": "addedToBasket", "productId": "1000043", "type": "event", "userid": "def456" } ] }
- BulkDocs
Array of documents.
Possible values: 0 ≤ number of items ≤ 65535
- Docs
Schema for a map of attachment name to attachment metadata.
- Attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- Revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- RevsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Allowable values: [
available
,missing
,deleted
]
If
false
, prevents the database from assigning them new revision IDs. Default istrue
.Avoid using this parameter, since this option applies document revisions without checking for conflicts, so it is very easy to accidentally end up with a large number of conflicts.
Default:
true
HTTP request body for postBulkDocs.
The postBulkDocs options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
HTTP request body for postBulkDocs.
Examples:{ "docs": [ { "_id": "0007241142412418284", "date": "2019-01-28T10:44:22.000Z", "eventType": "addedToBasket", "productId": "1000042", "type": "event", "userid": "abc123" }, { "_id": "0008001142412418285", "date": "2019-01-28T12:30:00.000Z", "eventType": "addedToBasket", "productId": "1000043", "type": "event", "userid": "def456" } ] }
- bulkDocs
Array of documents.
Possible values: 0 ≤ number of items ≤ 65535
- docs
Schema for a map of attachment name to attachment metadata.
- attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- revsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Allowable values: [
available
,missing
,deleted
]
If
false
, prevents the database from assigning them new revision IDs. Default istrue
.Avoid using this parameter, since this option applies document revisions without checking for conflicts, so it is very easy to accidentally end up with a large number of conflicts.
Default:
true
HTTP request body for postBulkDocs.
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
HTTP request body for postBulkDocs.
Examples:- bulkDocs
Array of documents.
Possible values: 0 ≤ number of items ≤ 65535
- docs
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Allowable values: [
available
,missing
,deleted
]
If
false
, prevents the database from assigning them new revision IDs. Default istrue
.Avoid using this parameter, since this option applies document revisions without checking for conflicts, so it is very easy to accidentally end up with a large number of conflicts.
Default:
true
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Schema for submitting documents for bulk modifications.
- bulk_docs
Array of documents.
Possible values: 0 ≤ number of items ≤ 65535
- docs
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Allowable values: [
available
,missing
,deleted
]
If
false
, prevents the database from assigning them new revision IDs. Default istrue
.Avoid using this parameter, since this option applies document revisions without checking for conflicts, so it is very easy to accidentally end up with a large number of conflicts.
Default:
true
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X POST "$SERVICE_URL/events/_bulk_docs" -H "Content-Type: application/json" --data '{ "docs": [ { "_id": "0007241142412418284", "type": "event", "userid": "abc123", "eventType": "addedToBasket", "productId": "1000042", "date": "2019-01-28T10:44:22.000Z" }, { "_id": "0008001142412418285", "type": "event", "userid": "def456", "eventType": "addedToBasket", "productId": "1000043", "date": "2019-01-28T12:30:00.000Z" } ] }'
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X POST "$SERVICE_URL/events/_bulk_docs" -H "Content-Type: application/json" --data '{ "docs": [ { "_id": "0007241142412418284", "_rev": "1-5005d65514fe9e90f8eccf174af5dd64", "_deleted": true }, { "_id": "0007241142412418285", "_rev": "1-2d7810b054babeda4812b3924428d6d6", "_deleted": true } ] }'
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" "github.com/IBM/go-sdk-core/v5/core" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } eventDoc1 := cloudantv1.Document{ ID: core.StringPtr("ns1HJS13AMkK:0007241142412418284"), } eventDoc1.SetProperty("type", "event") eventDoc1.SetProperty("userId", "abc123") eventDoc1.SetProperty("eventType", "addedToBasket") eventDoc1.SetProperty("productId", "1000042") eventDoc1.SetProperty("date", "2019-01-28T10:44:22.000Z") eventDoc2 := cloudantv1.Document{ ID: core.StringPtr("H8tDIwfadxp9:0007241142412418285"), } eventDoc2.SetProperty("type", "event") eventDoc2.SetProperty("userId", "abc234") eventDoc2.SetProperty("eventType", "addedToBasket") eventDoc2.SetProperty("productId", "1000050") eventDoc2.SetProperty("date", "2019-01-25T20:00:00.000Z") postBulkDocsOptions := service.NewPostBulkDocsOptions( "events", ) bulkDocs, err := service.NewBulkDocs( []cloudantv1.Document{ eventDoc1, eventDoc2, }, ) if err != nil { panic(err) } postBulkDocsOptions.SetBulkDocs(bulkDocs) documentResult, response, err := service.PostBulkDocs(postBulkDocsOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(documentResult, "", " ") fmt.Println(string(b))
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" "github.com/IBM/go-sdk-core/v5/core" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } eventDoc1 := cloudantv1.Document{ ID: core.StringPtr("ns1HJS13AMkK:0007241142412418284"), } eventDoc1.Rev = core.StringPtr("1-5005d65514fe9e90f8eccf174af5dd64") eventDoc1.Deleted = core.BoolPtr(true) eventDoc2 := cloudantv1.Document{ ID: core.StringPtr("H8tDIwfadxp9:0007241142412418285"), } eventDoc2.Rev = core.StringPtr("1-2d7810b054babeda4812b3924428d6d6") eventDoc2.Deleted = core.BoolPtr(true) postBulkDocsOptions := service.NewPostBulkDocsOptions( "events", ) bulkDocs, err := service.NewBulkDocs( []cloudantv1.Document{ eventDoc1, eventDoc2, }, ) if err != nil { panic(err) } postBulkDocsOptions.SetBulkDocs(bulkDocs) documentResult, response, err := service.PostBulkDocs(postBulkDocsOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(documentResult, "", " ") fmt.Println(string(b))
import ( "encoding/json" "fmt" "os" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } file, err := os.Open("upload.json") if err != nil { panic(err) } postBulkDocsOptions := service.NewPostBulkDocsOptions( "events", ) postBulkDocsOptions.SetBody(file) documentResult, response, err := service.PostBulkDocs(postBulkDocsOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(documentResult, "", " ") fmt.Println(string(b))
Content of upload.json
{ "docs": [ { "_id": "ns1HJS13AMkK:0007241142412418284", "type": "event", "userId": "abc123", "eventType": "addedToBasket", "productId": "1000042", "date": "2019-01-28T10:44:22.000Z" }, { "_id": "H8tDIwfadxp9:0007241142412418285", "type": "event", "userId": "abc234", "eventType": "addedToBasket", "productId": "1000050", "date": "2019-01-25T20:00:00.000Z" } ] }
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.BulkDocs; import com.ibm.cloud.cloudant.v1.model.Document; import com.ibm.cloud.cloudant.v1.model.DocumentResult; import com.ibm.cloud.cloudant.v1.model.PostBulkDocsOptions; import java.util.Arrays; import java.util.List;
Cloudant service = Cloudant.newInstance(); Document eventDoc1 = new Document(); eventDoc1.setId("ns1HJS13AMkK:0007241142412418284"); eventDoc1.put("type", "event"); eventDoc1.put("userId", "abc123"); eventDoc1.put("eventType", "addedToBasket"); eventDoc1.put("productId", "1000042"); eventDoc1.put("date", "2019-01-28T10:44:22.000Z"); Document eventDoc2 = new Document(); eventDoc2.setId("H8tDIwfadxp9:0007241142412418285"); eventDoc2.put("type", "event"); eventDoc2.put("userId", "abc234"); eventDoc2.put("eventType", "addedToBasket"); eventDoc2.put("productId", "1000050"); eventDoc2.put("date", "2019-01-28T10:44:22.000Z"); BulkDocs bulkDocs = new BulkDocs.Builder() .docs(Arrays.asList(eventDoc1, eventDoc2)) .build(); PostBulkDocsOptions bulkDocsOptions = new PostBulkDocsOptions.Builder() .db("events") .bulkDocs(bulkDocs) .build(); List<DocumentResult> response = service.postBulkDocs(bulkDocsOptions).execute() .getResult(); System.out.println(response);
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.BulkDocs; import com.ibm.cloud.cloudant.v1.model.Document; import com.ibm.cloud.cloudant.v1.model.DocumentResult; import com.ibm.cloud.cloudant.v1.model.PostBulkDocsOptions; import java.util.Arrays; import java.util.List;
Cloudant service = Cloudant.newInstance(); Document eventDoc1 = new Document(); eventDoc1.setId("ns1HJS13AMkK:0007241142412418284"); eventDoc1.setRev("1-5005d65514fe9e90f8eccf174af5dd64"); eventDoc1.setDeleted(true); Document eventDoc2 = new Document(); eventDoc2.setId("H8tDIwfadxp9:0007241142412418285"); eventDoc1.setRev("1-2d7810b054babeda4812b3924428d6d6"); eventDoc1.setDeleted(true); BulkDocs bulkDocs = new BulkDocs.Builder() .docs(Arrays.asList(eventDoc1, eventDoc2)) .build(); PostBulkDocsOptions bulkDocsOptions = new PostBulkDocsOptions.Builder() .db("events") .bulkDocs(bulkDocs) .build(); List<DocumentResult> response = service.postBulkDocs(bulkDocsOptions).execute() .getResult(); System.out.println(response);
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.DocumentResult; import com.ibm.cloud.cloudant.v1.model.PostBulkDocsOptions; import java.util.List; import java.io.File; import java.io.FileInputStream;
Cloudant service = Cloudant.newInstance(); File file = new File("upload.json"); FileInputStream inputStream = new FileInputStream(file); PostBulkDocsOptions bulkDocsOptions = new PostBulkDocsOptions.Builder() .db("events") .body(inputStream) .build(); List<DocumentResult> response = service.postBulkDocs(bulkDocsOptions).execute() .getResult(); System.out.println(response);
Content of upload.json
{ "docs": [ { "_id": "ns1HJS13AMkK:0007241142412418284", "type": "event", "userId": "abc123", "eventType": "addedToBasket", "productId": "1000042", "date": "2019-01-28T10:44:22.000Z" }, { "_id": "H8tDIwfadxp9:0007241142412418285", "type": "event", "userId": "abc234", "eventType": "addedToBasket", "productId": "1000050", "date": "2019-01-25T20:00:00.000Z" } ] }
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); const eventDoc1: CloudantV1.Document = { _id: 'ns1HJS13AMkK:0007241142412418284', type: 'event', userId: 'abc123', eventType:'addedToBasket', productId: '1000042', date: '2019-01-28T10:44:22.000Z' } const eventDoc2: CloudantV1.Document = { _id: 'H8tDIwfadxp9:0007241142412418285', type: 'event', userId: 'abc234', eventType: 'addedToBasket', productId: '1000050', date: '2019-01-25T20:00:00.000Z' } const bulkDocs: CloudantV1.BulkDocs = { docs: [eventDoc1, eventDoc2] } service.postBulkDocs({ db: 'events', bulkDocs: bulkDocs }).then(response => { console.log(response.result); });
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); const eventDoc1: CloudantV1.Document = { _id: 'ns1HJS13AMkK:0007241142412418284', _rev: '1-5005d65514fe9e90f8eccf174af5dd64', _deleted: true, } const eventDoc2: CloudantV1.Document = { _id: 'H8tDIwfadxp9:0007241142412418285', _rev: '1-2d7810b054babeda4812b3924428d6d6', _deleted: true, } const bulkDocs: CloudantV1.BulkDocs = { docs: [eventDoc1, eventDoc2] } service.postBulkDocs({ db: 'events', bulkDocs: bulkDocs }).then(response => { console.log(response.result); });
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); let stream = fs.createReadStream("upload.json"); service.postBulkDocs({ db: 'events', bulkDocs: stream }).then(response => { console.log(response.result); });
Content of upload.json
{ "docs": [ { "_id": "ns1HJS13AMkK:0007241142412418284", "type": "event", "userId": "abc123", "eventType": "addedToBasket", "productId": "1000042", "date": "2019-01-28T10:44:22.000Z" }, { "_id": "H8tDIwfadxp9:0007241142412418285", "type": "event", "userId": "abc234", "eventType": "addedToBasket", "productId": "1000050", "date": "2019-01-25T20:00:00.000Z" } ] }
from ibmcloudant.cloudant_v1 import Document, CloudantV1, BulkDocs service = CloudantV1.new_instance() event_doc_1 = Document( _id="ns1HJS13AMkK:0007241142412418284", type="event", userId="abc123", eventType="addedToBasket", productId="1000042", date="2019-01-28T10:44:22.000Z" ) event_doc_2 = Document( _id="H8tDIwfadxp9:0007241142412418285", type="event", userId="abc234", eventType="addedToBasket", productId="1000050", date="2019-01-25T20:00:00.000Z" ) bulk_docs = BulkDocs(docs=[event_doc_1, event_doc_2]) response = service.post_bulk_docs( db='events', bulk_docs=bulk_docs ).get_result() print(response)
from ibmcloudant.cloudant_v1 import Document, CloudantV1, BulkDocs service = CloudantV1.new_instance() event_doc_1 = Document( _id="ns1HJS13AMkK:0007241142412418284", _rev="1-5005d65514fe9e90f8eccf174af5dd64", _deleted=True, ) event_doc_2 = Document( _id="H8tDIwfadxp9:0007241142412418285", _rev="1-2d7810b054babeda4812b3924428d6d6", _deleted=True, ) bulk_docs = BulkDocs(docs=[event_doc_1, event_doc_2]) response = service.post_bulk_docs( db='events', bulk_docs=bulk_docs ).get_result() print(response)
from ibmcloudant.cloudant_v1 import Document, CloudantV1 service = CloudantV1.new_instance() with open('upload.json', 'rb') as f: response = service.post_bulk_docs( db='events', bulk_docs=f ).get_result() print(response)
Content of upload.json
{ "docs": [ { "_id": "ns1HJS13AMkK:0007241142412418284", "type": "event", "userId": "abc123", "eventType": "addedToBasket", "productId": "1000042", "date": "2019-01-28T10:44:22.000Z" }, { "_id": "H8tDIwfadxp9:0007241142412418285", "type": "event", "userId": "abc234", "eventType": "addedToBasket", "productId": "1000050", "date": "2019-01-25T20:00:00.000Z" } ] }
Response
Response type: []DocumentResult
Response type: List<DocumentResult>
Response type: DocumentResult[]
Response type: List[DocumentResult]
Schema for a list of response statuses for each document in a bulk documents operation.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
ok
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Status Code
HTTP response for postBulkDocs.
HTTP response for postBulkDocs.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example BulkDocsResult response.
[ { "id": "0007241142412418284", "ok": true, "rev": "1-5005d65514fe9e90f8eccf174af5dd64" }, { "id": "0008001142412418285", "ok": true, "rev": "1-2d7810b054babeda4812b3924428d6d6" } ]
Example BulkDocsResult response.
[ { "id": "0007241142412418284", "ok": true, "rev": "1-5005d65514fe9e90f8eccf174af5dd64" }, { "id": "0008001142412418285", "ok": true, "rev": "1-2d7810b054babeda4812b3924428d6d6" } ]
Example BulkDocsResult response.
[ { "id": "0007241142412418284", "ok": true, "rev": "1-5005d65514fe9e90f8eccf174af5dd64" }, { "id": "0008001142412418285", "ok": true, "rev": "1-2d7810b054babeda4812b3924428d6d6" } ]
Example BulkDocsResult response.
[ { "id": "0007241142412418284", "ok": true, "rev": "1-5005d65514fe9e90f8eccf174af5dd64" }, { "id": "0008001142412418285", "ok": true, "rev": "1-2d7810b054babeda4812b3924428d6d6" } ]
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Bulk query revision information for multiple documents
Fetch specific revisions or revision histories for multiple documents in bulk as replicators do.
Fetch specific revisions or revision histories for multiple documents in bulk as replicators do.
Fetch specific revisions or revision histories for multiple documents in bulk as replicators do.
Fetch specific revisions or revision histories for multiple documents in bulk as replicators do.
Fetch specific revisions or revision histories for multiple documents in bulk as replicators do.
POST /{db}/_bulk_get
(cloudant *CloudantV1) PostBulkGet(postBulkGetOptions *PostBulkGetOptions) (result *BulkGetResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostBulkGetWithContext(ctx context.Context, postBulkGetOptions *PostBulkGetOptions) (result *BulkGetResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostBulkGetAsMixed(postBulkGetOptions *PostBulkGetOptions) (result io.ReadCloser, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostBulkGetAsRelated(postBulkGetOptions *PostBulkGetOptions) (result io.ReadCloser, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostBulkGetAsStream(postBulkGetOptions *PostBulkGetOptions) (result io.ReadCloser, response *core.DetailedResponse, err error)
ServiceCall<BulkGetResult> postBulkGet(PostBulkGetOptions postBulkGetOptions)
ServiceCall<InputStream> postBulkGetAsMixed(PostBulkGetOptions postBulkGetOptions)
ServiceCall<InputStream> postBulkGetAsRelated(PostBulkGetOptions postBulkGetOptions)
ServiceCall<InputStream> postBulkGetAsStream(PostBulkGetOptions postBulkGetOptions)
postBulkGet(params)
postBulkGetAsMixed(params)
postBulkGetAsRelated(params)
postBulkGetAsStream(params)
post_bulk_get(
self,
db: str,
docs: List['BulkGetQueryDocument'],
*,
attachments: Optional[bool] = None,
att_encoding_info: Optional[bool] = None,
latest: Optional[bool] = None,
revs: Optional[bool] = None,
**kwargs,
) -> DetailedResponse
post_bulk_get_as_mixed(
self,
db: str,
docs: List['BulkGetQueryDocument'],
*,
attachments: Optional[bool] = None,
att_encoding_info: Optional[bool] = None,
latest: Optional[bool] = None,
revs: Optional[bool] = None,
**kwargs,
) -> DetailedResponse
post_bulk_get_as_related(
self,
db: str,
docs: List['BulkGetQueryDocument'],
*,
attachments: Optional[bool] = None,
att_encoding_info: Optional[bool] = None,
latest: Optional[bool] = None,
revs: Optional[bool] = None,
**kwargs,
) -> DetailedResponse
post_bulk_get_as_stream(
self,
db: str,
docs: List['BulkGetQueryDocument'],
*,
attachments: Optional[bool] = None,
att_encoding_info: Optional[bool] = None,
latest: Optional[bool] = None,
revs: Optional[bool] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the PostBulkGetOptions
struct and set the fields to provide parameter values for the PostBulkGet
method.
Use the PostBulkGetOptions.Builder
to create a PostBulkGetOptions
object that contains the parameter values for the postBulkGet
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Allowable values: [
application/json
,multipart/mixed
,multipart/related
]
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Query Parameters
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
false
Query parameter to specify whether to include a list of all known document revisions.
Default:
false
HTTP request body for postBulkGet.
Example BulkGetQuery request.
{
"docs": [
{
"id": "order00067",
"rev": "3-917fa2381192822767f010b95b45325b"
},
{
"id": "order00067",
"rev": "4-a5be949eeb7296747cc271766e9a498b"
}
]
}
List of document items to get in bulk.
Possible values: 0 ≤ number of items ≤ 65535
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The PostBulkGet options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
List of document items to get in bulk.
Possible values: 0 ≤ number of items ≤ 65535
Examples:[ { "id": "order00067", "rev": "3-917fa2381192822767f010b95b45325b" }, { "id": "order00067", "rev": "4-a5be949eeb7296747cc271766e9a498b" } ]
- Docs
Includes attachments only since specified revisions.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Examples:[ "1-99b02e08da151943c2dcb40090160bb8" ]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
false
Query parameter to specify whether to include a list of all known document revisions.
Default:
false
The postBulkGet options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
List of document items to get in bulk.
Possible values: 0 ≤ number of items ≤ 65535
Examples:[ { "id": "order00067", "rev": "3-917fa2381192822767f010b95b45325b" }, { "id": "order00067", "rev": "4-a5be949eeb7296747cc271766e9a498b" } ]
- docs
Includes attachments only since specified revisions.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Examples:[ "1-99b02e08da151943c2dcb40090160bb8" ]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
false
Query parameter to specify whether to include a list of all known document revisions.
Default:
false
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
List of document items to get in bulk.
Possible values: 0 ≤ number of items ≤ 65535
Examples:- docs
Includes attachments only since specified revisions.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Examples:[ "1-99b02e08da151943c2dcb40090160bb8" ]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
false
Query parameter to specify whether to include a list of all known document revisions.
Default:
false
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
List of document items to get in bulk.
Possible values: 0 ≤ number of items ≤ 65535
Examples:- docs
Includes attachments only since specified revisions.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Examples:[ "1-99b02e08da151943c2dcb40090160bb8" ]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
false
Query parameter to specify whether to include a list of all known document revisions.
Default:
false
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X POST "$SERVICE_URL/orders/_bulk_get" -H "Content-Type: application/json" --data '{ "docs": [ { "id": "order00067", "rev": "3-917fa2381192822767f010b95b45325b" }, { "id": "order00067" "rev": "4-a5be949eeb7296747cc271766e9a498b" } ], }'
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" "github.com/IBM/go-sdk-core/v5/core" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } docID := "order00067" bulkGetDocs := []cloudantv1.BulkGetQueryDocument{ { ID: &docID, Rev: core.StringPtr("3-917fa2381192822767f010b95b45325b"), }, { ID: &docID, Rev: core.StringPtr("4-a5be949eeb7296747cc271766e9a498b"), }, } postBulkGetOptions := service.NewPostBulkGetOptions( "orders", bulkGetDocs, ) bulkGetResult, response, err := service.PostBulkGet(postBulkGetOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(bulkGetResult, "", " ") fmt.Println(string(b))
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" "github.com/IBM/go-sdk-core/v5/core" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } postBulkGetOptions := service.NewPostBulkGetOptions( "orders", []cloudantv1.BulkGetQueryDocument{{ID: core.StringPtr("order00067")}}, ) bulkGetResult, response, err := service.PostBulkGet(postBulkGetOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(bulkGetResult, "", " ") fmt.Println(string(b))
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } docID := "order00058" postBulkGetOptions := service.NewPostBulkGetOptions( "orders", []cloudantv1.BulkGetQueryDocument{ { ID: &docID, AttsSince: []string{"1-99b02e08da151943c2dcb40090160bb8"}, }, }, ) bulkGetResult, response, err := service.PostBulkGet(postBulkGetOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(bulkGetResult, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.BulkGetQueryDocument; import com.ibm.cloud.cloudant.v1.model.BulkGetResult; import com.ibm.cloud.cloudant.v1.model.PostBulkGetOptions; import java.util.ArrayList; import java.util.List;
Cloudant service = Cloudant.newInstance(); String docId = "order00067"; List<BulkGetQueryDocument> bulkGetDocs = new ArrayList<>(); bulkGetDocs.add( new BulkGetQueryDocument.Builder() .id(docId) .rev("3-917fa2381192822767f010b95b45325b") .build()); bulkGetDocs.add( new BulkGetQueryDocument.Builder() .id(docId) .rev("4-a5be949eeb7296747cc271766e9a498b") .build()); PostBulkGetOptions bulkGetOptions = new PostBulkGetOptions.Builder() .db("orders") .docs(bulkGetDocs) .build(); BulkGetResult response = service.postBulkGet(bulkGetOptions).execute() .getResult(); System.out.println(response);
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.BulkGetQueryDocument; import com.ibm.cloud.cloudant.v1.model.BulkGetResult; import com.ibm.cloud.cloudant.v1.model.PostBulkGetOptions; import java.util.Arrays;
Cloudant service = Cloudant.newInstance(); BulkGetQueryDocument bulkGetDoc = new BulkGetQueryDocument.Builder() .id("order00067") .build(); PostBulkGetOptions postBulkGetOptions = new PostBulkGetOptions.Builder() .db("orders") .docs(Arrays.asList(bulkGetDoc)) .build(); BulkGetResult response = service.postBulkGet(postBulkGetOptions).execute() .getResult(); System.out.println(response);
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.BulkGetQueryDocument; import com.ibm.cloud.cloudant.v1.model.BulkGetResult; import com.ibm.cloud.cloudant.v1.model.PostBulkGetOptions; import java.util.Arrays;
Cloudant service = Cloudant.newInstance(); BulkGetQueryDocument bulkGetQueryDocument = new BulkGetQueryDocument.Builder() .id("order00058") .addAttsSince("1-99b02e08da151943c2dcb40090160bb8") .build(); PostBulkGetOptions postBulkGetOptions = new PostBulkGetOptions.Builder() .db("orders") .docs(Arrays.asList(bulkGetQueryDocument)).build(); BulkGetResult response = service.postBulkGet(postBulkGetOptions).execute() .getResult(); System.out.println(response);
const service = CloudantV1.newInstance({}); const docId = 'order00067'; const bulkGetDoc1: CloudantV1.BulkGetQueryDocument = { id: docId, rev: '3-917fa2381192822767f010b95b45325b' }; const bulkGetDoc2: CloudantV1.BulkGetQueryDocument = { id: docId, rev: '4-a5be949eeb7296747cc271766e9a498b' }; const bulkGetDocs: CloudantV1.BulkGetQueryDocument[] = [bulkGetDoc1, bulkGetDoc2]; const postBulkGetParams: CloudantV1.PostBulkGetParams = { db: 'orders', docs: bulkGetDocs, }; service.postBulkGet(postBulkGetParams) .then(response => { console.log(response.result); });
const service = CloudantV1.newInstance({}); const bulkGetDocs: CloudantV1.BulkGetQueryDocument[] = [ { id: 'order00067', }, ]; const postBulkGetParams: CloudantV1.PostBulkGetParams = { db: 'orders', docs: bulkGetDocs, }; service.postBulkGet(postBulkGetParams) .then(response => { console.log(response.result); });
const service = CloudantV1.newInstance({}); const bulkGetQueryDocuments: CloudantV1.BulkGetQueryDocument[] = [ { id: 'order00058', attsSince: ['1-99b02e08da151943c2dcb40090160bb8'] }, ]; const postBulkGetParams: CloudantV1.PostBulkGetParams = { db: 'orders', docs: bulkGetQueryDocuments, }; service.postBulkGet(postBulkGetParams) .then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import BulkGetQueryDocument, CloudantV1 service = CloudantV1.new_instance() doc_id = 'order00067' bulk_get_doc_1 = BulkGetQueryDocument( id=doc_id, rev='3-917fa2381192822767f010b95b45325b') bulk_get_doc_2 = BulkGetQueryDocument( id=doc_id, rev='4-a5be949eeb7296747cc271766e9a498b') response = service.post_bulk_get( db='orders', docs=[bulk_get_doc_1, bulk_get_doc_2], ).get_result() print(response)
from ibmcloudant.cloudant_v1 import BulkGetQueryDocument, CloudantV1 service = CloudantV1.new_instance() bulk_get_doc = BulkGetQueryDocument(id='order00067') response = service.post_bulk_get( db='orders', docs=[bulk_get_doc], ).get_result() print(response)
from ibmcloudant.cloudant_v1 import BulkGetQueryDocument, CloudantV1 service = CloudantV1.new_instance() bulk_get_doc = BulkGetQueryDocument( id='order00058', atts_since=['1-99b02e08da151943c2dcb40090160bb8']) response = service.post_bulk_get( db='orders', docs=[bulk_get_doc] ).get_result() print(response)
Response
Response type for PostBulkGet
: BulkGetResult
Response type for PostBulkGetAsMixed
: io.ReadCloser
Response type for PostBulkGetAsRelated
: io.ReadCloser
Response type for PostBulkGetAsStream
: io.ReadCloser
Response type for postBulkGet
: BulkGetResult
Response type for postBulkGetAsMixed
: InputStream
Response type for postBulkGetAsRelated
: InputStream
Response type for postBulkGetAsStream
: InputStream
Response type for postBulkGet
: BulkGetResult
Response type for postBulkGetAsMixed
: NodeJS.ReadableStream
Response type for postBulkGetAsRelated
: NodeJS.ReadableStream
Response type for postBulkGetAsStream
: NodeJS.ReadableStream
Response type for post_bulk_get
: BulkGetResult
Response type for post_bulk_get_as_mixed
: BinaryIO
Response type for post_bulk_get_as_related
: BinaryIO
Response type for post_bulk_get_as_stream
: BinaryIO
Schema for the results object of a bulk get operation.
Results
Possible values: 0 ≤ number of items ≤ 4294967295
Schema for the results object of a bulk get operation.
Results.
Possible values: number of items ≥ 0
- Results
Array of document revisions or error information.
Possible values: number of items ≥ 1
- Docs
Schema for the result of a document modification.
- Error
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a document.
- Ok
Schema for a map of attachment name to attachment metadata.
- Attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- Revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- RevsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for the results object of a bulk get operation.
Results.
Possible values: number of items ≥ 0
- results
Array of document revisions or error information.
Possible values: number of items ≥ 1
- docs
Schema for the result of a document modification.
- error
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a document.
- ok
Schema for a map of attachment name to attachment metadata.
- attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- revsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for the results object of a bulk get operation.
Results.
Possible values: number of items ≥ 0
- results
Array of document revisions or error information.
Possible values: number of items ≥ 1
- docs
Schema for the result of a document modification.
- error
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a document.
- ok
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for the results object of a bulk get operation.
Results.
Possible values: number of items ≥ 0
- results
Array of document revisions or error information.
Possible values: number of items ≥ 1
- docs
Schema for the result of a document modification.
- error
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a document.
- ok
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Status Code
HTTP response for postBulkGet.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example BulkGetResult response.
{ "results": [ { "docs": [ { "ok": { "_id": "order00067", "_rev": "3-917fa2381192822767f010b95b45325b", "basket": [ { "name": "Salter - Digital Kitchen Scales", "price": 14.99 } ], "date": "2019-01-21T10:10:12.000Z", "delivered": false, "deliveryAddress": { "postcode": "DL5 1TY", "street": "19 Front St", "town": "Darlington" }, "orderid": "00067", "total": 14.99, "type": "order", "user": "Bob Smith", "userid": "abc123" } } ], "id": "order00067" }, { "docs": [ { "ok": { "_id": "order00067", "_rev": "4-a5be949eeb7296747cc271766e9a498b", "basket": [ { "name": "Salter - Digital Kitchen Scales", "price": 14.99 }, { "name": "Kenwood - Stand Mixer", "price": 199.99 } ], "courier": "UPS", "courierid": "15125425151261289", "date": "2019-01-28T10:44:22.000Z", "delivered": true, "deliveryAddress": { "postcode": "DL5 1TY", "street": "19 Front St", "town": "Darlington" }, "orderid": "00067", "total": 214.98, "type": "order", "user": "Bob Smith", "userid": "abc123" } } ], "id": "order00067" } ] }
Example BulkGetResult response.
{ "results": [ { "docs": [ { "ok": { "_id": "order00067", "_rev": "3-917fa2381192822767f010b95b45325b", "basket": [ { "name": "Salter - Digital Kitchen Scales", "price": 14.99 } ], "date": "2019-01-21T10:10:12.000Z", "delivered": false, "deliveryAddress": { "postcode": "DL5 1TY", "street": "19 Front St", "town": "Darlington" }, "orderid": "00067", "total": 14.99, "type": "order", "user": "Bob Smith", "userid": "abc123" } } ], "id": "order00067" }, { "docs": [ { "ok": { "_id": "order00067", "_rev": "4-a5be949eeb7296747cc271766e9a498b", "basket": [ { "name": "Salter - Digital Kitchen Scales", "price": 14.99 }, { "name": "Kenwood - Stand Mixer", "price": 199.99 } ], "courier": "UPS", "courierid": "15125425151261289", "date": "2019-01-28T10:44:22.000Z", "delivered": true, "deliveryAddress": { "postcode": "DL5 1TY", "street": "19 Front St", "town": "Darlington" }, "orderid": "00067", "total": 214.98, "type": "order", "user": "Bob Smith", "userid": "abc123" } } ], "id": "order00067" } ] }
Example BulkGetResult response for the
atts_since
alternative request.{ "results": [ { "docs": [ { "ok": { "_attachments": { "att": { "content_type": "application/json", "digest": "md5-cCkGbCesb17xjWYNV0GXmg==", "length": 0, "revpos": 1, "stub": true } }, "_id": "order00058", "_rev": "1-99b02e08da151943c2dcb40090160bb8" } } ], "id": "order00058" } ] }
Example BulkGetResult response for the
atts_since
alternative request.{ "results": [ { "docs": [ { "ok": { "_attachments": { "att": { "content_type": "application/json", "digest": "md5-cCkGbCesb17xjWYNV0GXmg==", "length": 0, "revpos": 1, "stub": true } }, "_id": "order00058", "_rev": "1-99b02e08da151943c2dcb40090160bb8" } } ], "id": "order00058" } ] }
Example BulkGetResult response for the
open_revs=all
alternative request.{ "results": [ { "docs": [ { "ok": { "_id": "order00067", "_rev": "3-917fa2381192822767f010b95b45325b", "basket": [ { "name": "Salter - Digital Kitchen Scales", "price": 14.99 } ], "date": "2019-01-21T10:10:12.000Z", "delivered": false, "deliveryAddress": { "postcode": "DL5 1TY", "street": "19 Front St", "town": "Darlington" }, "orderid": "00067", "total": 14.99, "type": "order", "user": "Bob Smith", "userid": "abc123" } }, { "ok": { "_id": "order00067", "_rev": "4-a5be949eeb7296747cc271766e9a498b", "basket": [ { "name": "Salter - Digital Kitchen Scales", "price": 14.99 }, { "name": "Kenwood - Stand Mixer", "price": 199.99 } ], "courier": "UPS", "courierid": "15125425151261289", "date": "2019-01-28T10:44:22.000Z", "delivered": true, "deliveryAddress": { "postcode": "DL5 1TY", "street": "19 Front St", "town": "Darlington" }, "orderid": "00067", "total": 214.98, "type": "order", "user": "Bob Smith", "userid": "abc123" } } ], "id": "order00067" } ] }
Example BulkGetResult response for the
open_revs=all
alternative request.{ "results": [ { "docs": [ { "ok": { "_id": "order00067", "_rev": "3-917fa2381192822767f010b95b45325b", "basket": [ { "name": "Salter - Digital Kitchen Scales", "price": 14.99 } ], "date": "2019-01-21T10:10:12.000Z", "delivered": false, "deliveryAddress": { "postcode": "DL5 1TY", "street": "19 Front St", "town": "Darlington" }, "orderid": "00067", "total": 14.99, "type": "order", "user": "Bob Smith", "userid": "abc123" } }, { "ok": { "_id": "order00067", "_rev": "4-a5be949eeb7296747cc271766e9a498b", "basket": [ { "name": "Salter - Digital Kitchen Scales", "price": 14.99 }, { "name": "Kenwood - Stand Mixer", "price": 199.99 } ], "courier": "UPS", "courierid": "15125425151261289", "date": "2019-01-28T10:44:22.000Z", "delivered": true, "deliveryAddress": { "postcode": "DL5 1TY", "street": "19 Front St", "town": "Darlington" }, "orderid": "00067", "total": 214.98, "type": "order", "user": "Bob Smith", "userid": "abc123" } } ], "id": "order00067" } ] }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Query a list of all documents in a database partition (GET)
Queries the primary index (all document IDs). The results that match the query parameters are returned in a JSON object, including a list of matching documents with basic contents, such as the ID and revision. When no query parameters are specified, results for all documents in the database partition are returned. Optionally, document content or additional metadata can be included in the response.
GET /{db}/_partition/{partition_key}/_all_docs
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_:][^:]*$
Query Parameters
Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Query parameter to specify whether to return the documents in descending by key order.
Default:
false
Query parameter to specify to stop returning records when the specified key is reached. String representation of any JSON type that matches the key type emitted by the view function.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query parameter to specify to stop returning records when the specified document ID is reached.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].*$
Query parameter to specify whether to include the full content of the documents in the response.
Default:
false
Query parameter to specify whether the specified end key should be included in the result.
Default:
true
Query parameter to specify to return only documents that match the specified key. String representation of any JSON type that matches the key type emitted by the view function.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query parameter to specify returning only documents that match any of the specified keys. String representation of a JSON array of keys that match the key type emitted by the view function. Must be URL encoded.
Possible values: 2 ≤ length ≤ 7168, Value must match regular expression
^\[(".*")*\]$
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Query parameter to specify to start returning records from the specified key. String representation of any JSON type that matches the key type emitted by the view function.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query parameter to specify to start returning records from the specified document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].*$
Query parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/products/_partition/small-appliances/_all_docs?include_docs=true"
Response
Schema for the result of an all documents operation.
Offset where the list started.
Possible values: 0 ≤ value ≤ 9007199254740992
Total number of document results.
Possible values: 0 ≤ value ≤ 4294967295
List of doc results.
Possible values: 0 ≤ number of items ≤ 4294967295
Current update sequence for the database
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Status Code
HTTP response for getPartitionAllDocs and postPartitionAllDocs.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example AllDocsResult response for a database partition.
{ "offset": 0, "rows": [ { "id": "small-appliances:1000042", "key": "small-appliances:1000042", "value": { "rev": "1-5005d65514fe9e90f8eccf174af5dd64" } }, { "id": "small-appliances:1000043", "key": "small-appliances:1000043", "value": { "rev": "1-2d7810b054babeda4812b3924428d6d6" } } ], "total_rows": 2 }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve HTTP headers for a list of all documents in a database partition (GET)
Retrieves the HTTP headers for a list of all documents in a database partition (GET).
HEAD /{db}/_partition/{partition_key}/_all_docs
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_:][^:]*$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for
/_all_docs
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Delete a document
Marks the specified document as deleted by adding a _deleted
field with the value true
. Documents with this field are not returned within requests anymore but stay in the database. You must supply the current (latest) revision, either by using the rev
parameter or by using the If-Match
header to specify the revision.
Marks the specified document as deleted by adding a _deleted
field with the value true
. Documents with this field are not returned within requests anymore but stay in the database. You must supply the current (latest) revision, either by using the rev
parameter or by using the If-Match
header to specify the revision.
Marks the specified document as deleted by adding a _deleted
field with the value true
. Documents with this field are not returned within requests anymore but stay in the database. You must supply the current (latest) revision, either by using the rev
parameter or by using the If-Match
header to specify the revision.
Marks the specified document as deleted by adding a _deleted
field with the value true
. Documents with this field are not returned within requests anymore but stay in the database. You must supply the current (latest) revision, either by using the rev
parameter or by using the If-Match
header to specify the revision.
Marks the specified document as deleted by adding a _deleted
field with the value true
. Documents with this field are not returned within requests anymore but stay in the database. You must supply the current (latest) revision, either by using the rev
parameter or by using the If-Match
header to specify the revision.
DELETE /{db}/{doc_id}
(cloudant *CloudantV1) DeleteDocument(deleteDocumentOptions *DeleteDocumentOptions) (result *DocumentResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) DeleteDocumentWithContext(ctx context.Context, deleteDocumentOptions *DeleteDocumentOptions) (result *DocumentResult, response *core.DetailedResponse, err error)
ServiceCall<DocumentResult> deleteDocument(DeleteDocumentOptions deleteDocumentOptions)
deleteDocument(params)
delete_document(
self,
db: str,
doc_id: str,
*,
if_match: Optional[str] = None,
batch: Optional[str] = None,
rev: Optional[str] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the DeleteDocumentOptions
struct and set the fields to provide parameter values for the DeleteDocument
method.
Use the DeleteDocumentOptions.Builder
to create a DeleteDocumentOptions
object that contains the parameter values for the deleteDocument
method.
Custom Headers
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
^"[A-Za-z0-9+\/]{2,24}={0,3}"$|^"[1-9]\d{0,9}-[\da-f]{32}"$|^"[0-9A-Z]{25}"$
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Query Parameters
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The DeleteDocument options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
The deleteDocument options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X DELETE "$SERVICE_URL/events/0007241142412418284?rev=2-9a0d1cd9f40472509e9aac6461837367"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } deleteDocumentOptions := service.NewDeleteDocumentOptions( "orders", "order00058", ) deleteDocumentOptions.SetRev("1-99b02e08da151943c2dcb40090160bb8") documentResult, response, err := service.DeleteDocument(deleteDocumentOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(documentResult, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.DeleteDocumentOptions; import com.ibm.cloud.cloudant.v1.model.DocumentResult;
Cloudant service = Cloudant.newInstance(); DeleteDocumentOptions documentOptions = new DeleteDocumentOptions.Builder() .db("orders") .docId("order00058") .rev("1-99b02e08da151943c2dcb40090160bb8") .build(); DocumentResult response = service.deleteDocument(documentOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.deleteDocument({ db: 'orders', docId: 'order00058', rev: '1-99b02e08da151943c2dcb40090160bb8' }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.delete_document( db='orders', doc_id='order00058', rev='1-99b02e08da151943c2dcb40090160bb8' ).get_result() print(response)
Response
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
ok
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Status Code
HTTP response for Document modification operations.
HTTP response for Document modification operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for conflict.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for a document update conflict.
{ "error": "conflict", "reason": "Document update conflict." }
Example error response for a document update conflict.
{ "error": "conflict", "reason": "Document update conflict." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve a document
Returns document with the specified doc_id
from the specified database. Unless you request a specific revision, the latest revision of the document is always returned.
Returns document with the specified doc_id
from the specified database. Unless you request a specific revision, the latest revision of the document is always returned.
Returns document with the specified doc_id
from the specified database. Unless you request a specific revision, the latest revision of the document is always returned.
Returns document with the specified doc_id
from the specified database. Unless you request a specific revision, the latest revision of the document is always returned.
Returns document with the specified doc_id
from the specified database. Unless you request a specific revision, the latest revision of the document is always returned.
GET /{db}/{doc_id}
(cloudant *CloudantV1) GetDocument(getDocumentOptions *GetDocumentOptions) (result *Document, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) GetDocumentWithContext(ctx context.Context, getDocumentOptions *GetDocumentOptions) (result *Document, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) GetDocumentAsMixed(getDocumentOptions *GetDocumentOptions) (result io.ReadCloser, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) GetDocumentAsRelated(getDocumentOptions *GetDocumentOptions) (result io.ReadCloser, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) GetDocumentAsStream(getDocumentOptions *GetDocumentOptions) (result io.ReadCloser, response *core.DetailedResponse, err error)
ServiceCall<Document> getDocument(GetDocumentOptions getDocumentOptions)
ServiceCall<InputStream> getDocumentAsMixed(GetDocumentOptions getDocumentOptions)
ServiceCall<InputStream> getDocumentAsRelated(GetDocumentOptions getDocumentOptions)
ServiceCall<InputStream> getDocumentAsStream(GetDocumentOptions getDocumentOptions)
getDocument(params)
getDocumentAsMixed(params)
getDocumentAsRelated(params)
getDocumentAsStream(params)
get_document(
self,
db: str,
doc_id: str,
*,
if_none_match: Optional[str] = None,
attachments: Optional[bool] = None,
att_encoding_info: Optional[bool] = None,
conflicts: Optional[bool] = None,
deleted_conflicts: Optional[bool] = None,
latest: Optional[bool] = None,
local_seq: Optional[bool] = None,
meta: Optional[bool] = None,
rev: Optional[str] = None,
revs: Optional[bool] = None,
revs_info: Optional[bool] = None,
**kwargs,
) -> DetailedResponse
get_document_as_mixed(
self,
db: str,
doc_id: str,
*,
if_none_match: Optional[str] = None,
attachments: Optional[bool] = None,
att_encoding_info: Optional[bool] = None,
conflicts: Optional[bool] = None,
deleted_conflicts: Optional[bool] = None,
latest: Optional[bool] = None,
local_seq: Optional[bool] = None,
meta: Optional[bool] = None,
rev: Optional[str] = None,
revs: Optional[bool] = None,
revs_info: Optional[bool] = None,
**kwargs,
) -> DetailedResponse
get_document_as_related(
self,
db: str,
doc_id: str,
*,
if_none_match: Optional[str] = None,
attachments: Optional[bool] = None,
att_encoding_info: Optional[bool] = None,
conflicts: Optional[bool] = None,
deleted_conflicts: Optional[bool] = None,
latest: Optional[bool] = None,
local_seq: Optional[bool] = None,
meta: Optional[bool] = None,
rev: Optional[str] = None,
revs: Optional[bool] = None,
revs_info: Optional[bool] = None,
**kwargs,
) -> DetailedResponse
get_document_as_stream(
self,
db: str,
doc_id: str,
*,
if_none_match: Optional[str] = None,
attachments: Optional[bool] = None,
att_encoding_info: Optional[bool] = None,
conflicts: Optional[bool] = None,
deleted_conflicts: Optional[bool] = None,
latest: Optional[bool] = None,
local_seq: Optional[bool] = None,
meta: Optional[bool] = None,
rev: Optional[str] = None,
revs: Optional[bool] = None,
revs_info: Optional[bool] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the GetDocumentOptions
struct and set the fields to provide parameter values for the GetDocument
method.
Use the GetDocumentOptions.Builder
to create a GetDocumentOptions
object that contains the parameter values for the getDocument
method.
Custom Headers
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
^"[A-Za-z0-9+\/]{2,24}={0,3}"$|^"[1-9]\d{0,9}-[\da-f]{32}"$|^"[0-9A-Z]{25}"$
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Allowable values: [
application/json
,multipart/mixed
,multipart/related
]
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Query Parameters
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to include attachments only since specified revisions. Note this does not include the attachments for the specified revisions.
Possible values: 1 ≤ number of items ≤ 4294967295, 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Examples:[ "1-99b02e08da151943c2dcb40090160bb8" ]
Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Query parameter to specify whether to include a list of deleted conflicted revisions in the
_deleted_conflicts
property of the returned document.Default:
false
Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
false
Query parameter to specify whether to include the last update sequence for the document.
Default:
false
Query parameter to specify whether to include document meta information. Acts the same as specifying all of the conflicts, deleted_conflicts and open_revs query parameters.
Default:
false
Query parameter to specify leaf revisions to retrieve. Additionally, it accepts a value of
all
to return all leaf revisions.Possible values: 1 ≤ number of items ≤ 4294967295, 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Query parameter to specify whether to include a list of all known document revisions.
Default:
false
Query parameter to specify whether to includes detailed information for all known document revisions.
Default:
false
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The GetDocument options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Query parameter to specify whether to include a list of deleted conflicted revisions in the
_deleted_conflicts
property of the returned document.Default:
false
Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
false
Query parameter to specify whether to include the last update sequence for the document.
Default:
false
Query parameter to specify whether to include document meta information. Acts the same as specifying all of the conflicts, deleted_conflicts and open_revs query parameters.
Default:
false
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Query parameter to specify whether to include a list of all known document revisions.
Default:
false
Query parameter to specify whether to includes detailed information for all known document revisions.
Default:
false
The getDocument options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Query parameter to specify whether to include a list of deleted conflicted revisions in the
_deleted_conflicts
property of the returned document.Default:
false
Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
false
Query parameter to specify whether to include the last update sequence for the document.
Default:
false
Query parameter to specify whether to include document meta information. Acts the same as specifying all of the conflicts, deleted_conflicts and open_revs query parameters.
Default:
false
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Query parameter to specify whether to include a list of all known document revisions.
Default:
false
Query parameter to specify whether to includes detailed information for all known document revisions.
Default:
false
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Query parameter to specify whether to include a list of deleted conflicted revisions in the
_deleted_conflicts
property of the returned document.Default:
false
Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
false
Query parameter to specify whether to include the last update sequence for the document.
Default:
false
Query parameter to specify whether to include document meta information. Acts the same as specifying all of the conflicts, deleted_conflicts and open_revs query parameters.
Default:
false
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Query parameter to specify whether to include a list of all known document revisions.
Default:
false
Query parameter to specify whether to includes detailed information for all known document revisions.
Default:
false
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Query parameter to specify whether to include a list of deleted conflicted revisions in the
_deleted_conflicts
property of the returned document.Default:
false
Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
false
Query parameter to specify whether to include the last update sequence for the document.
Default:
false
Query parameter to specify whether to include document meta information. Acts the same as specifying all of the conflicts, deleted_conflicts and open_revs query parameters.
Default:
false
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Query parameter to specify whether to include a list of all known document revisions.
Default:
false
Query parameter to specify whether to includes detailed information for all known document revisions.
Default:
false
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/products/small-appliances:1000042"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } getDocumentOptions := service.NewGetDocumentOptions( "products", "1000042", ) document, response, err := service.GetDocument(getDocumentOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(document, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.Document; import com.ibm.cloud.cloudant.v1.model.GetDocumentOptions;
Cloudant service = Cloudant.newInstance(); GetDocumentOptions documentOptions = new GetDocumentOptions.Builder() .db("products") .docId("1000042") .build(); Document response = service.getDocument(documentOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.getDocument({ db: 'products', docId: '1000042' }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.get_document( db='products', doc_id='1000042' ).get_result() print(response)
Response
Response type for GetDocument
: Document
Response type for GetDocumentAsMixed
: io.ReadCloser
Response type for GetDocumentAsRelated
: io.ReadCloser
Response type for GetDocumentAsStream
: io.ReadCloser
Response type for getDocument
: Document
Response type for getDocumentAsMixed
: InputStream
Response type for getDocumentAsRelated
: InputStream
Response type for getDocumentAsStream
: InputStream
Response type for getDocument
: Document
Response type for getDocumentAsMixed
: NodeJS.ReadableStream
Response type for getDocumentAsRelated
: NodeJS.ReadableStream
Response type for getDocumentAsStream
: NodeJS.ReadableStream
Response type for get_document
: Document
Response type for get_document_as_mixed
: BinaryIO
Response type for get_document_as_related
: BinaryIO
Response type for get_document_as_stream
: BinaryIO
Schema for a document.
Schema for a map of attachment name to attachment metadata.
- _attachments
Schema for an attachment.
Schema for a list of document revision identifiers.
Possible values: 0 ≤ number of items ≤ 4294967295, 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Deletion flag. Available if document was removed
Schema for a list of document revision identifiers.
Possible values: 0 ≤ number of items ≤ 4294967295, 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Document's update sequence in current database. Available if requested with local_seq=true query parameter
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Schema for list of revision information.
Schema for a list of objects with information about local revisions and their status.
Possible values: 1 ≤ number of items ≤ 4294967295
Schema for a document.
Schema for a map of attachment name to attachment metadata.
- Attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- Revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- RevsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document.
Schema for a map of attachment name to attachment metadata.
- attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- revsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document.
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document.
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Status Code
HTTP response for Document.
HTTP response for not modified client redirect.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example Document.
{ "_id": "exampleid", "brand": "Foo", "colours": [ "red", "green", "black", "blue" ], "description": "Slim Colourful Design Electronic Cooking Appliance for ...", "image": "assets/img/0gmsnghhew.jpg", "keywords": [ "Foo", "Scales", "Weight", "Digital", "Kitchen" ], "name": "Digital Kitchen Scales", "price": 14.99, "productid": "1000042", "taxonomy": [ "Home", "Kitchen", "Small Appliances" ], "type": "product" }
Example Document.
{ "_id": "exampleid", "brand": "Foo", "colours": [ "red", "green", "black", "blue" ], "description": "Slim Colourful Design Electronic Cooking Appliance for ...", "image": "assets/img/0gmsnghhew.jpg", "keywords": [ "Foo", "Scales", "Weight", "Digital", "Kitchen" ], "name": "Digital Kitchen Scales", "price": 14.99, "productid": "1000042", "taxonomy": [ "Home", "Kitchen", "Small Appliances" ], "type": "product" }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a document ID does not exist.
{ "error": "not_found", "reason": "missing" }
Example error response for a document ID does not exist.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve the HTTP headers for the document
This method supports the same query arguments as the GET /{db}/{docid}
method, but only the header information (including document size and the revision as an ETag) is returned. The ETag header shows the current revision for the requested document, and the Content-Length specifies the length of the data if the document was requested in full. Add any of the query arguments, then the resulting HTTP headers that correspond to it are returned.
This method supports the same query arguments as the GET /{db}/{docid}
method, but only the header information (including document size and the revision as an ETag) is returned. The ETag header shows the current revision for the requested document, and the Content-Length specifies the length of the data if the document was requested in full. Add any of the query arguments, then the resulting HTTP headers that correspond to it are returned.
This method supports the same query arguments as the GET /{db}/{docid}
method, but only the header information (including document size and the revision as an ETag) is returned. The ETag header shows the current revision for the requested document, and the Content-Length specifies the length of the data if the document was requested in full. Add any of the query arguments, then the resulting HTTP headers that correspond to it are returned.
This method supports the same query arguments as the GET /{db}/{docid}
method, but only the header information (including document size and the revision as an ETag) is returned. The ETag header shows the current revision for the requested document, and the Content-Length specifies the length of the data if the document was requested in full. Add any of the query arguments, then the resulting HTTP headers that correspond to it are returned.
This method supports the same query arguments as the GET /{db}/{docid}
method, but only the header information (including document size and the revision as an ETag) is returned. The ETag header shows the current revision for the requested document, and the Content-Length specifies the length of the data if the document was requested in full. Add any of the query arguments, then the resulting HTTP headers that correspond to it are returned.
HEAD /{db}/{doc_id}
(cloudant *CloudantV1) HeadDocument(headDocumentOptions *HeadDocumentOptions) (response *core.DetailedResponse, err error)
(cloudant *CloudantV1) HeadDocumentWithContext(ctx context.Context, headDocumentOptions *HeadDocumentOptions) (response *core.DetailedResponse, err error)
ServiceCall<Void> headDocument(HeadDocumentOptions headDocumentOptions)
headDocument(params)
head_document(
self,
db: str,
doc_id: str,
*,
if_none_match: Optional[str] = None,
latest: Optional[bool] = None,
rev: Optional[str] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the HeadDocumentOptions
struct and set the fields to provide parameter values for the HeadDocument
method.
Use the HeadDocumentOptions.Builder
to create a HeadDocumentOptions
object that contains the parameter values for the headDocument
method.
Custom Headers
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
^"[A-Za-z0-9+\/]{2,24}={0,3}"$|^"[1-9]\d{0,9}-[\da-f]{32}"$|^"[0-9A-Z]{25}"$
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Query Parameters
Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
false
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The HeadDocument options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
false
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
The headDocument options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
false
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
false
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
false
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
curl -H "Authorization: Bearer $API_BEARER_TOKEN" --head "$SERVICE_URL/orders/0007741142412418284"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } headDocumentOptions := service.NewHeadDocumentOptions( "orders", "order00058", ) response, err := service.HeadDocument(headDocumentOptions) if err != nil { panic(err) } fmt.Println(response.StatusCode) fmt.Println(response.Headers["ETag"])
import com.ibm.cloud.sdk.core.http.Headers; import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.HeadDocumentOptions;
Cloudant service = Cloudant.newInstance(); HeadDocumentOptions documentOptions = new HeadDocumentOptions.Builder() .db("orders") .docId("order00058") .build(); int statusCode = service.headDocument(documentOptions).execute() .getStatusCode(); Headers headers = service.headDocument(documentOptions).execute() .getHeaders(); System.out.println(statusCode); System.out.println(headers.values("ETag"));
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.headDocument({ db: 'orders', docId: 'order00058' }).then(response => { console.log(response.status); console.log(response.headers['ETag']); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.head_document( db='orders', doc_id='order00058' ) print(response.get_status_code()) print(response.get_headers()['ETag'])
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the ETag for a resource.
Examples:Double quoted base64 encoded attachment digest.
"MEHlNHhicVt9efOzyvsz0Q=="
Double quoted document revision identifier.
"2-240fc93fad07083c338c7e0ea55791b3"
Double quoted local document tag.
"6APCCGX4B76OFFD5972MSBFHD"
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for Document.
HTTP response for not modified client redirect.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Create or modify a document
Creates or modifies a document in the specified database.
For creation, you must specify the document ID but you should not specify the revision.
For modification, you must specify the document ID and a revision identifier.
Creates or modifies a document in the specified database.
For creation, you must specify the document ID but you should not specify the revision.
For modification, you must specify the document ID and a revision identifier.
Creates or modifies a document in the specified database.
For creation, you must specify the document ID but you should not specify the revision.
For modification, you must specify the document ID and a revision identifier.
Creates or modifies a document in the specified database.
For creation, you must specify the document ID but you should not specify the revision.
For modification, you must specify the document ID and a revision identifier.
Creates or modifies a document in the specified database.
For creation, you must specify the document ID but you should not specify the revision.
For modification, you must specify the document ID and a revision identifier.
PUT /{db}/{doc_id}
(cloudant *CloudantV1) PutDocument(putDocumentOptions *PutDocumentOptions) (result *DocumentResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PutDocumentWithContext(ctx context.Context, putDocumentOptions *PutDocumentOptions) (result *DocumentResult, response *core.DetailedResponse, err error)
ServiceCall<DocumentResult> putDocument(PutDocumentOptions putDocumentOptions)
putDocument(params)
put_document(
self,
db: str,
doc_id: str,
document: Union['Document', BinaryIO],
*,
content_type: Optional[str] = None,
if_match: Optional[str] = None,
batch: Optional[str] = None,
new_edits: Optional[bool] = None,
rev: Optional[str] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the PutDocumentOptions
struct and set the fields to provide parameter values for the PutDocument
method.
Use the PutDocumentOptions.Builder
to create a PutDocumentOptions
object that contains the parameter values for the putDocument
method.
Custom Headers
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
^"[A-Za-z0-9+\/]{2,24}={0,3}"$|^"[1-9]\d{0,9}-[\da-f]{32}"$|^"[0-9A-Z]{25}"$
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Allowable values: [
application/json
,multipart/mixed
,multipart/related
]
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Query Parameters
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]Query parameter to specify whether to prevent insertion of conflicting document revisions. If false, a well-formed _rev must be included in the document. False is used by the replicator to insert documents into the target database even if that leads to the creation of conflicts.
Avoid using this parameter, since this option applies document revisions without checking for conflicts, so it is very easy to accidentally end up with a large number of conflicts.
Default:
false
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
HTTP request body for Document operations.
Example Document.
{
"_id": "exampleid",
"brand": "Foo",
"colours": [
"red",
"green",
"black",
"blue"
],
"description": "Slim Colourful Design Electronic Cooking Appliance for ...",
"image": "assets/img/0gmsnghhew.jpg",
"keywords": [
"Foo",
"Scales",
"Weight",
"Digital",
"Kitchen"
],
"name": "Digital Kitchen Scales",
"price": 14.99,
"productid": "1000042",
"taxonomy": [
"Home",
"Kitchen",
"Small Appliances"
],
"type": "product"
}
Schema for a map of attachment name to attachment metadata.
- _attachments
Schema for an attachment.
Schema for a list of document revision identifiers.
Possible values: 0 ≤ number of items ≤ 4294967295, 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Deletion flag. Available if document was removed
Schema for a list of document revision identifiers.
Possible values: 0 ≤ number of items ≤ 4294967295, 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Document's update sequence in current database. Available if requested with local_seq=true query parameter
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Schema for list of revision information.
Schema for a list of objects with information about local revisions and their status.
Possible values: 1 ≤ number of items ≤ 4294967295
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The PutDocument options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
HTTP request body for Document operations.
Examples:{ "_id": "exampleid", "brand": "Foo", "colours": [ "red", "green", "black", "blue" ], "description": "Slim Colourful Design Electronic Cooking Appliance for ...", "image": "assets/img/0gmsnghhew.jpg", "keywords": [ "Foo", "Scales", "Weight", "Digital", "Kitchen" ], "name": "Digital Kitchen Scales", "price": 14.99, "productid": "1000042", "taxonomy": [ "Home", "Kitchen", "Small Appliances" ], "type": "product" }
- Document
Schema for a map of attachment name to attachment metadata.
- Attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- Revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- RevsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Allowable values: [
available
,missing
,deleted
]
HTTP request body for Document operations.
The type of the input.
Allowable values: [
application/json
,multipart/mixed
,multipart/related
,application/octet-stream
]Default:
application/json
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]Query parameter to specify whether to prevent insertion of conflicting document revisions. If false, a well-formed _rev must be included in the document. False is used by the replicator to insert documents into the target database even if that leads to the creation of conflicts.
Avoid using this parameter, since this option applies document revisions without checking for conflicts, so it is very easy to accidentally end up with a large number of conflicts.
Default:
false
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
The putDocument options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
HTTP request body for Document operations.
Examples:{ "_id": "exampleid", "brand": "Foo", "colours": [ "red", "green", "black", "blue" ], "description": "Slim Colourful Design Electronic Cooking Appliance for ...", "image": "assets/img/0gmsnghhew.jpg", "keywords": [ "Foo", "Scales", "Weight", "Digital", "Kitchen" ], "name": "Digital Kitchen Scales", "price": 14.99, "productid": "1000042", "taxonomy": [ "Home", "Kitchen", "Small Appliances" ], "type": "product" }
- document
Schema for a map of attachment name to attachment metadata.
- attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- revsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Allowable values: [
available
,missing
,deleted
]
HTTP request body for Document operations.
The type of the input.
Allowable values: [
application/json
,multipart/mixed
,multipart/related
,application/octet-stream
]Default:
application/json
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]Query parameter to specify whether to prevent insertion of conflicting document revisions. If false, a well-formed _rev must be included in the document. False is used by the replicator to insert documents into the target database even if that leads to the creation of conflicts.
Avoid using this parameter, since this option applies document revisions without checking for conflicts, so it is very easy to accidentally end up with a large number of conflicts.
Default:
false
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
HTTP request body for Document operations.
Examples:- document
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Allowable values: [
available
,missing
,deleted
]
The type of the input.
Allowable values: [
application/json
,multipart/mixed
,multipart/related
,application/octet-stream
]Default:
application/json
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]Query parameter to specify whether to prevent insertion of conflicting document revisions. If false, a well-formed _rev must be included in the document. False is used by the replicator to insert documents into the target database even if that leads to the creation of conflicts.
Avoid using this parameter, since this option applies document revisions without checking for conflicts, so it is very easy to accidentally end up with a large number of conflicts.
Default:
false
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Schema for a document.
- document
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Allowable values: [
available
,missing
,deleted
]
The type of the input.
Allowable values: [
application/json
,multipart/mixed
,multipart/related
,application/octet-stream
]Default:
application/json
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]Query parameter to specify whether to prevent insertion of conflicting document revisions. If false, a well-formed _rev must be included in the document. False is used by the replicator to insert documents into the target database even if that leads to the creation of conflicts.
Avoid using this parameter, since this option applies document revisions without checking for conflicts, so it is very easy to accidentally end up with a large number of conflicts.
Default:
false
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X PUT "$SERVICE_URL/events/0007241142412418284" -H "Content-Type: application/json" --data '{ "type": "event", "userid": "abc123", "eventType": "addedToBasket", "productId": "1000042", "date": "2019-01-28T10:44:22.000Z" }'
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } eventDoc := cloudantv1.Document{} eventDoc.SetProperty("type", "event") eventDoc.SetProperty("userId", "abc123") eventDoc.SetProperty("eventType", "addedToBasket") eventDoc.SetProperty("productId", "1000042") eventDoc.SetProperty("date", "2019-01-28T10:44:22.000Z") putDocumentOptions := service.NewPutDocumentOptions( "events", "ns1HJS13AMkK:0007241142412418284", ) putDocumentOptions.SetDocument(&eventDoc) documentResult, response, err := service.PutDocument(putDocumentOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(documentResult, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.Document; import com.ibm.cloud.cloudant.v1.model.DocumentResult; import com.ibm.cloud.cloudant.v1.model.PutDocumentOptions;
Cloudant service = Cloudant.newInstance(); Document eventDoc = new Document(); eventDoc.put("type", "event"); eventDoc.put("userId", "abc123"); eventDoc.put("eventType", "addedToBasket"); eventDoc.put("productId", "1000042"); eventDoc.put("date", "2019-01-28T10:44:22.000Z"); PutDocumentOptions documentOptions = new PutDocumentOptions.Builder() .db("events") .docId("ns1HJS13AMkK:0007241142412418284") .document(eventDoc) .build(); DocumentResult response = service.putDocument(documentOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); const eventDoc: CloudantV1.Document = { type: 'event', userId: 'abc123', eventType: 'addedToBasket', productId: '1000042', date: '2019-01-28T10:44:22.000Z' }; service.putDocument({ db: 'events', docId: 'ns1HJS13AMkK:0007241142412418284', document: eventDoc }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import Document, CloudantV1 service = CloudantV1.new_instance() event_doc = Document( type='event', userId='abc123', eventType='addedToBasket', productId='1000042', date='2019-01-28T10:44:22.000Z' ) response = service.put_document( db='events', doc_id='ns1HJS13AMkK:0007241142412418284', document=event_doc ).get_result() print(response)
Response
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
ok
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Status Code
HTTP response for Document modification operations.
HTTP response for Document modification operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for exceeded data usage quota.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for conflict.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example error response for a bad request with invalid UTF-8 JSON.
{ "error": "bad_request", "reason": "invalid UTF-8 JSON" }
Example error response for a bad request with invalid UTF-8 JSON.
{ "error": "bad_request", "reason": "invalid UTF-8 JSON" }
Example error response for writer access is required.
{ "error": "unauthorized", "reason": "_writer access is required for this request." }
Example error response for writer access is required.
{ "error": "unauthorized", "reason": "_writer access is required for this request." }
Example error response when the data quota of the plan is exceeded.
{ "error": "over_data_quota", "reason": "Account has exceeded its data usage quota. An upgrade to a paid plan is required." }
Example error response when the data quota of the plan is exceeded.
{ "error": "over_data_quota", "reason": "Account has exceeded its data usage quota. An upgrade to a paid plan is required." }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for a document update conflict.
{ "error": "conflict", "reason": "Document update conflict." }
Example error response for a document update conflict.
{ "error": "conflict", "reason": "Document update conflict." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request with a document size that exceeds the allowable limit.
{ "error": "document_too_large", "reason": "doc_id" }
Example error response for a request with a document size that exceeds the allowable limit.
{ "error": "document_too_large", "reason": "doc_id" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Delete a design document
Marks the specified design document as deleted by adding a _deleted
field with the value true
. Documents with this field are not returned with requests but stay in the database. You must supply the current (latest) revision, either by using the rev
parameter or by using the If-Match
header to specify the revision.
Marks the specified design document as deleted by adding a _deleted
field with the value true
. Documents with this field are not returned with requests but stay in the database. You must supply the current (latest) revision, either by using the rev
parameter or by using the If-Match
header to specify the revision.
Marks the specified design document as deleted by adding a _deleted
field with the value true
. Documents with this field are not returned with requests but stay in the database. You must supply the current (latest) revision, either by using the rev
parameter or by using the If-Match
header to specify the revision.
Marks the specified design document as deleted by adding a _deleted
field with the value true
. Documents with this field are not returned with requests but stay in the database. You must supply the current (latest) revision, either by using the rev
parameter or by using the If-Match
header to specify the revision.
Marks the specified design document as deleted by adding a _deleted
field with the value true
. Documents with this field are not returned with requests but stay in the database. You must supply the current (latest) revision, either by using the rev
parameter or by using the If-Match
header to specify the revision.
DELETE /{db}/_design/{ddoc}
(cloudant *CloudantV1) DeleteDesignDocument(deleteDesignDocumentOptions *DeleteDesignDocumentOptions) (result *DocumentResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) DeleteDesignDocumentWithContext(ctx context.Context, deleteDesignDocumentOptions *DeleteDesignDocumentOptions) (result *DocumentResult, response *core.DetailedResponse, err error)
ServiceCall<DocumentResult> deleteDesignDocument(DeleteDesignDocumentOptions deleteDesignDocumentOptions)
deleteDesignDocument(params)
delete_design_document(
self,
db: str,
ddoc: str,
*,
if_match: Optional[str] = None,
batch: Optional[str] = None,
rev: Optional[str] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the DeleteDesignDocumentOptions
struct and set the fields to provide parameter values for the DeleteDesignDocument
method.
Use the DeleteDesignDocumentOptions.Builder
to create a DeleteDesignDocumentOptions
object that contains the parameter values for the deleteDesignDocument
method.
Custom Headers
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
^"[A-Za-z0-9+\/]{2,24}={0,3}"$|^"[1-9]\d{0,9}-[\da-f]{32}"$|^"[0-9A-Z]{25}"$
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Query Parameters
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The DeleteDesignDocument options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
The deleteDesignDocument options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X DELETE "$SERVICE_URL/products/_design/appliances?rev=1-98e6a25b3b45df62e7d47095ac15b16a"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } deleteDesignDocumentOptions := service.NewDeleteDesignDocumentOptions( "products", "appliances", ) deleteDesignDocumentOptions.SetRev("1-98e6a25b3b45df62e7d47095ac15b16a") documentResult, response, err := service.DeleteDesignDocument(deleteDesignDocumentOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(documentResult, "", " ") fmt.Println(string(b))
This request requires the example revisions in the DELETE body to be replaced with valid revisions.
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.DeleteDesignDocumentOptions; import com.ibm.cloud.cloudant.v1.model.DocumentResult;
Cloudant service = Cloudant.newInstance(); DeleteDesignDocumentOptions designDocumentOptions = new DeleteDesignDocumentOptions.Builder() .db("products") .ddoc("appliances") .rev("1-98e6a25b3b45df62e7d47095ac15b16a") .build(); DocumentResult response = service.deleteDesignDocument(designDocumentOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.deleteDesignDocument({ db: 'products', ddoc: 'appliances', rev: '1-98e6a25b3b45df62e7d47095ac15b16a' }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.delete_design_document( db='products', ddoc='appliances', rev='1-98e6a25b3b45df62e7d47095ac15b16a' ).get_result() print(response)
Response
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
ok
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Status Code
HTTP response for Document modification operations.
HTTP response for Document modification operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for conflict.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for a document update conflict.
{ "error": "conflict", "reason": "Document update conflict." }
Example error response for a document update conflict.
{ "error": "conflict", "reason": "Document update conflict." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve a design document
Returns design document with the specified doc_id
from the specified database. Unless you request a specific revision, the current revision of the design document is always returned.
Returns design document with the specified doc_id
from the specified database. Unless you request a specific revision, the current revision of the design document is always returned.
Returns design document with the specified doc_id
from the specified database. Unless you request a specific revision, the current revision of the design document is always returned.
Returns design document with the specified doc_id
from the specified database. Unless you request a specific revision, the current revision of the design document is always returned.
Returns design document with the specified doc_id
from the specified database. Unless you request a specific revision, the current revision of the design document is always returned.
GET /{db}/_design/{ddoc}
(cloudant *CloudantV1) GetDesignDocument(getDesignDocumentOptions *GetDesignDocumentOptions) (result *DesignDocument, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) GetDesignDocumentWithContext(ctx context.Context, getDesignDocumentOptions *GetDesignDocumentOptions) (result *DesignDocument, response *core.DetailedResponse, err error)
ServiceCall<DesignDocument> getDesignDocument(GetDesignDocumentOptions getDesignDocumentOptions)
getDesignDocument(params)
get_design_document(
self,
db: str,
ddoc: str,
*,
if_none_match: Optional[str] = None,
attachments: Optional[bool] = None,
att_encoding_info: Optional[bool] = None,
conflicts: Optional[bool] = None,
deleted_conflicts: Optional[bool] = None,
latest: Optional[bool] = None,
local_seq: Optional[bool] = None,
meta: Optional[bool] = None,
rev: Optional[str] = None,
revs: Optional[bool] = None,
revs_info: Optional[bool] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the GetDesignDocumentOptions
struct and set the fields to provide parameter values for the GetDesignDocument
method.
Use the GetDesignDocumentOptions.Builder
to create a GetDesignDocumentOptions
object that contains the parameter values for the getDesignDocument
method.
Custom Headers
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
^"[A-Za-z0-9+\/]{2,24}={0,3}"$|^"[1-9]\d{0,9}-[\da-f]{32}"$|^"[0-9A-Z]{25}"$
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Query Parameters
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to include attachments only since specified revisions. Note this does not include the attachments for the specified revisions.
Possible values: 1 ≤ number of items ≤ 4294967295, 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Examples:[ "1-99b02e08da151943c2dcb40090160bb8" ]
Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Query parameter to specify whether to include a list of deleted conflicted revisions in the
_deleted_conflicts
property of the returned document.Default:
false
Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
false
Query parameter to specify whether to include the last update sequence for the document.
Default:
false
Query parameter to specify whether to include document meta information. Acts the same as specifying all of the conflicts, deleted_conflicts and open_revs query parameters.
Default:
false
Query parameter to specify leaf revisions to retrieve. Additionally, it accepts a value of
all
to return all leaf revisions.Possible values: 1 ≤ number of items ≤ 4294967295, 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Query parameter to specify whether to include a list of all known document revisions.
Default:
false
Query parameter to specify whether to includes detailed information for all known document revisions.
Default:
false
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The GetDesignDocument options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Query parameter to specify whether to include a list of deleted conflicted revisions in the
_deleted_conflicts
property of the returned document.Default:
false
Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
false
Query parameter to specify whether to include the last update sequence for the document.
Default:
false
Query parameter to specify whether to include document meta information. Acts the same as specifying all of the conflicts, deleted_conflicts and open_revs query parameters.
Default:
false
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Query parameter to specify whether to include a list of all known document revisions.
Default:
false
Query parameter to specify whether to includes detailed information for all known document revisions.
Default:
false
The getDesignDocument options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Query parameter to specify whether to include a list of deleted conflicted revisions in the
_deleted_conflicts
property of the returned document.Default:
false
Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
false
Query parameter to specify whether to include the last update sequence for the document.
Default:
false
Query parameter to specify whether to include document meta information. Acts the same as specifying all of the conflicts, deleted_conflicts and open_revs query parameters.
Default:
false
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Query parameter to specify whether to include a list of all known document revisions.
Default:
false
Query parameter to specify whether to includes detailed information for all known document revisions.
Default:
false
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Query parameter to specify whether to include a list of deleted conflicted revisions in the
_deleted_conflicts
property of the returned document.Default:
false
Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
false
Query parameter to specify whether to include the last update sequence for the document.
Default:
false
Query parameter to specify whether to include document meta information. Acts the same as specifying all of the conflicts, deleted_conflicts and open_revs query parameters.
Default:
false
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Query parameter to specify whether to include a list of all known document revisions.
Default:
false
Query parameter to specify whether to includes detailed information for all known document revisions.
Default:
false
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Query parameter to specify whether to include a list of deleted conflicted revisions in the
_deleted_conflicts
property of the returned document.Default:
false
Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
false
Query parameter to specify whether to include the last update sequence for the document.
Default:
false
Query parameter to specify whether to include document meta information. Acts the same as specifying all of the conflicts, deleted_conflicts and open_revs query parameters.
Default:
false
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Query parameter to specify whether to include a list of all known document revisions.
Default:
false
Query parameter to specify whether to includes detailed information for all known document revisions.
Default:
false
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/products/_design/appliances?latest=true"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } getDesignDocumentOptions := service.NewGetDesignDocumentOptions( "products", "appliances", ) getDesignDocumentOptions.SetLatest(true) designDocument, response, err := service.GetDesignDocument(getDesignDocumentOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(designDocument, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.DesignDocument; import com.ibm.cloud.cloudant.v1.model.GetDesignDocumentOptions;
Cloudant service = Cloudant.newInstance(); GetDesignDocumentOptions designDocumentOptions = new GetDesignDocumentOptions.Builder() .db("products") .ddoc("appliances") .latest(true) .build(); DesignDocument response = service.getDesignDocument(designDocumentOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.getDesignDocument({ db: 'products', ddoc: 'appliances', latest: true }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.get_design_document( db='products', ddoc='appliances', latest=True ).get_result() print(response)
Response
Schema for a design document.
Schema for a map of attachment name to attachment metadata.
- _attachments
Schema for an attachment.
Schema for a list of document revision identifiers.
Possible values: 0 ≤ number of items ≤ 4294967295, 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Deletion flag. Available if document was removed
Schema for a list of document revision identifiers.
Possible values: 0 ≤ number of items ≤ 4294967295, 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Schema for a design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
^_design\/.+$
Document's update sequence in current database. Available if requested with local_seq=true query parameter
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Schema for list of revision information.
Schema for a list of objects with information about local revisions and their status.
Possible values: 1 ≤ number of items ≤ 4294967295
Indicates whether to automatically build indexes defined in this design document.
Schema for filter functions definition. This schema is a map where keys are the names of the filter functions and values are the function definition in string format.
Filter function formats, or filters the changes feed that pass filter rules. The function takes 2 parameters:
-
doc
: The document that is being processed. -
req
: A Request JavaScript object with these properties:body
- string, Request body data as string. If the request method is GET this field contains the value"undefined"
. If the method is DELETE or HEAD the value is""
(empty string).cookie
- Cookies object.form
- Form Data object, contains the decoded body as key-value pairs if the Content-Type header was application/x-www-form-urlencoded.headers
- Request Headers object.id
- string, requested document id if it was specified or null otherwise.info
- Database Information object, seeDatabaseInformation
.method
- string or an array of chars, request method. String value is a method as one of: HEAD, GET, POST, PUT, DELETE, OPTIONS, TRACE, COPY. For not supported methods it will be represented as an array of char codes e.g. for VIEW it will be 86,73,69,87.path
- array of strings, requested path sections.peer
- string, request source IP address.query
- string, URL query parameters object. Note that multiple keys are not supported and the last key value suppresses others.requested_path
- array of strings, actual requested path section.raw_path
- string, raw requested path.userCtx
: User Context Object, containing information about the user writing the document (if present), see theUserContext
.secObj
: Security Object, with lists of database security roles, see theSecurityObject
.uuid
- string, generated UUID by a specified algorithm in the config file.
Filter functions must return true if a document passed all the rules.
- filters
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
^.+$
-
Search (text) index function definitions.
- indexes
Schema for a search index definition.
Defines Query Server key to process design document functions.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Schema for design document options.
Validate document update function can be used to prevent invalid or unauthorized document update requests from being stored. Validation functions typically examine the structure of the new document to ensure that required fields are present and to verify that the requesting user should be allowed to make changes to the document properties. When a write request is received for a given database, the validation function in each design document in that database is called in an unspecified order. If any of the validation functions throw an error, the write will not succeed.
The validation function can abort the pending document write by throwing one of two error objects:
// user is not authorized to make the change but may re-authenticate throw({ unauthorized: 'Error message here.' }); // change is not allowed throw({ forbidden: 'Error message here.' });
The function takes 4 parameters:
newDoc
- New version of document that will be stored from the update request.oldDoc
- Previous version of document that is already stored.userCtx
- User Context Object, containing information about the user writing the document (if present), see theUserContext
.secObj
- Security Object, with lists of database security roles, see theSecurityObject
.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
^.+$
Schema for design document views.
- views
Schema for view functions definition.
Schema for a design document.
Schema for a map of attachment name to attachment metadata.
- Attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- Revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- RevsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Indicates whether to automatically build indexes defined in this design document.
Schema for filter functions definition. This schema is a map where keys are the names of the filter functions and values are the function definition in string format.
Filter function formats, or filters the changes feed that pass filter rules. The function takes 2 parameters:
-
doc
: The document that is being processed. -
req
: A Request JavaScript object with these properties:body
- string, Request body data as string. If the request method is GET this field contains the value"undefined"
. If the method is DELETE or HEAD the value is""
(empty string).cookie
- Cookies object.form
- Form Data object, contains the decoded body as key-value pairs if the Content-Type header was application/x-www-form-urlencoded.headers
- Request Headers object.id
- string, requested document id if it was specified or null otherwise.info
- Database Information object, seeDatabaseInformation
.method
- string or an array of chars, request method. String value is a method as one of: HEAD, GET, POST, PUT, DELETE, OPTIONS, TRACE, COPY. For not supported methods it will be represented as an array of char codes e.g. for VIEW it will be 86,73,69,87.path
- array of strings, requested path sections.peer
- string, request source IP address.query
- string, URL query parameters object. Note that multiple keys are not supported and the last key value suppresses others.requested_path
- array of strings, actual requested path section.raw_path
- string, raw requested path.userCtx
: User Context Object, containing information about the user writing the document (if present), see theUserContext
.secObj
: Security Object, with lists of database security roles, see theSecurityObject
.uuid
- string, generated UUID by a specified algorithm in the config file.
Filter functions must return true if a document passed all the rules.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.+$/
-
Search (text) index function definitions.
- Indexes
Schema for a search analyzer configuration.
- Analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for mapping a field name to a per field analyzer.
- Fields
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
String form of a JavaScript function that is called for each document in the database. The function takes the document as a parameter, extracts some data from it, and then calls the
index
function to index that data. The index function takes 2, or optionally 3, parameters.-
The first parameter is the name of the field you intend to use when querying the index. If the special value
"default"
is used when you define the name, you do not have to specify a field name at query time. -
The second parameter is the data to be indexed. This data must be only a string, number, or boolean. Other types will cause an error to be thrown by the index function call.
-
The optional third parameter is a JavaScript object with these properties:
facet
- boolean, defaultfalse
- Creates a faceted index.index
- boolean, defaulttrue
- If set tofalse
, the data cannot be used for searches, but can still be retrieved from the index ifstore
is set totrue
.store
- boolean, defaulttrue
- If true, the value is returned in the search result; otherwise, the value is not returned.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.*$/
-
Defines Query Server key to process design document functions.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for design document options.
- Options
Whether this design document describes partitioned or global indexes.
Validate document update function can be used to prevent invalid or unauthorized document update requests from being stored. Validation functions typically examine the structure of the new document to ensure that required fields are present and to verify that the requesting user should be allowed to make changes to the document properties. When a write request is received for a given database, the validation function in each design document in that database is called in an unspecified order. If any of the validation functions throw an error, the write will not succeed.
The validation function can abort the pending document write by throwing one of two error objects:
// user is not authorized to make the change but may re-authenticate throw({ unauthorized: 'Error message here.' }); // change is not allowed throw({ forbidden: 'Error message here.' });
The function takes 4 parameters:
newDoc
- New version of document that will be stored from the update request.oldDoc
- Previous version of document that is already stored.userCtx
- User Context Object, containing information about the user writing the document (if present), see theUserContext
.secObj
- Security Object, with lists of database security roles, see theSecurityObject
.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.+$/
Schema for design document views.
- Views
JavaScript map function as a string.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.+$/
JavaScript reduce function as a string.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.+$/
Schema for a design document.
Schema for a map of attachment name to attachment metadata.
- attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- revsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Indicates whether to automatically build indexes defined in this design document.
Schema for filter functions definition. This schema is a map where keys are the names of the filter functions and values are the function definition in string format.
Filter function formats, or filters the changes feed that pass filter rules. The function takes 2 parameters:
-
doc
: The document that is being processed. -
req
: A Request JavaScript object with these properties:body
- string, Request body data as string. If the request method is GET this field contains the value"undefined"
. If the method is DELETE or HEAD the value is""
(empty string).cookie
- Cookies object.form
- Form Data object, contains the decoded body as key-value pairs if the Content-Type header was application/x-www-form-urlencoded.headers
- Request Headers object.id
- string, requested document id if it was specified or null otherwise.info
- Database Information object, seeDatabaseInformation
.method
- string or an array of chars, request method. String value is a method as one of: HEAD, GET, POST, PUT, DELETE, OPTIONS, TRACE, COPY. For not supported methods it will be represented as an array of char codes e.g. for VIEW it will be 86,73,69,87.path
- array of strings, requested path sections.peer
- string, request source IP address.query
- string, URL query parameters object. Note that multiple keys are not supported and the last key value suppresses others.requested_path
- array of strings, actual requested path section.raw_path
- string, raw requested path.userCtx
: User Context Object, containing information about the user writing the document (if present), see theUserContext
.secObj
: Security Object, with lists of database security roles, see theSecurityObject
.uuid
- string, generated UUID by a specified algorithm in the config file.
Filter functions must return true if a document passed all the rules.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.+$/
-
Search (text) index function definitions.
- indexes
Schema for a search analyzer configuration.
- analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for mapping a field name to a per field analyzer.
- fields
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
String form of a JavaScript function that is called for each document in the database. The function takes the document as a parameter, extracts some data from it, and then calls the
index
function to index that data. The index function takes 2, or optionally 3, parameters.-
The first parameter is the name of the field you intend to use when querying the index. If the special value
"default"
is used when you define the name, you do not have to specify a field name at query time. -
The second parameter is the data to be indexed. This data must be only a string, number, or boolean. Other types will cause an error to be thrown by the index function call.
-
The optional third parameter is a JavaScript object with these properties:
facet
- boolean, defaultfalse
- Creates a faceted index.index
- boolean, defaulttrue
- If set tofalse
, the data cannot be used for searches, but can still be retrieved from the index ifstore
is set totrue
.store
- boolean, defaulttrue
- If true, the value is returned in the search result; otherwise, the value is not returned.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.*$/
-
Defines Query Server key to process design document functions.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for design document options.
- options
Whether this design document describes partitioned or global indexes.
Validate document update function can be used to prevent invalid or unauthorized document update requests from being stored. Validation functions typically examine the structure of the new document to ensure that required fields are present and to verify that the requesting user should be allowed to make changes to the document properties. When a write request is received for a given database, the validation function in each design document in that database is called in an unspecified order. If any of the validation functions throw an error, the write will not succeed.
The validation function can abort the pending document write by throwing one of two error objects:
// user is not authorized to make the change but may re-authenticate throw({ unauthorized: 'Error message here.' }); // change is not allowed throw({ forbidden: 'Error message here.' });
The function takes 4 parameters:
newDoc
- New version of document that will be stored from the update request.oldDoc
- Previous version of document that is already stored.userCtx
- User Context Object, containing information about the user writing the document (if present), see theUserContext
.secObj
- Security Object, with lists of database security roles, see theSecurityObject
.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.+$/
Schema for design document views.
- views
JavaScript map function as a string.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.+$/
JavaScript reduce function as a string.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.+$/
Schema for a design document.
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Indicates whether to automatically build indexes defined in this design document.
Schema for filter functions definition. This schema is a map where keys are the names of the filter functions and values are the function definition in string format.
Filter function formats, or filters the changes feed that pass filter rules. The function takes 2 parameters:
-
doc
: The document that is being processed. -
req
: A Request JavaScript object with these properties:body
- string, Request body data as string. If the request method is GET this field contains the value"undefined"
. If the method is DELETE or HEAD the value is""
(empty string).cookie
- Cookies object.form
- Form Data object, contains the decoded body as key-value pairs if the Content-Type header was application/x-www-form-urlencoded.headers
- Request Headers object.id
- string, requested document id if it was specified or null otherwise.info
- Database Information object, seeDatabaseInformation
.method
- string or an array of chars, request method. String value is a method as one of: HEAD, GET, POST, PUT, DELETE, OPTIONS, TRACE, COPY. For not supported methods it will be represented as an array of char codes e.g. for VIEW it will be 86,73,69,87.path
- array of strings, requested path sections.peer
- string, request source IP address.query
- string, URL query parameters object. Note that multiple keys are not supported and the last key value suppresses others.requested_path
- array of strings, actual requested path section.raw_path
- string, raw requested path.userCtx
: User Context Object, containing information about the user writing the document (if present), see theUserContext
.secObj
: Security Object, with lists of database security roles, see theSecurityObject
.uuid
- string, generated UUID by a specified algorithm in the config file.
Filter functions must return true if a document passed all the rules.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.+$/
-
Search (text) index function definitions.
- indexes
Schema for a search analyzer configuration.
- analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for mapping a field name to a per field analyzer.
- fields
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
String form of a JavaScript function that is called for each document in the database. The function takes the document as a parameter, extracts some data from it, and then calls the
index
function to index that data. The index function takes 2, or optionally 3, parameters.-
The first parameter is the name of the field you intend to use when querying the index. If the special value
"default"
is used when you define the name, you do not have to specify a field name at query time. -
The second parameter is the data to be indexed. This data must be only a string, number, or boolean. Other types will cause an error to be thrown by the index function call.
-
The optional third parameter is a JavaScript object with these properties:
facet
- boolean, defaultfalse
- Creates a faceted index.index
- boolean, defaulttrue
- If set tofalse
, the data cannot be used for searches, but can still be retrieved from the index ifstore
is set totrue
.store
- boolean, defaulttrue
- If true, the value is returned in the search result; otherwise, the value is not returned.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.*$/
-
Defines Query Server key to process design document functions.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for design document options.
- options
Whether this design document describes partitioned or global indexes.
Validate document update function can be used to prevent invalid or unauthorized document update requests from being stored. Validation functions typically examine the structure of the new document to ensure that required fields are present and to verify that the requesting user should be allowed to make changes to the document properties. When a write request is received for a given database, the validation function in each design document in that database is called in an unspecified order. If any of the validation functions throw an error, the write will not succeed.
The validation function can abort the pending document write by throwing one of two error objects:
// user is not authorized to make the change but may re-authenticate throw({ unauthorized: 'Error message here.' }); // change is not allowed throw({ forbidden: 'Error message here.' });
The function takes 4 parameters:
newDoc
- New version of document that will be stored from the update request.oldDoc
- Previous version of document that is already stored.userCtx
- User Context Object, containing information about the user writing the document (if present), see theUserContext
.secObj
- Security Object, with lists of database security roles, see theSecurityObject
.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.+$/
Schema for design document views.
- views
JavaScript map function as a string.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.+$/
JavaScript reduce function as a string.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.+$/
Schema for a design document.
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Indicates whether to automatically build indexes defined in this design document.
Schema for filter functions definition. This schema is a map where keys are the names of the filter functions and values are the function definition in string format.
Filter function formats, or filters the changes feed that pass filter rules. The function takes 2 parameters:
-
doc
: The document that is being processed. -
req
: A Request JavaScript object with these properties:body
- string, Request body data as string. If the request method is GET this field contains the value"undefined"
. If the method is DELETE or HEAD the value is""
(empty string).cookie
- Cookies object.form
- Form Data object, contains the decoded body as key-value pairs if the Content-Type header was application/x-www-form-urlencoded.headers
- Request Headers object.id
- string, requested document id if it was specified or null otherwise.info
- Database Information object, seeDatabaseInformation
.method
- string or an array of chars, request method. String value is a method as one of: HEAD, GET, POST, PUT, DELETE, OPTIONS, TRACE, COPY. For not supported methods it will be represented as an array of char codes e.g. for VIEW it will be 86,73,69,87.path
- array of strings, requested path sections.peer
- string, request source IP address.query
- string, URL query parameters object. Note that multiple keys are not supported and the last key value suppresses others.requested_path
- array of strings, actual requested path section.raw_path
- string, raw requested path.userCtx
: User Context Object, containing information about the user writing the document (if present), see theUserContext
.secObj
: Security Object, with lists of database security roles, see theSecurityObject
.uuid
- string, generated UUID by a specified algorithm in the config file.
Filter functions must return true if a document passed all the rules.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.+$/
-
Search (text) index function definitions.
- indexes
Schema for a search analyzer configuration.
- analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for mapping a field name to a per field analyzer.
- fields
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
String form of a JavaScript function that is called for each document in the database. The function takes the document as a parameter, extracts some data from it, and then calls the
index
function to index that data. The index function takes 2, or optionally 3, parameters.-
The first parameter is the name of the field you intend to use when querying the index. If the special value
"default"
is used when you define the name, you do not have to specify a field name at query time. -
The second parameter is the data to be indexed. This data must be only a string, number, or boolean. Other types will cause an error to be thrown by the index function call.
-
The optional third parameter is a JavaScript object with these properties:
facet
- boolean, defaultfalse
- Creates a faceted index.index
- boolean, defaulttrue
- If set tofalse
, the data cannot be used for searches, but can still be retrieved from the index ifstore
is set totrue
.store
- boolean, defaulttrue
- If true, the value is returned in the search result; otherwise, the value is not returned.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.*$/
-
Defines Query Server key to process design document functions.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for design document options.
- options
Whether this design document describes partitioned or global indexes.
Validate document update function can be used to prevent invalid or unauthorized document update requests from being stored. Validation functions typically examine the structure of the new document to ensure that required fields are present and to verify that the requesting user should be allowed to make changes to the document properties. When a write request is received for a given database, the validation function in each design document in that database is called in an unspecified order. If any of the validation functions throw an error, the write will not succeed.
The validation function can abort the pending document write by throwing one of two error objects:
// user is not authorized to make the change but may re-authenticate throw({ unauthorized: 'Error message here.' }); // change is not allowed throw({ forbidden: 'Error message here.' });
The function takes 4 parameters:
newDoc
- New version of document that will be stored from the update request.oldDoc
- Previous version of document that is already stored.userCtx
- User Context Object, containing information about the user writing the document (if present), see theUserContext
.secObj
- Security Object, with lists of database security roles, see theSecurityObject
.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.+$/
Schema for design document views.
- views
JavaScript map function as a string.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.+$/
JavaScript reduce function as a string.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.+$/
Status Code
HTTP response for DesignDocument.
HTTP response for not modified client redirect.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example DesignDocument.
{ "_id": "_design/appliances", "_rev": "8-7e2537e5989294471061e0cfd7292725", "indexes": { "findByPrice": { "analyzer": { "name": "standard" }, "index": "function (doc) {\n index(\"price\", doc.price);\n}" } }, "views": { "byApplianceProdId": { "map": "function(doc) { \n emit(doc.productid, [doc.brand, doc.name, doc.description]) \n}" } } }
Example DesignDocument.
{ "_id": "_design/appliances", "_rev": "8-7e2537e5989294471061e0cfd7292725", "indexes": { "findByPrice": { "analyzer": { "name": "standard" }, "index": "function (doc) {\n index(\"price\", doc.price);\n}" } }, "views": { "byApplianceProdId": { "map": "function(doc) { \n emit(doc.productid, [doc.brand, doc.name, doc.description]) \n}" } } }
Example DesignDocument for a database partition.
{ "_id": "_design/partitioned_appliances", "_rev": "8-7e2537e5989294471061e0cfd7292725", "indexes": { "findByBrand": { "analyzer": { "name": "standard" }, "index": "function (doc) {\n index(\"brand\", doc.brand);\n}" } }, "language": "javascript", "options": { "partitioned": true } }
Example DesignDocument for a database partition.
{ "_id": "_design/partitioned_appliances", "_rev": "8-7e2537e5989294471061e0cfd7292725", "indexes": { "findByBrand": { "analyzer": { "name": "standard" }, "index": "function (doc) {\n index(\"brand\", doc.brand);\n}" } }, "language": "javascript", "options": { "partitioned": true } }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve the HTTP headers for a design document
This method supports the same query arguments as the GET /{db}/_design/{ddoc}
method, but the results include only the header information (including design document size, and the revision as an ETag). The ETag header shows the current revision for the requested design document, and if you requested the design document in full, the Content-Length specifies the length of the data. If you add any of the query arguments, then the resulting HTTP headers correspond to what is returned for the equivalent GET request.
This method supports the same query arguments as the GET /{db}/_design/{ddoc}
method, but the results include only the header information (including design document size, and the revision as an ETag). The ETag header shows the current revision for the requested design document, and if you requested the design document in full, the Content-Length specifies the length of the data. If you add any of the query arguments, then the resulting HTTP headers correspond to what is returned for the equivalent GET request.
This method supports the same query arguments as the GET /{db}/_design/{ddoc}
method, but the results include only the header information (including design document size, and the revision as an ETag). The ETag header shows the current revision for the requested design document, and if you requested the design document in full, the Content-Length specifies the length of the data. If you add any of the query arguments, then the resulting HTTP headers correspond to what is returned for the equivalent GET request.
This method supports the same query arguments as the GET /{db}/_design/{ddoc}
method, but the results include only the header information (including design document size, and the revision as an ETag). The ETag header shows the current revision for the requested design document, and if you requested the design document in full, the Content-Length specifies the length of the data. If you add any of the query arguments, then the resulting HTTP headers correspond to what is returned for the equivalent GET request.
This method supports the same query arguments as the GET /{db}/_design/{ddoc}
method, but the results include only the header information (including design document size, and the revision as an ETag). The ETag header shows the current revision for the requested design document, and if you requested the design document in full, the Content-Length specifies the length of the data. If you add any of the query arguments, then the resulting HTTP headers correspond to what is returned for the equivalent GET request.
HEAD /{db}/_design/{ddoc}
(cloudant *CloudantV1) HeadDesignDocument(headDesignDocumentOptions *HeadDesignDocumentOptions) (response *core.DetailedResponse, err error)
(cloudant *CloudantV1) HeadDesignDocumentWithContext(ctx context.Context, headDesignDocumentOptions *HeadDesignDocumentOptions) (response *core.DetailedResponse, err error)
ServiceCall<Void> headDesignDocument(HeadDesignDocumentOptions headDesignDocumentOptions)
headDesignDocument(params)
head_design_document(
self,
db: str,
ddoc: str,
*,
if_none_match: Optional[str] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the HeadDesignDocumentOptions
struct and set the fields to provide parameter values for the HeadDesignDocument
method.
Use the HeadDesignDocumentOptions.Builder
to create a HeadDesignDocumentOptions
object that contains the parameter values for the headDesignDocument
method.
Custom Headers
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
^"[A-Za-z0-9+\/]{2,24}={0,3}"$|^"[1-9]\d{0,9}-[\da-f]{32}"$|^"[0-9A-Z]{25}"$
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The HeadDesignDocument options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
The headDesignDocument options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
curl -H "Authorization: Bearer $API_BEARER_TOKEN" --head "$SERVICE_URL/products/_design/appliances"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } headDesignDocumentOptions := service.NewHeadDesignDocumentOptions( "events", "checkout", ) response, err := service.HeadDesignDocument(headDesignDocumentOptions) if err != nil { panic(err) } fmt.Println(response.StatusCode) fmt.Println(response.Headers["ETag"])
import com.ibm.cloud.sdk.core.http.Headers; import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.HeadDesignDocumentOptions;
Cloudant service = Cloudant.newInstance(); HeadDesignDocumentOptions designDocumentOptions = new HeadDesignDocumentOptions.Builder() .db("events") .ddoc("checkout") .build(); int statusCode = service.headDesignDocument(designDocumentOptions).execute() .getStatusCode(); Headers headers = service.headDesignDocument(designDocumentOptions).execute() .getHeaders(); System.out.println(statusCode); System.out.println(headers.values("ETag"));
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.headDesignDocument({ db: 'events', ddoc: 'checkout' }).then(response => { console.log(response.status); console.log(response.headers['ETag']); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.head_design_document( db='events', ddoc='checkout' ) print(response.get_status_code()) print(response.get_headers()['ETag'])
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the ETag for a resource.
Examples:Double quoted base64 encoded attachment digest.
"MEHlNHhicVt9efOzyvsz0Q=="
Double quoted document revision identifier.
"2-240fc93fad07083c338c7e0ea55791b3"
Double quoted local document tag.
"6APCCGX4B76OFFD5972MSBFHD"
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for DesignDocument.
HTTP response for not modified client redirect.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Create or modify a design document
The PUT method creates a new named design document, or creates a new revision of the existing design document.
The PUT method creates a new named design document, or creates a new revision of the existing design document.
The PUT method creates a new named design document, or creates a new revision of the existing design document.
The PUT method creates a new named design document, or creates a new revision of the existing design document.
The PUT method creates a new named design document, or creates a new revision of the existing design document.
PUT /{db}/_design/{ddoc}
(cloudant *CloudantV1) PutDesignDocument(putDesignDocumentOptions *PutDesignDocumentOptions) (result *DocumentResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PutDesignDocumentWithContext(ctx context.Context, putDesignDocumentOptions *PutDesignDocumentOptions) (result *DocumentResult, response *core.DetailedResponse, err error)
ServiceCall<DocumentResult> putDesignDocument(PutDesignDocumentOptions putDesignDocumentOptions)
putDesignDocument(params)
put_design_document(
self,
db: str,
ddoc: str,
design_document: 'DesignDocument',
*,
if_match: Optional[str] = None,
batch: Optional[str] = None,
new_edits: Optional[bool] = None,
rev: Optional[str] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the PutDesignDocumentOptions
struct and set the fields to provide parameter values for the PutDesignDocument
method.
Use the PutDesignDocumentOptions.Builder
to create a PutDesignDocumentOptions
object that contains the parameter values for the putDesignDocument
method.
Custom Headers
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
^"[A-Za-z0-9+\/]{2,24}={0,3}"$|^"[1-9]\d{0,9}-[\da-f]{32}"$|^"[0-9A-Z]{25}"$
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Query Parameters
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]Query parameter to specify whether to prevent insertion of conflicting document revisions. If false, a well-formed _rev must be included in the document. False is used by the replicator to insert documents into the target database even if that leads to the creation of conflicts.
Avoid using this parameter, since this option applies document revisions without checking for conflicts, so it is very easy to accidentally end up with a large number of conflicts.
Default:
false
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
HTTP request body for DesignDocument operations.
Example DesignDocument.
{
"_id": "_design/appliances",
"_rev": "8-7e2537e5989294471061e0cfd7292725",
"indexes": {
"findByPrice": {
"analyzer": {
"name": "standard"
},
"index": "function (doc) {\n index(\"price\", doc.price);\n}"
}
},
"views": {
"byApplianceProdId": {
"map": "function(doc) { \n emit(doc.productid, [doc.brand, doc.name, doc.description]) \n}"
}
}
}
Schema for a map of attachment name to attachment metadata.
- _attachments
Schema for an attachment.
Schema for a list of document revision identifiers.
Possible values: 0 ≤ number of items ≤ 4294967295, 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Deletion flag. Available if document was removed
Schema for a list of document revision identifiers.
Possible values: 0 ≤ number of items ≤ 4294967295, 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Schema for a design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
^_design\/.+$
Document's update sequence in current database. Available if requested with local_seq=true query parameter
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Schema for list of revision information.
Schema for a list of objects with information about local revisions and their status.
Possible values: 1 ≤ number of items ≤ 4294967295
Indicates whether to automatically build indexes defined in this design document.
Default:
true
Schema for filter functions definition. This schema is a map where keys are the names of the filter functions and values are the function definition in string format.
Filter function formats, or filters the changes feed that pass filter rules. The function takes 2 parameters:
-
doc
: The document that is being processed. -
req
: A Request JavaScript object with these properties:body
- string, Request body data as string. If the request method is GET this field contains the value"undefined"
. If the method is DELETE or HEAD the value is""
(empty string).cookie
- Cookies object.form
- Form Data object, contains the decoded body as key-value pairs if the Content-Type header was application/x-www-form-urlencoded.headers
- Request Headers object.id
- string, requested document id if it was specified or null otherwise.info
- Database Information object, seeDatabaseInformation
.method
- string or an array of chars, request method. String value is a method as one of: HEAD, GET, POST, PUT, DELETE, OPTIONS, TRACE, COPY. For not supported methods it will be represented as an array of char codes e.g. for VIEW it will be 86,73,69,87.path
- array of strings, requested path sections.peer
- string, request source IP address.query
- string, URL query parameters object. Note that multiple keys are not supported and the last key value suppresses others.requested_path
- array of strings, actual requested path section.raw_path
- string, raw requested path.userCtx
: User Context Object, containing information about the user writing the document (if present), see theUserContext
.secObj
: Security Object, with lists of database security roles, see theSecurityObject
.uuid
- string, generated UUID by a specified algorithm in the config file.
Filter functions must return true if a document passed all the rules.
- filters
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
^.+$
-
Search (text) index function definitions.
- indexes
Schema for a search index definition.
Defines Query Server key to process design document functions.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Default:
javascript
Schema for design document options.
Validate document update function can be used to prevent invalid or unauthorized document update requests from being stored. Validation functions typically examine the structure of the new document to ensure that required fields are present and to verify that the requesting user should be allowed to make changes to the document properties. When a write request is received for a given database, the validation function in each design document in that database is called in an unspecified order. If any of the validation functions throw an error, the write will not succeed.
The validation function can abort the pending document write by throwing one of two error objects:
// user is not authorized to make the change but may re-authenticate throw({ unauthorized: 'Error message here.' }); // change is not allowed throw({ forbidden: 'Error message here.' });
The function takes 4 parameters:
newDoc
- New version of document that will be stored from the update request.oldDoc
- Previous version of document that is already stored.userCtx
- User Context Object, containing information about the user writing the document (if present), see theUserContext
.secObj
- Security Object, with lists of database security roles, see theSecurityObject
.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
^.+$
Schema for design document views.
- views
Schema for view functions definition.
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The PutDesignDocument options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
HTTP request body for DesignDocument operations.
Examples:{ "_id": "_design/appliances", "_rev": "8-7e2537e5989294471061e0cfd7292725", "indexes": { "findByPrice": { "analyzer": { "name": "standard" }, "index": "function (doc) {\n index(\"price\", doc.price);\n}" } }, "views": { "byApplianceProdId": { "map": "function(doc) { \n emit(doc.productid, [doc.brand, doc.name, doc.description]) \n}" } } }
- DesignDocument
Schema for a map of attachment name to attachment metadata.
- Attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- Revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- RevsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Allowable values: [
available
,missing
,deleted
]
Indicates whether to automatically build indexes defined in this design document.
Default:
true
Schema for filter functions definition. This schema is a map where keys are the names of the filter functions and values are the function definition in string format.
Filter function formats, or filters the changes feed that pass filter rules. The function takes 2 parameters:
-
doc
: The document that is being processed. -
req
: A Request JavaScript object with these properties:body
- string, Request body data as string. If the request method is GET this field contains the value"undefined"
. If the method is DELETE or HEAD the value is""
(empty string).cookie
- Cookies object.form
- Form Data object, contains the decoded body as key-value pairs if the Content-Type header was application/x-www-form-urlencoded.headers
- Request Headers object.id
- string, requested document id if it was specified or null otherwise.info
- Database Information object, seeDatabaseInformation
.method
- string or an array of chars, request method. String value is a method as one of: HEAD, GET, POST, PUT, DELETE, OPTIONS, TRACE, COPY. For not supported methods it will be represented as an array of char codes e.g. for VIEW it will be 86,73,69,87.path
- array of strings, requested path sections.peer
- string, request source IP address.query
- string, URL query parameters object. Note that multiple keys are not supported and the last key value suppresses others.requested_path
- array of strings, actual requested path section.raw_path
- string, raw requested path.userCtx
: User Context Object, containing information about the user writing the document (if present), see theUserContext
.secObj
: Security Object, with lists of database security roles, see theSecurityObject
.uuid
- string, generated UUID by a specified algorithm in the config file.
Filter functions must return true if a document passed all the rules.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.+$/
-
Search (text) index function definitions.
- Indexes
Schema for a search analyzer configuration.
- Analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Allowable values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for mapping a field name to a per field analyzer.
- Fields
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Allowable values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
String form of a JavaScript function that is called for each document in the database. The function takes the document as a parameter, extracts some data from it, and then calls the
index
function to index that data. The index function takes 2, or optionally 3, parameters.-
The first parameter is the name of the field you intend to use when querying the index. If the special value
"default"
is used when you define the name, you do not have to specify a field name at query time. -
The second parameter is the data to be indexed. This data must be only a string, number, or boolean. Other types will cause an error to be thrown by the index function call.
-
The optional third parameter is a JavaScript object with these properties:
facet
- boolean, defaultfalse
- Creates a faceted index.index
- boolean, defaulttrue
- If set tofalse
, the data cannot be used for searches, but can still be retrieved from the index ifstore
is set totrue
.store
- boolean, defaulttrue
- If true, the value is returned in the search result; otherwise, the value is not returned.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.*$/
-
Defines Query Server key to process design document functions.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Default:
javascript
Schema for design document options.
- Options
Whether this design document describes partitioned or global indexes.
Validate document update function can be used to prevent invalid or unauthorized document update requests from being stored. Validation functions typically examine the structure of the new document to ensure that required fields are present and to verify that the requesting user should be allowed to make changes to the document properties. When a write request is received for a given database, the validation function in each design document in that database is called in an unspecified order. If any of the validation functions throw an error, the write will not succeed.
The validation function can abort the pending document write by throwing one of two error objects:
// user is not authorized to make the change but may re-authenticate throw({ unauthorized: 'Error message here.' }); // change is not allowed throw({ forbidden: 'Error message here.' });
The function takes 4 parameters:
newDoc
- New version of document that will be stored from the update request.oldDoc
- Previous version of document that is already stored.userCtx
- User Context Object, containing information about the user writing the document (if present), see theUserContext
.secObj
- Security Object, with lists of database security roles, see theSecurityObject
.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.+$/
Schema for design document views.
- Views
JavaScript map function as a string.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.+$/
JavaScript reduce function as a string.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.+$/
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]Query parameter to specify whether to prevent insertion of conflicting document revisions. If false, a well-formed _rev must be included in the document. False is used by the replicator to insert documents into the target database even if that leads to the creation of conflicts.
Avoid using this parameter, since this option applies document revisions without checking for conflicts, so it is very easy to accidentally end up with a large number of conflicts.
Default:
false
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
The putDesignDocument options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
HTTP request body for DesignDocument operations.
Examples:{ "_id": "_design/appliances", "_rev": "8-7e2537e5989294471061e0cfd7292725", "indexes": { "findByPrice": { "analyzer": { "name": "standard" }, "index": "function (doc) {\n index(\"price\", doc.price);\n}" } }, "views": { "byApplianceProdId": { "map": "function(doc) { \n emit(doc.productid, [doc.brand, doc.name, doc.description]) \n}" } } }
- designDocument
Schema for a map of attachment name to attachment metadata.
- attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- revsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Allowable values: [
available
,missing
,deleted
]
Indicates whether to automatically build indexes defined in this design document.
Default:
true
Schema for filter functions definition. This schema is a map where keys are the names of the filter functions and values are the function definition in string format.
Filter function formats, or filters the changes feed that pass filter rules. The function takes 2 parameters:
-
doc
: The document that is being processed. -
req
: A Request JavaScript object with these properties:body
- string, Request body data as string. If the request method is GET this field contains the value"undefined"
. If the method is DELETE or HEAD the value is""
(empty string).cookie
- Cookies object.form
- Form Data object, contains the decoded body as key-value pairs if the Content-Type header was application/x-www-form-urlencoded.headers
- Request Headers object.id
- string, requested document id if it was specified or null otherwise.info
- Database Information object, seeDatabaseInformation
.method
- string or an array of chars, request method. String value is a method as one of: HEAD, GET, POST, PUT, DELETE, OPTIONS, TRACE, COPY. For not supported methods it will be represented as an array of char codes e.g. for VIEW it will be 86,73,69,87.path
- array of strings, requested path sections.peer
- string, request source IP address.query
- string, URL query parameters object. Note that multiple keys are not supported and the last key value suppresses others.requested_path
- array of strings, actual requested path section.raw_path
- string, raw requested path.userCtx
: User Context Object, containing information about the user writing the document (if present), see theUserContext
.secObj
: Security Object, with lists of database security roles, see theSecurityObject
.uuid
- string, generated UUID by a specified algorithm in the config file.
Filter functions must return true if a document passed all the rules.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.+$/
-
Search (text) index function definitions.
- indexes
Schema for a search analyzer configuration.
- analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Allowable values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for mapping a field name to a per field analyzer.
- fields
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Allowable values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
String form of a JavaScript function that is called for each document in the database. The function takes the document as a parameter, extracts some data from it, and then calls the
index
function to index that data. The index function takes 2, or optionally 3, parameters.-
The first parameter is the name of the field you intend to use when querying the index. If the special value
"default"
is used when you define the name, you do not have to specify a field name at query time. -
The second parameter is the data to be indexed. This data must be only a string, number, or boolean. Other types will cause an error to be thrown by the index function call.
-
The optional third parameter is a JavaScript object with these properties:
facet
- boolean, defaultfalse
- Creates a faceted index.index
- boolean, defaulttrue
- If set tofalse
, the data cannot be used for searches, but can still be retrieved from the index ifstore
is set totrue
.store
- boolean, defaulttrue
- If true, the value is returned in the search result; otherwise, the value is not returned.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.*$/
-
Defines Query Server key to process design document functions.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Default:
javascript
Schema for design document options.
- options
Whether this design document describes partitioned or global indexes.
Validate document update function can be used to prevent invalid or unauthorized document update requests from being stored. Validation functions typically examine the structure of the new document to ensure that required fields are present and to verify that the requesting user should be allowed to make changes to the document properties. When a write request is received for a given database, the validation function in each design document in that database is called in an unspecified order. If any of the validation functions throw an error, the write will not succeed.
The validation function can abort the pending document write by throwing one of two error objects:
// user is not authorized to make the change but may re-authenticate throw({ unauthorized: 'Error message here.' }); // change is not allowed throw({ forbidden: 'Error message here.' });
The function takes 4 parameters:
newDoc
- New version of document that will be stored from the update request.oldDoc
- Previous version of document that is already stored.userCtx
- User Context Object, containing information about the user writing the document (if present), see theUserContext
.secObj
- Security Object, with lists of database security roles, see theSecurityObject
.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.+$/
Schema for design document views.
- views
JavaScript map function as a string.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.+$/
JavaScript reduce function as a string.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.+$/
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]Query parameter to specify whether to prevent insertion of conflicting document revisions. If false, a well-formed _rev must be included in the document. False is used by the replicator to insert documents into the target database even if that leads to the creation of conflicts.
Avoid using this parameter, since this option applies document revisions without checking for conflicts, so it is very easy to accidentally end up with a large number of conflicts.
Default:
false
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Schema for a design document.
- designDocument
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Allowable values: [
available
,missing
,deleted
]
Indicates whether to automatically build indexes defined in this design document.
Default:
true
Schema for filter functions definition. This schema is a map where keys are the names of the filter functions and values are the function definition in string format.
Filter function formats, or filters the changes feed that pass filter rules. The function takes 2 parameters:
-
doc
: The document that is being processed. -
req
: A Request JavaScript object with these properties:body
- string, Request body data as string. If the request method is GET this field contains the value"undefined"
. If the method is DELETE or HEAD the value is""
(empty string).cookie
- Cookies object.form
- Form Data object, contains the decoded body as key-value pairs if the Content-Type header was application/x-www-form-urlencoded.headers
- Request Headers object.id
- string, requested document id if it was specified or null otherwise.info
- Database Information object, seeDatabaseInformation
.method
- string or an array of chars, request method. String value is a method as one of: HEAD, GET, POST, PUT, DELETE, OPTIONS, TRACE, COPY. For not supported methods it will be represented as an array of char codes e.g. for VIEW it will be 86,73,69,87.path
- array of strings, requested path sections.peer
- string, request source IP address.query
- string, URL query parameters object. Note that multiple keys are not supported and the last key value suppresses others.requested_path
- array of strings, actual requested path section.raw_path
- string, raw requested path.userCtx
: User Context Object, containing information about the user writing the document (if present), see theUserContext
.secObj
: Security Object, with lists of database security roles, see theSecurityObject
.uuid
- string, generated UUID by a specified algorithm in the config file.
Filter functions must return true if a document passed all the rules.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.+$/
-
Search (text) index function definitions.
- indexes
Schema for a search analyzer configuration.
- analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Allowable values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for mapping a field name to a per field analyzer.
- fields
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Allowable values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
String form of a JavaScript function that is called for each document in the database. The function takes the document as a parameter, extracts some data from it, and then calls the
index
function to index that data. The index function takes 2, or optionally 3, parameters.-
The first parameter is the name of the field you intend to use when querying the index. If the special value
"default"
is used when you define the name, you do not have to specify a field name at query time. -
The second parameter is the data to be indexed. This data must be only a string, number, or boolean. Other types will cause an error to be thrown by the index function call.
-
The optional third parameter is a JavaScript object with these properties:
facet
- boolean, defaultfalse
- Creates a faceted index.index
- boolean, defaulttrue
- If set tofalse
, the data cannot be used for searches, but can still be retrieved from the index ifstore
is set totrue
.store
- boolean, defaulttrue
- If true, the value is returned in the search result; otherwise, the value is not returned.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.*$/
-
Defines Query Server key to process design document functions.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Default:
javascript
Schema for design document options.
- options
Whether this design document describes partitioned or global indexes.
Validate document update function can be used to prevent invalid or unauthorized document update requests from being stored. Validation functions typically examine the structure of the new document to ensure that required fields are present and to verify that the requesting user should be allowed to make changes to the document properties. When a write request is received for a given database, the validation function in each design document in that database is called in an unspecified order. If any of the validation functions throw an error, the write will not succeed.
The validation function can abort the pending document write by throwing one of two error objects:
// user is not authorized to make the change but may re-authenticate throw({ unauthorized: 'Error message here.' }); // change is not allowed throw({ forbidden: 'Error message here.' });
The function takes 4 parameters:
newDoc
- New version of document that will be stored from the update request.oldDoc
- Previous version of document that is already stored.userCtx
- User Context Object, containing information about the user writing the document (if present), see theUserContext
.secObj
- Security Object, with lists of database security roles, see theSecurityObject
.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.+$/
Schema for design document views.
- views
JavaScript map function as a string.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.+$/
JavaScript reduce function as a string.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.+$/
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]Query parameter to specify whether to prevent insertion of conflicting document revisions. If false, a well-formed _rev must be included in the document. False is used by the replicator to insert documents into the target database even if that leads to the creation of conflicts.
Avoid using this parameter, since this option applies document revisions without checking for conflicts, so it is very easy to accidentally end up with a large number of conflicts.
Default:
false
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Schema for a design document.
- design_document
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Allowable values: [
available
,missing
,deleted
]
Indicates whether to automatically build indexes defined in this design document.
Default:
true
Schema for filter functions definition. This schema is a map where keys are the names of the filter functions and values are the function definition in string format.
Filter function formats, or filters the changes feed that pass filter rules. The function takes 2 parameters:
-
doc
: The document that is being processed. -
req
: A Request JavaScript object with these properties:body
- string, Request body data as string. If the request method is GET this field contains the value"undefined"
. If the method is DELETE or HEAD the value is""
(empty string).cookie
- Cookies object.form
- Form Data object, contains the decoded body as key-value pairs if the Content-Type header was application/x-www-form-urlencoded.headers
- Request Headers object.id
- string, requested document id if it was specified or null otherwise.info
- Database Information object, seeDatabaseInformation
.method
- string or an array of chars, request method. String value is a method as one of: HEAD, GET, POST, PUT, DELETE, OPTIONS, TRACE, COPY. For not supported methods it will be represented as an array of char codes e.g. for VIEW it will be 86,73,69,87.path
- array of strings, requested path sections.peer
- string, request source IP address.query
- string, URL query parameters object. Note that multiple keys are not supported and the last key value suppresses others.requested_path
- array of strings, actual requested path section.raw_path
- string, raw requested path.userCtx
: User Context Object, containing information about the user writing the document (if present), see theUserContext
.secObj
: Security Object, with lists of database security roles, see theSecurityObject
.uuid
- string, generated UUID by a specified algorithm in the config file.
Filter functions must return true if a document passed all the rules.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.+$/
-
Search (text) index function definitions.
- indexes
Schema for a search analyzer configuration.
- analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Allowable values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for mapping a field name to a per field analyzer.
- fields
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Allowable values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
String form of a JavaScript function that is called for each document in the database. The function takes the document as a parameter, extracts some data from it, and then calls the
index
function to index that data. The index function takes 2, or optionally 3, parameters.-
The first parameter is the name of the field you intend to use when querying the index. If the special value
"default"
is used when you define the name, you do not have to specify a field name at query time. -
The second parameter is the data to be indexed. This data must be only a string, number, or boolean. Other types will cause an error to be thrown by the index function call.
-
The optional third parameter is a JavaScript object with these properties:
facet
- boolean, defaultfalse
- Creates a faceted index.index
- boolean, defaulttrue
- If set tofalse
, the data cannot be used for searches, but can still be retrieved from the index ifstore
is set totrue
.store
- boolean, defaulttrue
- If true, the value is returned in the search result; otherwise, the value is not returned.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.*$/
-
Defines Query Server key to process design document functions.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Default:
javascript
Schema for design document options.
- options
Whether this design document describes partitioned or global indexes.
Validate document update function can be used to prevent invalid or unauthorized document update requests from being stored. Validation functions typically examine the structure of the new document to ensure that required fields are present and to verify that the requesting user should be allowed to make changes to the document properties. When a write request is received for a given database, the validation function in each design document in that database is called in an unspecified order. If any of the validation functions throw an error, the write will not succeed.
The validation function can abort the pending document write by throwing one of two error objects:
// user is not authorized to make the change but may re-authenticate throw({ unauthorized: 'Error message here.' }); // change is not allowed throw({ forbidden: 'Error message here.' });
The function takes 4 parameters:
newDoc
- New version of document that will be stored from the update request.oldDoc
- Previous version of document that is already stored.userCtx
- User Context Object, containing information about the user writing the document (if present), see theUserContext
.secObj
- Security Object, with lists of database security roles, see theSecurityObject
.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.+$/
Schema for design document views.
- views
JavaScript map function as a string.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.+$/
JavaScript reduce function as a string.
Possible values: 1 ≤ length ≤ 1048488, Value must match regular expression
/^.+$/
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]Query parameter to specify whether to prevent insertion of conflicting document revisions. If false, a well-formed _rev must be included in the document. False is used by the replicator to insert documents into the target database even if that leads to the creation of conflicts.
Avoid using this parameter, since this option applies document revisions without checking for conflicts, so it is very easy to accidentally end up with a large number of conflicts.
Default:
false
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X PUT "$SERVICE_URL/users/_design/allusers" -H "Content-Type: application/json" --data '{ "views": { "getVerifiedEmails": { "map": "function(doc) { if(doc.email_verified === true){ emit(doc.email, [doc.name, doc.email_verified, doc.joined]) }}" } }, "indexes": { "activeUsers": { "index": "function (doc) { index(\"name\", doc.name); index(\"active\", doc.active); }" } } }' curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X PUT "$SERVICE_URL/products/_design/appliances" -H "Content-Type: application/json" --data '{ "views": { "byApplianceProdId": { "map": "function(doc) { emit(doc.productid, [doc.brand, doc.name, doc.description]) }" } }, "indexes": { "findByPrice": { "index": "function (doc) { index(\"price\", doc.price); }" } } }'
This example creates
allusers
design document in theusers
database andappliances
design document in the partitionedproducts
database.
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } emailViewMapReduce, err := service.NewDesignDocumentViewsMapReduce("function(doc) { if(doc.email_verified === true) { emit(doc.email, [doc.name, doc.email_verified, doc.joined]); }}") if err != nil { panic(err) } userIndexDefinition, err := service.NewSearchIndexDefinition("function(doc) { index(\"name\", doc.name); index(\"active\", doc.active); }") if err != nil { panic(err) } designDocument := &cloudantv1.DesignDocument{ Views: map[string]cloudantv1.DesignDocumentViewsMapReduce{ "getVerifiedEmails": *emailViewMapReduce, }, Indexes: map[string]cloudantv1.SearchIndexDefinition{ "activeUsers": *userIndexDefinition, }, } putDesignDocumentOptions := service.NewPutDesignDocumentOptions( "users", "allusers", designDocument, ) documentResult, response, err := service.PutDesignDocument(putDesignDocumentOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(documentResult, "", " ") fmt.Println(string(b)) applianceProdIdViewMapReduce, err := service.NewDesignDocumentViewsMapReduce("function(doc) { emit(doc.productId, [doc.date, doc.eventType, doc.userId]); }") if err != nil { panic(err) } dateIndexDefinition, err := service.NewSearchIndexDefinition("function(doc) { index(\"date\", doc.date); }") if err != nil { panic(err) } partitionedDesignDocument := &cloudantv1.DesignDocument{ Views: map[string]cloudantv1.DesignDocumentViewsMapReduce{ "byProductId": *applianceProdIdViewMapReduce, }, Indexes: map[string]cloudantv1.SearchIndexDefinition{ "findByDate": *dateIndexDefinition, }, } putPartitionedDesignDocumentOptions := service.NewPutDesignDocumentOptions( "events", "checkout", partitionedDesignDocument, ) documentResult, response, err = service.PutDesignDocument(putPartitionedDesignDocumentOptions) if err != nil { panic(err) } b, _ = json.MarshalIndent(documentResult, "", " ") fmt.Println(string(b))
This example creates
allusers
design document in theusers
database andcheckout
design document in the partitionedevents
database.
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.DesignDocument; import com.ibm.cloud.cloudant.v1.model.DesignDocumentViewsMapReduce; import com.ibm.cloud.cloudant.v1.model.DocumentResult; import com.ibm.cloud.cloudant.v1.model.PutDesignDocumentOptions; import com.ibm.cloud.cloudant.v1.model.SearchIndexDefinition; import java.util.Collections;
Cloudant service = Cloudant.newInstance(); DesignDocumentViewsMapReduce emailViewMapReduce = new DesignDocumentViewsMapReduce.Builder() .map("function(doc) { if(doc.email_verified === true) { emit(doc.email, [doc.name, doc.email_verified, doc.joined]); }}") .build(); SearchIndexDefinition usersIndex = new SearchIndexDefinition.Builder() .index("function(doc) { index(\"name\", doc.name); index(\"active\", doc.active); }") .build(); DesignDocument designDocument = new DesignDocument(); designDocument.setViews( Collections.singletonMap("getVerifiedEmails", emailViewMapReduce)); designDocument.setIndexes( Collections.singletonMap("activeUsers", usersIndex)); PutDesignDocumentOptions designDocumentOptions = new PutDesignDocumentOptions.Builder() .db("users") .designDocument(designDocument) .ddoc("allusers") .build(); DocumentResult allusersResponse = service.putDesignDocument(designDocumentOptions).execute() .getResult(); System.out.println(allusersResponse); DesignDocumentViewsMapReduce applianceView = new DesignDocumentViewsMapReduce.Builder() .map("function(doc) { emit(doc.productId, [doc.date, doc.eventType, doc.userId]); }") .build(); SearchIndexDefinition dateIndex = new SearchIndexDefinition.Builder() .index("function(doc) { index(\"date\", doc.date); }") .build(); DesignDocument partitionedDesignDocument = new DesignDocument(); partitionedDesignDocument.setViews( Collections.singletonMap("byProductId", applianceView)); partitionedDesignDocument.setIndexes( Collections.singletonMap("findByDate", dateIndex)); PutDesignDocumentOptions partitionedDesignDocumentOptions = new PutDesignDocumentOptions.Builder() .db("events") .designDocument(partitionedDesignDocument) .ddoc("checkout") .build(); DocumentResult appliancesResponse = service.putDesignDocument(partitionedDesignDocumentOptions).execute() .getResult(); System.out.println(appliancesResponse);
This example creates
allusers
design document in theusers
database andcheckout
design document in the partitionedevents
database.
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); const emailViewMapReduce: CloudantV1.DesignDocumentViewsMapReduce = { map: 'function(doc) { if(doc.email_verified === true) { emit(doc.email, [doc.name, doc.email_verified, doc.joined]); }}' } const userIndex: CloudantV1.SearchIndexDefinition = { index: 'function(doc) { index("name", doc.name); index("active", doc.active); }' } const designDocument: CloudantV1.DesignDocument = { views: {'getVerifiedEmails': emailViewMapReduce}, indexes: {'activeUsers': userIndex}} service.putDesignDocument({ db: 'users', designDocument: designDocument, ddoc: 'allusers' }).then(response => { console.log(response.result); }); const productMap: CloudantV1.DesignDocumentViewsMapReduce = { map: 'function(doc) { emit(doc.productId, [doc.date, doc.eventType, doc.userId]); }' } const dateIndex: CloudantV1.SearchIndexDefinition = { index: 'function(doc) { index("date", doc.date); }' } const partitionedDesignDoc: CloudantV1.DesignDocument = { views: {'byProductId': productMap}, indexes: {'findByDate': dateIndex}} service.putDesignDocument({ db: 'events', designDocument: partitionedDesignDoc, ddoc: 'checkout' }).then(response => { console.log(response.result); });
This example creates
allusers
design document in theusers
database andcheckout
design document in the partitionedevents
database.
from ibmcloudant.cloudant_v1 import Analyzer, AnalyzerConfiguration, CloudantV1, DesignDocument, DesignDocumentOptions, DesignDocumentViewsMapReduce, SearchIndexDefinition service = CloudantV1.new_instance() email_view_map_reduce = DesignDocumentViewsMapReduce( map='function(doc) { if(doc.email_verified === true) { emit(doc.email, [doc.name, doc.email_verified, doc.joined]); }}' ) user_index = SearchIndexDefinition( index='function(doc) { index("name", doc.name); index("active", doc.active); }', analyzer=AnalyzerConfiguration(name="standard", fields={"email": Analyzer(name="email")})) design_document = DesignDocument( views={'getVerifiedEmails': email_view_map_reduce}, indexes={'activeUsers': user_index} ) response = service.put_design_document( db='users', design_document=design_document, ddoc='allusers' ).get_result() print(response) # Partitioned DesignDocument Example product_map = DesignDocumentViewsMapReduce( map='function(doc) { emit(doc.productId, [doc.date, doc.eventType, doc.userId]); }' ) date_index = SearchIndexDefinition( index='function(doc) { index("date", doc.date); }', analyzer=AnalyzerConfiguration(name="classic", fields={"description": Analyzer(name="english")}) ) design_document_options = DesignDocumentOptions( partitioned=True ) partitioned_design_doc = DesignDocument( views={'byProductId': product_map}, indexes={'findByDate': date_index}, options=design_document_options ) response = service.put_design_document( db='events', design_document=partitioned_design_doc, ddoc='checkout' ).get_result() print(response)
This example creates
allusers
design document in theusers
database andcheckout
design document in the partitionedevents
database.
Response
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
ok
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Status Code
HTTP response for Document modification operations.
HTTP response for Document modification operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for conflict.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for a document update conflict.
{ "error": "conflict", "reason": "Document update conflict." }
Example error response for a document update conflict.
{ "error": "conflict", "reason": "Document update conflict." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request with a document size that exceeds the allowable limit.
{ "error": "document_too_large", "reason": "doc_id" }
Example error response for a request with a document size that exceeds the allowable limit.
{ "error": "document_too_large", "reason": "doc_id" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve information about a design document
Retrieves information about the specified design document, including the index, index size, and current status of the design document and associated index information.
Retrieves information about the specified design document, including the index, index size, and current status of the design document and associated index information.
Retrieves information about the specified design document, including the index, index size, and current status of the design document and associated index information.
Retrieves information about the specified design document, including the index, index size, and current status of the design document and associated index information.
Retrieves information about the specified design document, including the index, index size, and current status of the design document and associated index information.
GET /{db}/_design/{ddoc}/_info
(cloudant *CloudantV1) GetDesignDocumentInformation(getDesignDocumentInformationOptions *GetDesignDocumentInformationOptions) (result *DesignDocumentInformation, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) GetDesignDocumentInformationWithContext(ctx context.Context, getDesignDocumentInformationOptions *GetDesignDocumentInformationOptions) (result *DesignDocumentInformation, response *core.DetailedResponse, err error)
ServiceCall<DesignDocumentInformation> getDesignDocumentInformation(GetDesignDocumentInformationOptions getDesignDocumentInformationOptions)
getDesignDocumentInformation(params)
get_design_document_information(
self,
db: str,
ddoc: str,
**kwargs,
) -> DetailedResponse
Request
Instantiate the GetDesignDocumentInformationOptions
struct and set the fields to provide parameter values for the GetDesignDocumentInformation
method.
Use the GetDesignDocumentInformationOptions.Builder
to create a GetDesignDocumentInformationOptions
object that contains the parameter values for the getDesignDocumentInformation
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The GetDesignDocumentInformation options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
The getDesignDocumentInformation options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/products/_design/appliances/_info"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } getDesignDocumentInformationOptions := service.NewGetDesignDocumentInformationOptions( "products", "appliances", ) designDocumentInformation, response, err := service.GetDesignDocumentInformation(getDesignDocumentInformationOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(designDocumentInformation, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.DesignDocumentInformation; import com.ibm.cloud.cloudant.v1.model.GetDesignDocumentInformationOptions;
Cloudant service = Cloudant.newInstance(); GetDesignDocumentInformationOptions informationOptions = new GetDesignDocumentInformationOptions.Builder() .db("products") .ddoc("appliances") .build(); DesignDocumentInformation response = service.getDesignDocumentInformation(informationOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.getDesignDocumentInformation({ db: 'products', ddoc: 'appliances' }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.get_design_document_information( db='products', ddoc='appliances' ).get_result() print(response)
Response
Schema for information about a design document.
name
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
View index information.
Schema for information about a design document.
name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
View index information.
- ViewIndex
List of collator versions. If there are multiple entries this implies a libicu upgrade has occurred but compaction has not run yet.
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Indicates whether a compaction routine is currently running on the view.
Language for the defined views.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
MD5 signature of the views for the design document.
Possible values: length = 32, Value must match regular expression
/^[\\da-f]{32}$/
Schema for size information of content.
- Sizes
The active size of the content, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740992
The total uncompressed size of the content, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740992
The total size of the content as stored on disk, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740992
Indicates if the view is currently being updated.
Schema for an ability to tell if view is up-to-date without querying it.
- UpdatesPending
Sum of shard copies with the least amount of work to do.
Possible values: 0 ≤ value ≤ 9007199254740992
Sum of unique shards. This value is zero when at least one copy of every shard range is up-to-date and the view is able to answer a query without index building delays.
Possible values: 0 ≤ value ≤ 9007199254740992
Sum of all shard copies.
Possible values: 0 ≤ value ≤ 9007199254740992
Number of clients waiting on views from this design document.
Possible values: 0 ≤ value ≤ 10000
Indicates if there are outstanding commits to the underlying database that need to processed.
Schema for information about a design document.
name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
View index information.
- viewIndex
List of collator versions. If there are multiple entries this implies a libicu upgrade has occurred but compaction has not run yet.
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Indicates whether a compaction routine is currently running on the view.
Language for the defined views.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
MD5 signature of the views for the design document.
Possible values: length = 32, Value must match regular expression
/^[\\da-f]{32}$/
Schema for size information of content.
- sizes
The active size of the content, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740992
The total uncompressed size of the content, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740992
The total size of the content as stored on disk, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740992
Indicates if the view is currently being updated.
Schema for an ability to tell if view is up-to-date without querying it.
- updatesPending
Sum of shard copies with the least amount of work to do.
Possible values: 0 ≤ value ≤ 9007199254740992
Sum of unique shards. This value is zero when at least one copy of every shard range is up-to-date and the view is able to answer a query without index building delays.
Possible values: 0 ≤ value ≤ 9007199254740992
Sum of all shard copies.
Possible values: 0 ≤ value ≤ 9007199254740992
Number of clients waiting on views from this design document.
Possible values: 0 ≤ value ≤ 10000
Indicates if there are outstanding commits to the underlying database that need to processed.
Schema for information about a design document.
name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
View index information.
- viewIndex
List of collator versions. If there are multiple entries this implies a libicu upgrade has occurred but compaction has not run yet.
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Indicates whether a compaction routine is currently running on the view.
Language for the defined views.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
MD5 signature of the views for the design document.
Possible values: length = 32, Value must match regular expression
/^[\\da-f]{32}$/
Schema for size information of content.
- sizes
The active size of the content, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740992
The total uncompressed size of the content, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740992
The total size of the content as stored on disk, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740992
Indicates if the view is currently being updated.
Schema for an ability to tell if view is up-to-date without querying it.
- updatesPending
Sum of shard copies with the least amount of work to do.
Possible values: 0 ≤ value ≤ 9007199254740992
Sum of unique shards. This value is zero when at least one copy of every shard range is up-to-date and the view is able to answer a query without index building delays.
Possible values: 0 ≤ value ≤ 9007199254740992
Sum of all shard copies.
Possible values: 0 ≤ value ≤ 9007199254740992
Number of clients waiting on views from this design document.
Possible values: 0 ≤ value ≤ 10000
Indicates if there are outstanding commits to the underlying database that need to processed.
Schema for information about a design document.
name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
View index information.
- view_index
List of collator versions. If there are multiple entries this implies a libicu upgrade has occurred but compaction has not run yet.
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Indicates whether a compaction routine is currently running on the view.
Language for the defined views.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
MD5 signature of the views for the design document.
Possible values: length = 32, Value must match regular expression
/^[\\da-f]{32}$/
Schema for size information of content.
- sizes
The active size of the content, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740992
The total uncompressed size of the content, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740992
The total size of the content as stored on disk, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740992
Indicates if the view is currently being updated.
Schema for an ability to tell if view is up-to-date without querying it.
- updates_pending
Sum of shard copies with the least amount of work to do.
Possible values: 0 ≤ value ≤ 9007199254740992
Sum of unique shards. This value is zero when at least one copy of every shard range is up-to-date and the view is able to answer a query without index building delays.
Possible values: 0 ≤ value ≤ 9007199254740992
Sum of all shard copies.
Possible values: 0 ≤ value ≤ 9007199254740992
Number of clients waiting on views from this design document.
Possible values: 0 ≤ value ≤ 10000
Indicates if there are outstanding commits to the underlying database that need to processed.
Status Code
HTTP response for
/{db}/_design/{ddoc}/_info
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example DesignDocumentInformation response.
{ "name": "appliances", "view_index": { "collator_versions": [ "153.72" ], "compact_running": false, "language": "javascript", "purge_seq": 0, "signature": "a85901c6c0c027ab8f319f9995b6d951", "sizes": { "active": 593, "external": 703, "file": 70340 }, "update_seq": 47, "updater_running": false, "updates_pending": { "minimum": 42, "preferred": 42, "total": 42 }, "waiting_clients": 0, "waiting_commit": false } }
Example DesignDocumentInformation response.
{ "name": "appliances", "view_index": { "collator_versions": [ "153.72" ], "compact_running": false, "language": "javascript", "purge_seq": 0, "signature": "a85901c6c0c027ab8f319f9995b6d951", "sizes": { "active": 593, "external": 703, "file": 70340 }, "update_seq": 47, "updater_running": false, "updates_pending": { "minimum": 42, "preferred": 42, "total": 42 }, "waiting_clients": 0, "waiting_commit": false } }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve HTTP headers about a design document
Retrieves the HTTP headers about the specified design document.
HEAD /{db}/_design/{ddoc}/_info
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for
/{db}/_design/{ddoc}/_info
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Query a list of all design documents in a database (GET)
Queries the index of all design document IDs. The results matching the query parameters are returned in a JSON object, including a list of matching design documents with basic contents, such as the ID and revision. When no query parameters are specified, results for all design documents in the database are returned. Optionally, the design document content or additional metadata can be included in the response.
GET /{db}/_design_docs
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Query Parameters
Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Query parameter to specify whether to return the documents in descending by key order.
Default:
false
Query parameter to specify to stop returning records when the specified key is reached. String representation of any JSON type that matches the key type emitted by the view function.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query parameter to specify to stop returning records when the specified document ID is reached.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].*$
Query parameter to specify whether to include the full content of the documents in the response.
Default:
false
Query parameter to specify whether the specified end key should be included in the result.
Default:
true
Query parameter to specify to return only documents that match the specified key. String representation of any JSON type that matches the key type emitted by the view function.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query parameter to specify returning only documents that match any of the specified keys. String representation of a JSON array of keys that match the key type emitted by the view function. Must be URL encoded.
Possible values: 2 ≤ length ≤ 7168, Value must match regular expression
^\[(".*")*\]$
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Query parameter to specify to start returning records from the specified key. String representation of any JSON type that matches the key type emitted by the view function.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query parameter to specify to start returning records from the specified document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].*$
Query parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/users/_design_docs?attachments=true"
Response
Schema for the result of an all documents operation.
Offset where the list started.
Possible values: 0 ≤ value ≤ 9007199254740992
Total number of document results.
Possible values: 0 ≤ value ≤ 4294967295
List of doc results.
Possible values: 0 ≤ number of items ≤ 4294967295
Current update sequence for the database
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Status Code
HTTP response for getDesignDocs and postDesignDocs.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example AllDocsResult response for design documents.
{ "offset": 0, "rows": [ { "id": "_design/ddoc01", "key": "_design/ddoc01", "value": { "rev": "1-7407569d54af5bc94c266e70cbf8a180" } }, { "id": "_design/ddoc02", "key": "_design/ddoc02", "value": { "rev": "1-d942f0ce01647aa0f46518b213b5628e" } }, { "id": "_design/ddoc03", "key": "_design/ddoc03", "value": { "rev": "1-721fead6e6c8d811a225d5a62d08dfd0" } }, { "id": "_design/ddoc04", "key": "_design/ddoc04", "value": { "rev": "1-32c76b46ca61351c75a84fbcbceece2f" } }, { "id": "_design/ddoc05", "key": "_design/ddoc05", "value": { "rev": "1-af856babf9cf746b48ae999645f9541e" } } ], "total_rows": 5 }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve HTTP headers for a list of all design documents in a database (GET)
Retrieves the HTTP headers for a list of all design documents in a database (GET).
HEAD /{db}/_design_docs
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for
/_all_docs
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Query a list of all design documents in a database
Queries the index of all design document IDs. The results matching the request body parameters are returned in a JSON object, including a list of matching design documents with basic contents, such as the ID and revision. When no request body parameters are specified, results for all design documents in the database are returned. Optionally, the design document content or additional metadata can be included in the response.
Queries the index of all design document IDs. The results matching the request body parameters are returned in a JSON object, including a list of matching design documents with basic contents, such as the ID and revision. When no request body parameters are specified, results for all design documents in the database are returned. Optionally, the design document content or additional metadata can be included in the response.
Queries the index of all design document IDs. The results matching the request body parameters are returned in a JSON object, including a list of matching design documents with basic contents, such as the ID and revision. When no request body parameters are specified, results for all design documents in the database are returned. Optionally, the design document content or additional metadata can be included in the response.
Queries the index of all design document IDs. The results matching the request body parameters are returned in a JSON object, including a list of matching design documents with basic contents, such as the ID and revision. When no request body parameters are specified, results for all design documents in the database are returned. Optionally, the design document content or additional metadata can be included in the response.
Queries the index of all design document IDs. The results matching the request body parameters are returned in a JSON object, including a list of matching design documents with basic contents, such as the ID and revision. When no request body parameters are specified, results for all design documents in the database are returned. Optionally, the design document content or additional metadata can be included in the response.
POST /{db}/_design_docs
(cloudant *CloudantV1) PostDesignDocs(postDesignDocsOptions *PostDesignDocsOptions) (result *AllDocsResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostDesignDocsWithContext(ctx context.Context, postDesignDocsOptions *PostDesignDocsOptions) (result *AllDocsResult, response *core.DetailedResponse, err error)
ServiceCall<AllDocsResult> postDesignDocs(PostDesignDocsOptions postDesignDocsOptions)
postDesignDocs(params)
post_design_docs(
self,
db: str,
*,
att_encoding_info: Optional[bool] = None,
attachments: Optional[bool] = None,
conflicts: Optional[bool] = None,
descending: Optional[bool] = None,
include_docs: Optional[bool] = None,
inclusive_end: Optional[bool] = None,
limit: Optional[int] = None,
skip: Optional[int] = None,
update_seq: Optional[bool] = None,
end_key: Optional[str] = None,
key: Optional[str] = None,
keys: Optional[List[str]] = None,
start_key: Optional[str] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the PostDesignDocsOptions
struct and set the fields to provide parameter values for the PostDesignDocs
method.
Use the PostDesignDocsOptions.Builder
to create a PostDesignDocsOptions
object that contains the parameter values for the postDesignDocs
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
HTTP request body for postAllDocs and postPartitionAllDocs.
Example AllDocs request.
{
"limit": 10,
"start_key": "0007741142412418284"
}
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Query parameter to specify whether to sort the returned rows. Setting this to false offers a performance boost. The total_rows and offset fields are not available when this is set to false.
Default:
true
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The PostDesignDocs options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Examples:10
Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Examples:0007741142412418284
The postDesignDocs options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Examples:10
Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Examples:0007741142412418284
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Examples:Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Examples:
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Examples:Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Examples:
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X POST "$SERVICE_URL/users/_design_docs" -H "Content-Type: application/json" --data '{ "attachments": true }'
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } postDesignDocsOptions := service.NewPostDesignDocsOptions( "users", ) postDesignDocsOptions.SetAttachments(true) allDocsResult, response, err := service.PostDesignDocs(postDesignDocsOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(allDocsResult, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.AllDocsResult; import com.ibm.cloud.cloudant.v1.model.PostDesignDocsOptions;
Cloudant service = Cloudant.newInstance(); PostDesignDocsOptions docsOptions = new PostDesignDocsOptions.Builder() .attachments(true) .db("users") .build(); AllDocsResult response = service.postDesignDocs(docsOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.postDesignDocs({ attachments: true, db: 'users' }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.post_design_docs( attachments=True, db='users' ).get_result() print(response)
Response
Schema for the result of an all documents operation.
Offset where the list started.
Possible values: 0 ≤ value ≤ 9007199254740992
Total number of document results.
Possible values: 0 ≤ value ≤ 4294967295
List of doc results.
Possible values: 0 ≤ number of items ≤ 4294967295
Current update sequence for the database
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Schema for the result of an all documents operation.
Total number of document results.
Possible values: 0 ≤ value ≤ 4294967295
List of doc results.
Possible values: number of items ≥ 0
- Rows
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a document.
- Doc
Schema for a map of attachment name to attachment metadata.
- Attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- Revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- RevsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Value of built-in
/_all_docs
style view.- Value
If
true
then the document is deleted. Not present for undeleted documents.Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for the result of an all documents operation.
Total number of document results.
Possible values: 0 ≤ value ≤ 4294967295
List of doc results.
Possible values: number of items ≥ 0
- rows
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- revsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Value of built-in
/_all_docs
style view.- value
If
true
then the document is deleted. Not present for undeleted documents.Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for the result of an all documents operation.
Total number of document results.
Possible values: 0 ≤ value ≤ 4294967295
List of doc results.
Possible values: number of items ≥ 0
- rows
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Value of built-in
/_all_docs
style view.- value
If
true
then the document is deleted. Not present for undeleted documents.Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for the result of an all documents operation.
Total number of document results.
Possible values: 0 ≤ value ≤ 4294967295
List of doc results.
Possible values: number of items ≥ 0
- rows
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Value of built-in
/_all_docs
style view.- value
If
true
then the document is deleted. Not present for undeleted documents.Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Status Code
HTTP response for getDesignDocs and postDesignDocs.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example AllDocsResult response for design documents.
{ "offset": 0, "rows": [ { "id": "_design/ddoc01", "key": "_design/ddoc01", "value": { "rev": "1-7407569d54af5bc94c266e70cbf8a180" } }, { "id": "_design/ddoc02", "key": "_design/ddoc02", "value": { "rev": "1-d942f0ce01647aa0f46518b213b5628e" } }, { "id": "_design/ddoc03", "key": "_design/ddoc03", "value": { "rev": "1-721fead6e6c8d811a225d5a62d08dfd0" } }, { "id": "_design/ddoc04", "key": "_design/ddoc04", "value": { "rev": "1-32c76b46ca61351c75a84fbcbceece2f" } }, { "id": "_design/ddoc05", "key": "_design/ddoc05", "value": { "rev": "1-af856babf9cf746b48ae999645f9541e" } } ], "total_rows": 5 }
Example AllDocsResult response for design documents.
{ "offset": 0, "rows": [ { "id": "_design/ddoc01", "key": "_design/ddoc01", "value": { "rev": "1-7407569d54af5bc94c266e70cbf8a180" } }, { "id": "_design/ddoc02", "key": "_design/ddoc02", "value": { "rev": "1-d942f0ce01647aa0f46518b213b5628e" } }, { "id": "_design/ddoc03", "key": "_design/ddoc03", "value": { "rev": "1-721fead6e6c8d811a225d5a62d08dfd0" } }, { "id": "_design/ddoc04", "key": "_design/ddoc04", "value": { "rev": "1-32c76b46ca61351c75a84fbcbceece2f" } }, { "id": "_design/ddoc05", "key": "_design/ddoc05", "value": { "rev": "1-af856babf9cf746b48ae999645f9541e" } } ], "total_rows": 5 }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Multi-query the list of all design documents
This operation runs multiple view queries of all design documents in the database. This operation enables you to request numerous queries in a single request, in place of multiple POST /{db}/_design_docs
requests.
This operation runs multiple view queries of all design documents in the database. This operation enables you to request numerous queries in a single request, in place of multiple POST /{db}/_design_docs
requests.
This operation runs multiple view queries of all design documents in the database. This operation enables you to request numerous queries in a single request, in place of multiple POST /{db}/_design_docs
requests.
This operation runs multiple view queries of all design documents in the database. This operation enables you to request numerous queries in a single request, in place of multiple POST /{db}/_design_docs
requests.
This operation runs multiple view queries of all design documents in the database. This operation enables you to request numerous queries in a single request, in place of multiple POST /{db}/_design_docs
requests.
POST /{db}/_design_docs/queries
(cloudant *CloudantV1) PostDesignDocsQueries(postDesignDocsQueriesOptions *PostDesignDocsQueriesOptions) (result *AllDocsQueriesResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostDesignDocsQueriesWithContext(ctx context.Context, postDesignDocsQueriesOptions *PostDesignDocsQueriesOptions) (result *AllDocsQueriesResult, response *core.DetailedResponse, err error)
ServiceCall<AllDocsQueriesResult> postDesignDocsQueries(PostDesignDocsQueriesOptions postDesignDocsQueriesOptions)
postDesignDocsQueries(params)
post_design_docs_queries(
self,
db: str,
queries: List['AllDocsQuery'],
*,
accept: Optional[str] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the PostDesignDocsQueriesOptions
struct and set the fields to provide parameter values for the PostDesignDocsQueries
method.
Use the PostDesignDocsQueriesOptions.Builder
to create a PostDesignDocsQueriesOptions
object that contains the parameter values for the postDesignDocsQueries
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
HTTP request body for allDocsQueriesQuery, designDocsQueriesQuery and localDocsQueriesQuery.
Example AllDocsQueriesQuery request.
{
"queries": [
{
"keys": [
"small-appliances:1000042",
"small-appliances:1000043"
]
},
{
"limit": 3,
"skip": 2
}
]
}
An array of query objects with fields for the parameters of each individual view query to be executed. The field names and their meaning are the same as the query parameters of a regular
/_all_docs
request.Possible values: 1 ≤ number of items ≤ 65535
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The PostDesignDocsQueries options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
An array of query objects with fields for the parameters of each individual view query to be executed. The field names and their meaning are the same as the query parameters of a regular
/_all_docs
request.Possible values: 1 ≤ number of items ≤ 65535
Examples:[ { "keys": [ "small-appliances:1000042", "small-appliances:1000043" ] }, { "limit": 3, "skip": 2 } ]
- Queries
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
The type of the response: application/json or application/octet-stream.
Allowable values: [
application/json
,application/octet-stream
]
The postDesignDocsQueries options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
An array of query objects with fields for the parameters of each individual view query to be executed. The field names and their meaning are the same as the query parameters of a regular
/_all_docs
request.Possible values: 1 ≤ number of items ≤ 65535
Examples:[ { "keys": [ "small-appliances:1000042", "small-appliances:1000043" ] }, { "limit": 3, "skip": 2 } ]
- queries
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
The type of the response: application/json or application/octet-stream.
Allowable values: [
application/json
,application/octet-stream
]
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
An array of query objects with fields for the parameters of each individual view query to be executed. The field names and their meaning are the same as the query parameters of a regular
/_all_docs
request.Possible values: 1 ≤ number of items ≤ 65535
Examples:- queries
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
The type of the response: application/json or application/octet-stream.
Allowable values: [
application/json
,application/octet-stream
]
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
An array of query objects with fields for the parameters of each individual view query to be executed. The field names and their meaning are the same as the query parameters of a regular
/_all_docs
request.Possible values: 1 ≤ number of items ≤ 65535
Examples:- queries
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
The type of the response: application/json or application/octet-stream.
Allowable values: [
application/json
,application/octet-stream
]
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X POST "$SERVICE_URL/users/_design_docs/queries" -H "Content-Type: application/json" --data '{ "queries": [ { "descending": true, "include_docs": true, "limit": 10 }, { "inclusive_end": true, "key": "_design/allusers", "skip": 1 } ] }'
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" "github.com/IBM/go-sdk-core/v5/core" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } doc1 := cloudantv1.AllDocsQuery{ Descending: core.BoolPtr(true), IncludeDocs: core.BoolPtr(true), Limit: core.Int64Ptr(10), } doc2 := cloudantv1.AllDocsQuery{ InclusiveEnd: core.BoolPtr(true), Key: core.StringPtr("_design/allusers"), Skip: core.Int64Ptr(1), } postDesignDocsQueriesOptions := service.NewPostDesignDocsQueriesOptions( "users", []cloudantv1.AllDocsQuery{ doc1, doc2, }, ) allDocsQueriesResult, response, err := service.PostDesignDocsQueries(postDesignDocsQueriesOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(allDocsQueriesResult, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.AllDocsQueriesResult; import com.ibm.cloud.cloudant.v1.model.AllDocsQuery; import com.ibm.cloud.cloudant.v1.model.PostDesignDocsQueriesOptions; import java.util.Arrays;
Cloudant service = Cloudant.newInstance(); AllDocsQuery query1 = new AllDocsQuery.Builder() .descending(true) .includeDocs(true) .limit(10) .build(); AllDocsQuery query2 = new AllDocsQuery.Builder() .inclusiveEnd(true) .key("_design/allusers") .skip(1) .build(); PostDesignDocsQueriesOptions queriesOptions = new PostDesignDocsQueriesOptions.Builder() .db("users") .queries(Arrays.asList(query1, query2)) .build(); AllDocsQueriesResult response = service.postDesignDocsQueries(queriesOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); const doc1: CloudantV1.AllDocsQuery = { descending: true, includeDocs: true, limit: 10 }; const doc2: CloudantV1.AllDocsQuery = { inclusiveEnd: true, key: '_design/allusers', skip: 1 }; const allDocsQueries: CloudantV1.AllDocsQuery[] = [doc1, doc2]; service.postDesignDocsQueries({ db: 'users', queries: allDocsQueries }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import AllDocsQuery, CloudantV1 service = CloudantV1.new_instance() doc1 = AllDocsQuery( descending=True, include_docs=True, limit=10 ) doc2 = AllDocsQuery( inclusive_end=True, key='_design/allusers', skip=1 ) response = service.post_design_docs_queries( db='users', queries=[doc1, doc2] ).get_result() print(response)
Response
Schema for the result of an all documents queries operation.
An array of result objects - one for each query. Each result object contains the same fields as the response to a regular
/_all_docs
request.Possible values: 1 ≤ number of items ≤ 65535
Schema for the result of an all documents queries operation.
An array of result objects - one for each query. Each result object contains the same fields as the response to a regular
/_all_docs
request.Possible values: 1 ≤ number of items ≤ 65535
- Results
Total number of document results.
Possible values: 0 ≤ value ≤ 4294967295
List of doc results.
Possible values: number of items ≥ 0
- Rows
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a document.
- Doc
Schema for a map of attachment name to attachment metadata.
- Attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- Revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- RevsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Value of built-in
/_all_docs
style view.- Value
If
true
then the document is deleted. Not present for undeleted documents.Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for the result of an all documents queries operation.
An array of result objects - one for each query. Each result object contains the same fields as the response to a regular
/_all_docs
request.Possible values: 1 ≤ number of items ≤ 65535
- results
Total number of document results.
Possible values: 0 ≤ value ≤ 4294967295
List of doc results.
Possible values: number of items ≥ 0
- rows
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- revsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Value of built-in
/_all_docs
style view.- value
If
true
then the document is deleted. Not present for undeleted documents.Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for the result of an all documents queries operation.
An array of result objects - one for each query. Each result object contains the same fields as the response to a regular
/_all_docs
request.Possible values: 1 ≤ number of items ≤ 65535
- results
Total number of document results.
Possible values: 0 ≤ value ≤ 4294967295
List of doc results.
Possible values: number of items ≥ 0
- rows
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Value of built-in
/_all_docs
style view.- value
If
true
then the document is deleted. Not present for undeleted documents.Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for the result of an all documents queries operation.
An array of result objects - one for each query. Each result object contains the same fields as the response to a regular
/_all_docs
request.Possible values: 1 ≤ number of items ≤ 65535
- results
Total number of document results.
Possible values: 0 ≤ value ≤ 4294967295
List of doc results.
Possible values: number of items ≥ 0
- rows
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Value of built-in
/_all_docs
style view.- value
If
true
then the document is deleted. Not present for undeleted documents.Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Status Code
HTTP response for
/_all_docs/queries
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example AllDocsQueriesResult response.
{ "results": [ { "offset": 0, "rows": [ { "id": "exampleid", "key": "exampleid", "value": { "rev": "1-5005d65514fe9e90f8eccf174af5dd64" } }, { "id": "exampleid2", "key": "exampleid2", "value": { "rev": "1-2d7810b054babeda4812b3924428d6d6" } } ], "total_rows": 5 }, { "offset": 2, "rows": [ { "id": "exampleid3", "key": "exampleid3", "value": { "rev": "1-5005d65514fe9e90f8eccf174af5dd64" } }, { "id": "exampleid4", "key": "exampleid4", "value": { "rev": "1-2d7810b054babeda4812b3924428d6d6" } } ], "total_rows": 5 } ] }
Example AllDocsQueriesResult response.
{ "results": [ { "offset": 0, "rows": [ { "id": "exampleid", "key": "exampleid", "value": { "rev": "1-5005d65514fe9e90f8eccf174af5dd64" } }, { "id": "exampleid2", "key": "exampleid2", "value": { "rev": "1-2d7810b054babeda4812b3924428d6d6" } } ], "total_rows": 5 }, { "offset": 2, "rows": [ { "id": "exampleid3", "key": "exampleid3", "value": { "rev": "1-5005d65514fe9e90f8eccf174af5dd64" } }, { "id": "exampleid4", "key": "exampleid4", "value": { "rev": "1-2d7810b054babeda4812b3924428d6d6" } } ], "total_rows": 5 } ] }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Query a MapReduce view (GET)
This operation queries the specified MapReduce view of the specified design document. By default, the map and reduce functions of the view are run to update the view before returning the response.
GET /{db}/_design/{ddoc}/_view/{view}
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Path parameter to specify the map reduce view function name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[a-z][a-z0-9_$()+/-]*$
Query Parameters
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Query parameter to specify whether to return the documents in descending by key order.
Default:
false
Query parameter to specify to stop returning records when the specified key is reached. String representation of any JSON type that matches the key type emitted by the view function.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query parameter to specify to stop returning records when the specified document ID is reached.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].*$
Query parameter to specify whether to group reduced results by key. Valid only if a reduce function is defined in the view. If the view emits keys in JSON array format, then it is possible to reduce groups further based on the number of array elements with the
group_level
parameter.Default:
false
Query parameter to specify a group level to be used. Only applicable if the view uses keys that are JSON arrays. Implies group is
true
. Group level groups the reduced results by the specified number of array elements. If unset, results are grouped by the entire array key, returning a reduced value for each complete key.Possible values: 1 ≤ value ≤ 4294967295
Query parameter to specify whether to include the full content of the documents in the response.
Default:
false
Query parameter to specify whether the specified end key should be included in the result.
Default:
true
Query parameter to specify to return only documents that match the specified key. String representation of any JSON type that matches the key type emitted by the view function.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query parameter to specify returning only documents that match any of the specified keys. String representation of a JSON array of keys that match the key type emitted by the view function. Must be URL encoded.
Possible values: 2 ≤ length ≤ 7168, Value must match regular expression
^\[(".*")*\]$
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined.
Default:
true
Query parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Query parameter to specify whether to sort the returned rows. Setting this to false offers a performance boost. The total_rows and offset fields are not available when this is set to false.
Default:
true
Query parameter to specify whether use the same replica of the index on each request. The default value
false
contacts all replicas and returns the result from the first, fastest, responder. Setting it totrue
when used in conjunction withupdate=false
may improve consistency at the expense of increased latency and decreased throughput, if the selected replica is not the fastest of the available replicas.Note: In general setting
true
is discouraged and is strictly not recommended when usingupdate=true
.Default:
false
Note:
stale
is deprecated, usestable
andupdate
instead.Query parameter to specify whether to allow the results from a stale view to be used, without triggering a rebuild of all views within the encompassing design doc.
ok
is equivalent tostable=true&update=false
update_after
is equivalent tostable=true&update=lazy
For more details on the use cases of
stale
,update
, andstable
parameters, see this blog post.Allowable values: [
ok
,update_after
]Query parameter to specify to start returning records from the specified key. String representation of any JSON type that matches the key type emitted by the view function.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query parameter to specify to start returning records from the specified document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].*$
Query parameter to specify whether or not the view in question should be updated prior to responding to the user.
true
- Return results after the view is updated.false
- Return results without updating the view.lazy
- Return the view results without waiting for an update, but update them immediately after the request.
Allowable values: [
true
,false
,lazy
]Default:
true
Query parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/users/_design/allusers/_view/getVerifiedEmails?limit=10"
This example requires the
getVerifiedEmails
view to exist. To create the design document with this view, see Create or modify a design document.
Response
Schema for the result of a query view operation.
rows
Possible values: 0 ≤ number of items ≤ 4294967295
Offset where the list started.
Possible values: 0 ≤ value ≤ 9007199254740992
Total number of rows in the view index. Note that if the request query narrows the view this is not the number of matching rows. The number of matching rows, up to the specified
limit
, is the size of therows
array.Possible values: 0 ≤ value ≤ 4294967295
Current update sequence for the database
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Status Code
HTTP response for view operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example ViewResult response.
{ "offset": 0, "rows": [ { "id": "abc125", "key": "amelie.smith@aol.com", "value": [ "Amelie Smith", true, "2020-04-24T10:42:59.000Z" ] }, { "id": "abc123", "key": "bob.smith@aol.com", "value": [ "Bob Smith", true, "2019-01-24T10:42:59.000Z" ] } ], "total_rows": 2 }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve HTTP headers for a MapReduce view (GET) query
Retrieves the HTTP headers for a MapReduce view (GET) query.
HEAD /{db}/_design/{ddoc}/_view/{view}
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Path parameter to specify the map reduce view function name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[a-z][a-z0-9_$()+/-]*$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for view operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Query a MapReduce view
This operation queries the specified MapReduce view of the specified design document. By default, the map and reduce functions of the view are run to update the view before returning the response. The advantage of using the HTTP POST
method is that the query is submitted as a JSON object in the request body. This avoids the limitations of passing query options as URL query parameters of a GET
request.
This operation queries the specified MapReduce view of the specified design document. By default, the map and reduce functions of the view are run to update the view before returning the response. The advantage of using the HTTP POST
method is that the query is submitted as a JSON object in the request body. This avoids the limitations of passing query options as URL query parameters of a GET
request.
This operation queries the specified MapReduce view of the specified design document. By default, the map and reduce functions of the view are run to update the view before returning the response. The advantage of using the HTTP POST
method is that the query is submitted as a JSON object in the request body. This avoids the limitations of passing query options as URL query parameters of a GET
request.
This operation queries the specified MapReduce view of the specified design document. By default, the map and reduce functions of the view are run to update the view before returning the response. The advantage of using the HTTP POST
method is that the query is submitted as a JSON object in the request body. This avoids the limitations of passing query options as URL query parameters of a GET
request.
This operation queries the specified MapReduce view of the specified design document. By default, the map and reduce functions of the view are run to update the view before returning the response. The advantage of using the HTTP POST
method is that the query is submitted as a JSON object in the request body. This avoids the limitations of passing query options as URL query parameters of a GET
request.
POST /{db}/_design/{ddoc}/_view/{view}
(cloudant *CloudantV1) PostView(postViewOptions *PostViewOptions) (result *ViewResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostViewWithContext(ctx context.Context, postViewOptions *PostViewOptions) (result *ViewResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostViewAsStream(postViewOptions *PostViewOptions) (result io.ReadCloser, response *core.DetailedResponse, err error)
ServiceCall<ViewResult> postView(PostViewOptions postViewOptions)
ServiceCall<InputStream> postViewAsStream(PostViewOptions postViewOptions)
postView(params)
postViewAsStream(params)
post_view(
self,
db: str,
ddoc: str,
view: str,
*,
att_encoding_info: Optional[bool] = None,
attachments: Optional[bool] = None,
conflicts: Optional[bool] = None,
descending: Optional[bool] = None,
include_docs: Optional[bool] = None,
inclusive_end: Optional[bool] = None,
limit: Optional[int] = None,
skip: Optional[int] = None,
update_seq: Optional[bool] = None,
end_key: Optional[object] = None,
end_key_doc_id: Optional[str] = None,
group: Optional[bool] = None,
group_level: Optional[int] = None,
key: Optional[object] = None,
keys: Optional[List[object]] = None,
reduce: Optional[bool] = None,
stable: Optional[bool] = None,
start_key: Optional[object] = None,
start_key_doc_id: Optional[str] = None,
update: Optional[str] = None,
**kwargs,
) -> DetailedResponse
post_view_as_stream(
self,
db: str,
ddoc: str,
view: str,
*,
att_encoding_info: Optional[bool] = None,
attachments: Optional[bool] = None,
conflicts: Optional[bool] = None,
descending: Optional[bool] = None,
include_docs: Optional[bool] = None,
inclusive_end: Optional[bool] = None,
limit: Optional[int] = None,
skip: Optional[int] = None,
update_seq: Optional[bool] = None,
end_key: Optional[object] = None,
end_key_doc_id: Optional[str] = None,
group: Optional[bool] = None,
group_level: Optional[int] = None,
key: Optional[object] = None,
keys: Optional[List[object]] = None,
reduce: Optional[bool] = None,
stable: Optional[bool] = None,
start_key: Optional[object] = None,
start_key_doc_id: Optional[str] = None,
update: Optional[str] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the PostViewOptions
struct and set the fields to provide parameter values for the PostView
method.
Use the PostViewOptions.Builder
to create a PostViewOptions
object that contains the parameter values for the postView
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Path parameter to specify the map reduce view function name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[a-z][a-z0-9_$()+/-]*$
HTTP request body for postView and postPartitionView.
Example ViewQuery request.
{
"include_docs": true,
"keys": [
"examplekey"
],
"limit": 10
}
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Query parameter to specify whether to sort the returned rows. Setting this to false offers a performance boost. The total_rows and offset fields are not available when this is set to false.
Default:
true
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for any JSON type
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Parameter to specify whether to group reduced results by key. Valid only if a reduce function defined in the view. If the view emits key in JSON array format, then it is possible to reduce groups further based on the number of array elements with the
group_level
parameter.Default:
false
Parameter to specify a group level to be used. Only applicable if the view uses keys that are JSON arrays. Implies group is
true
. Group level groups the reduced results by the specified number of array elements. If unset, results are grouped by the entire array key, returning a reduced value for each complete key.Possible values: 1 ≤ value ≤ 4294967295
Schema for any JSON type
Parameter to specify returning only documents that match any of the specified keys. A JSON array of keys that match the key type emitted by the view function.
Possible values: 0 ≤ number of items ≤ 65535
Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined.
A default
reduce
view type can be disabled to behave like amap
by settingreduce=false
explicitly.Be aware that
include_docs=true
can only be used withmap
views.Default:
true
Query parameter to specify whether use the same replica of the index on each request. The default value
false
contacts all replicas and returns the result from the first, fastest, responder. Setting it totrue
when used in conjunction withupdate=false
may improve consistency at the expense of increased latency and decreased throughput if the selected replica is not the fastest of the available replicas.Note: In general setting
true
is discouraged and is strictly not recommended when usingupdate=true
.Default:
false
Schema for any JSON type
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Parameter to specify whether or not the view in question should be updated prior to responding to the user.
true
- Return results after the view is updated.false
- Return results without updating the view.lazy
- Return the view results without waiting for an update, but update them immediately after the request.
Allowable values: [
true
,false
,lazy
]Default:
true
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The PostView options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the map reduce view function name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[a-z][a-z0-9_$()+\/-]*$/
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Examples:true
Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Examples:10
Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for any JSON type.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Parameter to specify whether to group reduced results by key. Valid only if a reduce function defined in the view. If the view emits key in JSON array format, then it is possible to reduce groups further based on the number of array elements with the
group_level
parameter.Default:
false
Parameter to specify a group level to be used. Only applicable if the view uses keys that are JSON arrays. Implies group is
true
. Group level groups the reduced results by the specified number of array elements. If unset, results are grouped by the entire array key, returning a reduced value for each complete key.Possible values: 1 ≤ value ≤ 4294967295
Schema for any JSON type.
Parameter to specify returning only documents that match any of the specified keys. A JSON array of keys that match the key type emitted by the view function.
Possible values: 0 ≤ number of items ≤ 65535
Examples:[ "examplekey" ]
Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined.
A default
reduce
view type can be disabled to behave like amap
by settingreduce=false
explicitly.Be aware that
include_docs=true
can only be used withmap
views.Default:
true
Query parameter to specify whether use the same replica of the index on each request. The default value
false
contacts all replicas and returns the result from the first, fastest, responder. Setting it totrue
when used in conjunction withupdate=false
may improve consistency at the expense of increased latency and decreased throughput if the selected replica is not the fastest of the available replicas.Note: In general setting
true
is discouraged and is strictly not recommended when usingupdate=true
.Default:
false
Schema for any JSON type.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Parameter to specify whether or not the view in question should be updated prior to responding to the user.
true
- Return results after the view is updated.false
- Return results without updating the view.lazy
- Return the view results without waiting for an update, but update them immediately after the request.
Allowable values: [
true
,false
,lazy
]Default:
true
The postView options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the map reduce view function name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[a-z][a-z0-9_$()+\/-]*$/
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Examples:true
Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Examples:10
Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for any JSON type.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Parameter to specify whether to group reduced results by key. Valid only if a reduce function defined in the view. If the view emits key in JSON array format, then it is possible to reduce groups further based on the number of array elements with the
group_level
parameter.Default:
false
Parameter to specify a group level to be used. Only applicable if the view uses keys that are JSON arrays. Implies group is
true
. Group level groups the reduced results by the specified number of array elements. If unset, results are grouped by the entire array key, returning a reduced value for each complete key.Possible values: 1 ≤ value ≤ 4294967295
Schema for any JSON type.
Parameter to specify returning only documents that match any of the specified keys. A JSON array of keys that match the key type emitted by the view function.
Possible values: 0 ≤ number of items ≤ 65535
Examples:[ "examplekey" ]
Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined.
A default
reduce
view type can be disabled to behave like amap
by settingreduce=false
explicitly.Be aware that
include_docs=true
can only be used withmap
views.Default:
true
Query parameter to specify whether use the same replica of the index on each request. The default value
false
contacts all replicas and returns the result from the first, fastest, responder. Setting it totrue
when used in conjunction withupdate=false
may improve consistency at the expense of increased latency and decreased throughput if the selected replica is not the fastest of the available replicas.Note: In general setting
true
is discouraged and is strictly not recommended when usingupdate=true
.Default:
false
Schema for any JSON type.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Parameter to specify whether or not the view in question should be updated prior to responding to the user.
true
- Return results after the view is updated.false
- Return results without updating the view.lazy
- Return the view results without waiting for an update, but update them immediately after the request.
Allowable values: [
true
,false
,lazy
]Default:
true
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the map reduce view function name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[a-z][a-z0-9_$()+\/-]*$/
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Examples:Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Examples:Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for any JSON type.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Parameter to specify whether to group reduced results by key. Valid only if a reduce function defined in the view. If the view emits key in JSON array format, then it is possible to reduce groups further based on the number of array elements with the
group_level
parameter.Default:
false
Parameter to specify a group level to be used. Only applicable if the view uses keys that are JSON arrays. Implies group is
true
. Group level groups the reduced results by the specified number of array elements. If unset, results are grouped by the entire array key, returning a reduced value for each complete key.Possible values: 1 ≤ value ≤ 4294967295
Schema for any JSON type.
Parameter to specify returning only documents that match any of the specified keys. A JSON array of keys that match the key type emitted by the view function.
Possible values: 0 ≤ number of items ≤ 65535
Examples:Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined.
A default
reduce
view type can be disabled to behave like amap
by settingreduce=false
explicitly.Be aware that
include_docs=true
can only be used withmap
views.Default:
true
Query parameter to specify whether use the same replica of the index on each request. The default value
false
contacts all replicas and returns the result from the first, fastest, responder. Setting it totrue
when used in conjunction withupdate=false
may improve consistency at the expense of increased latency and decreased throughput if the selected replica is not the fastest of the available replicas.Note: In general setting
true
is discouraged and is strictly not recommended when usingupdate=true
.Default:
false
Schema for any JSON type.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Parameter to specify whether or not the view in question should be updated prior to responding to the user.
true
- Return results after the view is updated.false
- Return results without updating the view.lazy
- Return the view results without waiting for an update, but update them immediately after the request.
Allowable values: [
true
,false
,lazy
]Default:
true
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the map reduce view function name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[a-z][a-z0-9_$()+\/-]*$/
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Examples:Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Examples:Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for any JSON type.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Parameter to specify whether to group reduced results by key. Valid only if a reduce function defined in the view. If the view emits key in JSON array format, then it is possible to reduce groups further based on the number of array elements with the
group_level
parameter.Default:
false
Parameter to specify a group level to be used. Only applicable if the view uses keys that are JSON arrays. Implies group is
true
. Group level groups the reduced results by the specified number of array elements. If unset, results are grouped by the entire array key, returning a reduced value for each complete key.Possible values: 1 ≤ value ≤ 4294967295
Schema for any JSON type.
Parameter to specify returning only documents that match any of the specified keys. A JSON array of keys that match the key type emitted by the view function.
Possible values: 0 ≤ number of items ≤ 65535
Examples:Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined.
A default
reduce
view type can be disabled to behave like amap
by settingreduce=false
explicitly.Be aware that
include_docs=true
can only be used withmap
views.Default:
true
Query parameter to specify whether use the same replica of the index on each request. The default value
false
contacts all replicas and returns the result from the first, fastest, responder. Setting it totrue
when used in conjunction withupdate=false
may improve consistency at the expense of increased latency and decreased throughput if the selected replica is not the fastest of the available replicas.Note: In general setting
true
is discouraged and is strictly not recommended when usingupdate=true
.Default:
false
Schema for any JSON type.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Parameter to specify whether or not the view in question should be updated prior to responding to the user.
true
- Return results after the view is updated.false
- Return results without updating the view.lazy
- Return the view results without waiting for an update, but update them immediately after the request.
Allowable values: [
true
,false
,lazy
]Default:
true
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X POST "$SERVICE_URL/users/_design/allusers/_view/getVerifiedEmails" -H "Content-Type: application/json" --data '{ "limit": 10 }'
This example requires the
getVerifiedEmails
view to exist. To create the design document with this view, see Create or modify a design document.
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } postViewOptions := service.NewPostViewOptions( "users", "allusers", "getVerifiedEmails", ) viewResult, response, err := service.PostView(postViewOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(viewResult, "", " ") fmt.Println(string(b))
This example requires the
getVerifiedEmails
view to exist. To create the design document with this view, see Create or modify a design document.
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.PostViewOptions; import com.ibm.cloud.cloudant.v1.model.ViewResult;
Cloudant service = Cloudant.newInstance(); PostViewOptions viewOptions = new PostViewOptions.Builder() .db("users") .ddoc("allusers") .view("getVerifiedEmails") .build(); ViewResult response = service.postView(viewOptions).execute() .getResult(); System.out.println(response);
This example requires the
getVerifiedEmails
view to exist. To create the design document with this view, see Create or modify a design document.
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.postView({ db: 'users', ddoc: 'allusers', view: 'getVerifiedEmails' }).then(response => { console.log(response.result); });
This example requires the
getVerifiedEmails
view to exist. To create the design document with this view, see Create or modify a design document.
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.post_view( db='users', ddoc='allusers', view='getVerifiedEmails' ).get_result() print(response)
This example requires the
getVerifiedEmails
view to exist. To create the design document with this view, see Create or modify a design document.
Response
Response type for PostView
: ViewResult
Response type for PostViewAsStream
: io.ReadCloser
Response type for postView
: ViewResult
Response type for postViewAsStream
: InputStream
Response type for postView
: ViewResult
Response type for postViewAsStream
: NodeJS.ReadableStream
Response type for post_view
: ViewResult
Response type for post_view_as_stream
: BinaryIO
Schema for the result of a query view operation.
rows
Possible values: 0 ≤ number of items ≤ 4294967295
Offset where the list started.
Possible values: 0 ≤ value ≤ 9007199254740992
Total number of rows in the view index. Note that if the request query narrows the view this is not the number of matching rows. The number of matching rows, up to the specified
limit
, is the size of therows
array.Possible values: 0 ≤ value ≤ 4294967295
Current update sequence for the database
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Schema for the result of a query view operation.
Total number of rows in the view index. Note that if the request query narrows the view this is not the number of matching rows. The number of matching rows, up to the specified
limit
, is the size of therows
array.Possible values: 0 ≤ value ≤ 4294967295
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
rows.
Possible values: number of items ≥ 0
- Rows
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a document.
- Doc
Schema for a map of attachment name to attachment metadata.
- Attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- Revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- RevsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for any JSON type.
Schema for any JSON type.
Schema for the result of a query view operation.
Total number of rows in the view index. Note that if the request query narrows the view this is not the number of matching rows. The number of matching rows, up to the specified
limit
, is the size of therows
array.Possible values: 0 ≤ value ≤ 4294967295
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
rows.
Possible values: number of items ≥ 0
- rows
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- revsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for any JSON type.
Schema for any JSON type.
Schema for the result of a query view operation.
Total number of rows in the view index. Note that if the request query narrows the view this is not the number of matching rows. The number of matching rows, up to the specified
limit
, is the size of therows
array.Possible values: 0 ≤ value ≤ 4294967295
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
rows.
Possible values: number of items ≥ 0
- rows
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for any JSON type.
Schema for any JSON type.
Schema for the result of a query view operation.
Total number of rows in the view index. Note that if the request query narrows the view this is not the number of matching rows. The number of matching rows, up to the specified
limit
, is the size of therows
array.Possible values: 0 ≤ value ≤ 4294967295
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
rows.
Possible values: number of items ≥ 0
- rows
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for any JSON type.
Schema for any JSON type.
Status Code
HTTP response for view operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example ViewResult response.
{ "offset": 0, "rows": [ { "id": "abc125", "key": "amelie.smith@aol.com", "value": [ "Amelie Smith", true, "2020-04-24T10:42:59.000Z" ] }, { "id": "abc123", "key": "bob.smith@aol.com", "value": [ "Bob Smith", true, "2019-01-24T10:42:59.000Z" ] } ], "total_rows": 2 }
Example ViewResult response.
{ "offset": 0, "rows": [ { "id": "abc125", "key": "amelie.smith@aol.com", "value": [ "Amelie Smith", true, "2020-04-24T10:42:59.000Z" ] }, { "id": "abc123", "key": "bob.smith@aol.com", "value": [ "Bob Smith", true, "2019-01-24T10:42:59.000Z" ] } ], "total_rows": 2 }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Multi-query a MapReduce view
This operation runs multiple specified view queries against the view function from the specified design document.
This operation runs multiple specified view queries against the view function from the specified design document.
This operation runs multiple specified view queries against the view function from the specified design document.
This operation runs multiple specified view queries against the view function from the specified design document.
This operation runs multiple specified view queries against the view function from the specified design document.
POST /{db}/_design/{ddoc}/_view/{view}/queries
(cloudant *CloudantV1) PostViewQueries(postViewQueriesOptions *PostViewQueriesOptions) (result *ViewQueriesResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostViewQueriesWithContext(ctx context.Context, postViewQueriesOptions *PostViewQueriesOptions) (result *ViewQueriesResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostViewQueriesAsStream(postViewQueriesOptions *PostViewQueriesOptions) (result io.ReadCloser, response *core.DetailedResponse, err error)
ServiceCall<ViewQueriesResult> postViewQueries(PostViewQueriesOptions postViewQueriesOptions)
ServiceCall<InputStream> postViewQueriesAsStream(PostViewQueriesOptions postViewQueriesOptions)
postViewQueries(params)
postViewQueriesAsStream(params)
post_view_queries(
self,
db: str,
ddoc: str,
view: str,
queries: List['ViewQuery'],
**kwargs,
) -> DetailedResponse
post_view_queries_as_stream(
self,
db: str,
ddoc: str,
view: str,
queries: List['ViewQuery'],
**kwargs,
) -> DetailedResponse
Request
Instantiate the PostViewQueriesOptions
struct and set the fields to provide parameter values for the PostViewQueries
method.
Use the PostViewQueriesOptions.Builder
to create a PostViewQueriesOptions
object that contains the parameter values for the postViewQueries
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Path parameter to specify the map reduce view function name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[a-z][a-z0-9_$()+/-]*$
HTTP request body for postViewQueries.
Example ViewQueriesQuery request.
{
"queries": [
{
"include_docs": true,
"limit": 5
},
{
"descending": true,
"skip": 1
}
]
}
An array of query objects with fields for the parameters of each individual view query to be executed. The field names and their meaning are the same as the query parameters of a regular view request.
Possible values: 0 ≤ number of items ≤ 65535
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The PostViewQueries options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the map reduce view function name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[a-z][a-z0-9_$()+\/-]*$/
An array of query objects with fields for the parameters of each individual view query to be executed. The field names and their meaning are the same as the query parameters of a regular view request.
Possible values: 0 ≤ number of items ≤ 65535
Examples:[ { "include_docs": true, "limit": 5 }, { "descending": true, "skip": 1 } ]
- Queries
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for any JSON type.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Parameter to specify whether to group reduced results by key. Valid only if a reduce function defined in the view. If the view emits key in JSON array format, then it is possible to reduce groups further based on the number of array elements with the
group_level
parameter.Default:
false
Parameter to specify a group level to be used. Only applicable if the view uses keys that are JSON arrays. Implies group is
true
. Group level groups the reduced results by the specified number of array elements. If unset, results are grouped by the entire array key, returning a reduced value for each complete key.Possible values: 1 ≤ value ≤ 4294967295
Schema for any JSON type.
Parameter to specify returning only documents that match any of the specified keys. A JSON array of keys that match the key type emitted by the view function.
Possible values: 0 ≤ number of items ≤ 65535
Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined.
A default
reduce
view type can be disabled to behave like amap
by settingreduce=false
explicitly.Be aware that
include_docs=true
can only be used withmap
views.Default:
true
Query parameter to specify whether use the same replica of the index on each request. The default value
false
contacts all replicas and returns the result from the first, fastest, responder. Setting it totrue
when used in conjunction withupdate=false
may improve consistency at the expense of increased latency and decreased throughput if the selected replica is not the fastest of the available replicas.Note: In general setting
true
is discouraged and is strictly not recommended when usingupdate=true
.Default:
false
Schema for any JSON type.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Parameter to specify whether or not the view in question should be updated prior to responding to the user.
true
- Return results after the view is updated.false
- Return results without updating the view.lazy
- Return the view results without waiting for an update, but update them immediately after the request.
Allowable values: [
true
,false
,lazy
]Default:
true
The postViewQueries options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the map reduce view function name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[a-z][a-z0-9_$()+\/-]*$/
An array of query objects with fields for the parameters of each individual view query to be executed. The field names and their meaning are the same as the query parameters of a regular view request.
Possible values: 0 ≤ number of items ≤ 65535
Examples:[ { "include_docs": true, "limit": 5 }, { "descending": true, "skip": 1 } ]
- queries
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for any JSON type.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Parameter to specify whether to group reduced results by key. Valid only if a reduce function defined in the view. If the view emits key in JSON array format, then it is possible to reduce groups further based on the number of array elements with the
group_level
parameter.Default:
false
Parameter to specify a group level to be used. Only applicable if the view uses keys that are JSON arrays. Implies group is
true
. Group level groups the reduced results by the specified number of array elements. If unset, results are grouped by the entire array key, returning a reduced value for each complete key.Possible values: 1 ≤ value ≤ 4294967295
Schema for any JSON type.
Parameter to specify returning only documents that match any of the specified keys. A JSON array of keys that match the key type emitted by the view function.
Possible values: 0 ≤ number of items ≤ 65535
Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined.
A default
reduce
view type can be disabled to behave like amap
by settingreduce=false
explicitly.Be aware that
include_docs=true
can only be used withmap
views.Default:
true
Query parameter to specify whether use the same replica of the index on each request. The default value
false
contacts all replicas and returns the result from the first, fastest, responder. Setting it totrue
when used in conjunction withupdate=false
may improve consistency at the expense of increased latency and decreased throughput if the selected replica is not the fastest of the available replicas.Note: In general setting
true
is discouraged and is strictly not recommended when usingupdate=true
.Default:
false
Schema for any JSON type.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Parameter to specify whether or not the view in question should be updated prior to responding to the user.
true
- Return results after the view is updated.false
- Return results without updating the view.lazy
- Return the view results without waiting for an update, but update them immediately after the request.
Allowable values: [
true
,false
,lazy
]Default:
true
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the map reduce view function name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[a-z][a-z0-9_$()+\/-]*$/
An array of query objects with fields for the parameters of each individual view query to be executed. The field names and their meaning are the same as the query parameters of a regular view request.
Possible values: 0 ≤ number of items ≤ 65535
Examples:- queries
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for any JSON type.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Parameter to specify whether to group reduced results by key. Valid only if a reduce function defined in the view. If the view emits key in JSON array format, then it is possible to reduce groups further based on the number of array elements with the
group_level
parameter.Default:
false
Parameter to specify a group level to be used. Only applicable if the view uses keys that are JSON arrays. Implies group is
true
. Group level groups the reduced results by the specified number of array elements. If unset, results are grouped by the entire array key, returning a reduced value for each complete key.Possible values: 1 ≤ value ≤ 4294967295
Schema for any JSON type.
Parameter to specify returning only documents that match any of the specified keys. A JSON array of keys that match the key type emitted by the view function.
Possible values: 0 ≤ number of items ≤ 65535
Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined.
A default
reduce
view type can be disabled to behave like amap
by settingreduce=false
explicitly.Be aware that
include_docs=true
can only be used withmap
views.Default:
true
Query parameter to specify whether use the same replica of the index on each request. The default value
false
contacts all replicas and returns the result from the first, fastest, responder. Setting it totrue
when used in conjunction withupdate=false
may improve consistency at the expense of increased latency and decreased throughput if the selected replica is not the fastest of the available replicas.Note: In general setting
true
is discouraged and is strictly not recommended when usingupdate=true
.Default:
false
Schema for any JSON type.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Parameter to specify whether or not the view in question should be updated prior to responding to the user.
true
- Return results after the view is updated.false
- Return results without updating the view.lazy
- Return the view results without waiting for an update, but update them immediately after the request.
Allowable values: [
true
,false
,lazy
]Default:
true
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the map reduce view function name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[a-z][a-z0-9_$()+\/-]*$/
An array of query objects with fields for the parameters of each individual view query to be executed. The field names and their meaning are the same as the query parameters of a regular view request.
Possible values: 0 ≤ number of items ≤ 65535
Examples:- queries
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for any JSON type.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Parameter to specify whether to group reduced results by key. Valid only if a reduce function defined in the view. If the view emits key in JSON array format, then it is possible to reduce groups further based on the number of array elements with the
group_level
parameter.Default:
false
Parameter to specify a group level to be used. Only applicable if the view uses keys that are JSON arrays. Implies group is
true
. Group level groups the reduced results by the specified number of array elements. If unset, results are grouped by the entire array key, returning a reduced value for each complete key.Possible values: 1 ≤ value ≤ 4294967295
Schema for any JSON type.
Parameter to specify returning only documents that match any of the specified keys. A JSON array of keys that match the key type emitted by the view function.
Possible values: 0 ≤ number of items ≤ 65535
Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined.
A default
reduce
view type can be disabled to behave like amap
by settingreduce=false
explicitly.Be aware that
include_docs=true
can only be used withmap
views.Default:
true
Query parameter to specify whether use the same replica of the index on each request. The default value
false
contacts all replicas and returns the result from the first, fastest, responder. Setting it totrue
when used in conjunction withupdate=false
may improve consistency at the expense of increased latency and decreased throughput if the selected replica is not the fastest of the available replicas.Note: In general setting
true
is discouraged and is strictly not recommended when usingupdate=true
.Default:
false
Schema for any JSON type.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Parameter to specify whether or not the view in question should be updated prior to responding to the user.
true
- Return results after the view is updated.false
- Return results without updating the view.lazy
- Return the view results without waiting for an update, but update them immediately after the request.
Allowable values: [
true
,false
,lazy
]Default:
true
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X POST "$SERVICE_URL/users/_design/allusers/_view/getVerifiedEmails/queries" -H "Content-Type: application/json" --data '{ "queries": [ { "include_docs": true, "limit": 5 }, { "descending": true, "skip": 1 } ] }'
This example requires the
getVerifiedEmails
view to exist. To create the design document with this view, see Create or modify a design document.
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" "github.com/IBM/go-sdk-core/v5/core" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } postViewQueriesOptions := service.NewPostViewQueriesOptions( "users", "allusers", "getVerifiedEmails", []cloudantv1.ViewQuery{ { IncludeDocs: core.BoolPtr(true), Limit: core.Int64Ptr(5), }, { Descending: core.BoolPtr(true), Skip: core.Int64Ptr(1), }, }, ) viewQueriesResult, response, err := service.PostViewQueries(postViewQueriesOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(viewQueriesResult, "", " ") fmt.Println(string(b))
This example requires the
getVerifiedEmails
view to exist. To create the design document with this view, see Create or modify a design document.
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.PostViewQueriesOptions; import com.ibm.cloud.cloudant.v1.model.ViewQueriesResult; import com.ibm.cloud.cloudant.v1.model.ViewQuery; import java.util.Arrays;
Cloudant service = Cloudant.newInstance(); ViewQuery query1 = new ViewQuery.Builder() .includeDocs(true) .limit(5) .build(); ViewQuery query2 = new ViewQuery.Builder() .descending(true) .skip(1) .build(); PostViewQueriesOptions queriesOptions = new PostViewQueriesOptions.Builder() .db("users") .ddoc("allusers") .queries(Arrays.asList(query1, query2)) .view("getVerifiedEmails") .build(); ViewQueriesResult response = service.postViewQueries(queriesOptions).execute() .getResult(); System.out.println(response);
This example requires the
getVerifiedEmails
view to exist. To create the design document with this view, see Create or modify a design document.
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); const viewQueries: CloudantV1.ViewQuery[] = [ { includeDocs: true, limit: 5 }, { descending: true, skip: 1 } ]; service.postViewQueries({ db: 'users', ddoc: 'allusers', queries: viewQueries, view: 'getVerifiedEmails' }).then(response => { console.log(response.result); });
This example requires the
getVerifiedEmails
view to exist. To create the design document with this view, see Create or modify a design document.
from ibmcloudant.cloudant_v1 import CloudantV1, ViewQuery service = CloudantV1.new_instance() query1 = ViewQuery( include_docs=True, limit=5 ) query2 = ViewQuery( descending=True, skip=1 ) response = service.post_view_queries( db='users', ddoc='allusers', queries=[query1, query2], view='getVerifiedEmails' ).get_result() print(response)
This example requires the
getVerifiedEmails
view to exist. To create the design document with this view, see Create or modify a design document.
Response
Response type for PostViewQueries
: ViewQueriesResult
Response type for PostViewQueriesAsStream
: io.ReadCloser
Response type for postViewQueries
: ViewQueriesResult
Response type for postViewQueriesAsStream
: InputStream
Response type for postViewQueries
: ViewQueriesResult
Response type for postViewQueriesAsStream
: NodeJS.ReadableStream
Response type for post_view_queries
: ViewQueriesResult
Response type for post_view_queries_as_stream
: BinaryIO
Schema for the results of a queries view operation.
An array of result objects - one for each query. Each result object contains the same fields as the response to a regular view request.
Possible values: 0 ≤ number of items ≤ 65535
Schema for the results of a queries view operation.
An array of result objects - one for each query. Each result object contains the same fields as the response to a regular view request.
Possible values: 0 ≤ number of items ≤ 65535
- Results
Total number of rows in the view index. Note that if the request query narrows the view this is not the number of matching rows. The number of matching rows, up to the specified
limit
, is the size of therows
array.Possible values: 0 ≤ value ≤ 4294967295
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
rows.
Possible values: number of items ≥ 0
- Rows
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a document.
- Doc
Schema for a map of attachment name to attachment metadata.
- Attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- Revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- RevsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for any JSON type.
Schema for any JSON type.
Schema for the results of a queries view operation.
An array of result objects - one for each query. Each result object contains the same fields as the response to a regular view request.
Possible values: 0 ≤ number of items ≤ 65535
- results
Total number of rows in the view index. Note that if the request query narrows the view this is not the number of matching rows. The number of matching rows, up to the specified
limit
, is the size of therows
array.Possible values: 0 ≤ value ≤ 4294967295
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
rows.
Possible values: number of items ≥ 0
- rows
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- revsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for any JSON type.
Schema for any JSON type.
Schema for the results of a queries view operation.
An array of result objects - one for each query. Each result object contains the same fields as the response to a regular view request.
Possible values: 0 ≤ number of items ≤ 65535
- results
Total number of rows in the view index. Note that if the request query narrows the view this is not the number of matching rows. The number of matching rows, up to the specified
limit
, is the size of therows
array.Possible values: 0 ≤ value ≤ 4294967295
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
rows.
Possible values: number of items ≥ 0
- rows
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for any JSON type.
Schema for any JSON type.
Schema for the results of a queries view operation.
An array of result objects - one for each query. Each result object contains the same fields as the response to a regular view request.
Possible values: 0 ≤ number of items ≤ 65535
- results
Total number of rows in the view index. Note that if the request query narrows the view this is not the number of matching rows. The number of matching rows, up to the specified
limit
, is the size of therows
array.Possible values: 0 ≤ value ≤ 4294967295
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
rows.
Possible values: number of items ≥ 0
- rows
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for any JSON type.
Schema for any JSON type.
Status Code
HTTP response for postViewQueries.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example ViewQueriesResult response.
{ "results": [ { "offset": 0, "rows": [ { "id": "abc125", "key": "amelie.smith@aol.com", "value": [ "Amelie Smith", true, "2020-04-24T10:42:59.000Z" ] }, { "id": "abc123", "key": "bob.smith@aol.com", "value": [ "Bob Smith", true, "2019-01-24T10:42:59.000Z" ] } ], "total_rows": 2 }, { "offset": 1, "rows": [ { "id": "abc125", "key": "amelie.smith@aol.com", "value": [ "Amelie Smith", true, "2020-04-24T10:42:59.000Z" ] } ], "total_rows": 2 } ] }
Example ViewQueriesResult response.
{ "results": [ { "offset": 0, "rows": [ { "id": "abc125", "key": "amelie.smith@aol.com", "value": [ "Amelie Smith", true, "2020-04-24T10:42:59.000Z" ] }, { "id": "abc123", "key": "bob.smith@aol.com", "value": [ "Bob Smith", true, "2019-01-24T10:42:59.000Z" ] } ], "total_rows": 2 }, { "offset": 1, "rows": [ { "id": "abc125", "key": "amelie.smith@aol.com", "value": [ "Amelie Smith", true, "2020-04-24T10:42:59.000Z" ] } ], "total_rows": 2 } ] }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a missing view.
{ "error": "not_found", "reason": "missing_named_view" }
Example error response for a missing view.
{ "error": "not_found", "reason": "missing_named_view" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Query a database partition MapReduce view function (GET)
This operation queries the specified MapReduce view of the specified design document. By default, the map and reduce functions of the view are run to update the view before returning the response.
GET /{db}/_partition/{partition_key}/_design/{ddoc}/_view/{view}
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_:][^:]*$
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Path parameter to specify the map reduce view function name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[a-z][a-z0-9_$()+/-]*$
Query Parameters
Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Query parameter to specify whether to return the documents in descending by key order.
Default:
false
Query parameter to specify to stop returning records when the specified key is reached. String representation of any JSON type that matches the key type emitted by the view function.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query parameter to specify to stop returning records when the specified document ID is reached.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].*$
Query parameter to specify whether to group reduced results by key. Valid only if a reduce function is defined in the view. If the view emits keys in JSON array format, then it is possible to reduce groups further based on the number of array elements with the
group_level
parameter.Default:
false
Query parameter to specify a group level to be used. Only applicable if the view uses keys that are JSON arrays. Implies group is
true
. Group level groups the reduced results by the specified number of array elements. If unset, results are grouped by the entire array key, returning a reduced value for each complete key.Possible values: 1 ≤ value ≤ 4294967295
Query parameter to specify whether to include the full content of the documents in the response.
Default:
false
Query parameter to specify whether the specified end key should be included in the result.
Default:
true
Query parameter to specify to return only documents that match the specified key. String representation of any JSON type that matches the key type emitted by the view function.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query parameter to specify returning only documents that match any of the specified keys. String representation of a JSON array of keys that match the key type emitted by the view function. Must be URL encoded.
Possible values: 2 ≤ length ≤ 7168, Value must match regular expression
^\[(".*")*\]$
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined.
Default:
true
Query parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Query parameter to specify whether to sort the returned rows. Setting this to false offers a performance boost. The total_rows and offset fields are not available when this is set to false.
Default:
true
Query parameter to specify to start returning records from the specified key. String representation of any JSON type that matches the key type emitted by the view function.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query parameter to specify to start returning records from the specified document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].*$
Query parameter to specify whether or not the view in question should be updated prior to responding to the user.
true
- Return results after the view is updated.false
- Return results without updating the view.lazy
- Return the view results without waiting for an update, but update them immediately after the request.
Allowable values: [
true
,false
,lazy
]Default:
true
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/products/_partition/small-appliances/_design/appliances/_view/byApplianceProdId?include_docs=true&limit=10"
This example requires the
byApplianceProdId
partitioned view to exist. To create the view, see Create or modify a design document.
Response
Schema for the result of a query view operation.
rows
Possible values: 0 ≤ number of items ≤ 4294967295
Offset where the list started.
Possible values: 0 ≤ value ≤ 9007199254740992
Total number of rows in the view index. Note that if the request query narrows the view this is not the number of matching rows. The number of matching rows, up to the specified
limit
, is the size of therows
array.Possible values: 0 ≤ value ≤ 4294967295
Current update sequence for the database
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Status Code
HTTP response for view operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example ViewResult response for a database partition.
{ "offset": 0, "rows": [ { "id": "small-appliances:1000042", "key": "1000042", "value": [ "Foo", "Digital Kitchen Scales", "Slim Colourful Design Electronic Cooking Appliance for Home / Kitchen, Weigh up to 5kg + Aquatronic for Liquids ml + fl. oz. 15Yr Guarantee - Green" ] }, { "id": "small-appliances:1000043", "key": "1000043", "value": [ "Bar", "1100", "A professional, high powered innovative tool with a sleek design and outstanding performance" ] }, { "id": "small-appliances:1000044", "key": "1000044", "value": [ "Holstein", "Housewares Omelet Maker", "Easily make delicious and fluffy omelets without flipping - Innovative design - Cooking and cleaning is easy" ] } ], "total_rows": 3 }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve HTTP headers for a database partition MapReduce view function (GET)
Retrieves the HTTP headers for a database partition MapReduce view function (GET).
HEAD /{db}/_partition/{partition_key}/_design/{ddoc}/_view/{view}
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_:][^:]*$
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Path parameter to specify the map reduce view function name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[a-z][a-z0-9_$()+/-]*$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for view operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Retrieve information about which index is used for a query
Shows which index is being used by the query. Parameters are the same as the _find
endpoint.
Shows which index is being used by the query. Parameters are the same as the _find
endpoint.
Shows which index is being used by the query. Parameters are the same as the _find
endpoint.
Shows which index is being used by the query. Parameters are the same as the _find
endpoint.
Shows which index is being used by the query. Parameters are the same as the _find
endpoint.
POST /{db}/_explain
(cloudant *CloudantV1) PostExplain(postExplainOptions *PostExplainOptions) (result *ExplainResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostExplainWithContext(ctx context.Context, postExplainOptions *PostExplainOptions) (result *ExplainResult, response *core.DetailedResponse, err error)
ServiceCall<ExplainResult> postExplain(PostExplainOptions postExplainOptions)
postExplain(params)
post_explain(
self,
db: str,
selector: dict,
*,
allow_fallback: Optional[bool] = None,
bookmark: Optional[str] = None,
conflicts: Optional[bool] = None,
execution_stats: Optional[bool] = None,
fields: Optional[List[str]] = None,
limit: Optional[int] = None,
skip: Optional[int] = None,
sort: Optional[List[dict]] = None,
stable: Optional[bool] = None,
update: Optional[str] = None,
use_index: Optional[List[str]] = None,
r: Optional[int] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the PostExplainOptions
struct and set the fields to provide parameter values for the PostExplain
method.
Use the PostExplainOptions.Builder
to create a PostExplainOptions
object that contains the parameter values for the postExplain
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
HTTP request body for postFind and postExplain.
Example FindQuery request.
{
"fields": [
"_id",
"type",
"name",
"email"
],
"limit": 3,
"selector": {
"email_verified": {
"$eq": true
}
}
}
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate
the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax
- selector
Whether to allow fallback to other indexes. Default is true.
Default:
true
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
^[A-Za-z0-9=_-]*$
A boolean value that indicates whether or not to include information about existing conflicts in the document.
Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when
include_docs=true
is used), and total quorum document lookups (when each document replica is fetched).JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Maximum number of results returned. The
type: text
indexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25
Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740992
The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields.
For example in JSON:
[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]
When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields must use the same sort direction, either all ascending or all descending.
Possible values: 0 ≤ number of items ≤ 65535
- sort
Schema for sort direction.
Allowable values: [
asc
,desc
]Default:
asc
Whether or not the view results should be returned from a "stable" set of shards.
Whether to update the index prior to returning the result.
Allowable values: [
false
,true
,lazy
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Default:
true
Use this option to identify a specific index to answer the query, rather than letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id followed by index name, for example
["my_design_doc", "my_index"]
.It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later.
If the specified index doesn't exist or can't answer the query then the server ignores the value and answers using another index or a full scan of all documents. To change this behavior set
allow_fallback
tofalse
and the server responds instead with a400
status code if the requested index is unsuitable to answer the query.Possible values: number of items = 2, 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The read quorum that is needed for the result. The value defaults to 1, in which case the document that was found in the index is returned. If set to a higher value, each document is read from at least that many replicas before it is returned in the results. The request will take more time than using only the document that is stored locally with the index.
Possible values: 1 ≤ value ≤ 3
Default:
1
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The PostExplain options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Examples:{ "email_verified": { "$eq": true } }
Whether to allow fallback to other indexes. Default is true.
Default:
true
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
A boolean value that indicates whether or not to include information about existing conflicts in the document.
Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when
include_docs=true
is used), and total quorum document lookups (when each document replica is fetched).JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Examples:[ "_id", "type", "name", "email" ]
Maximum number of results returned. The
type: text
indexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25
Examples:3
Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740992
The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields.
For example in JSON:
[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]
When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields must use the same sort direction, either all ascending or all descending.
Allowable values: [
asc
,desc
]Possible values: 0 ≤ number of items ≤ 65535
Whether or not the view results should be returned from a "stable" set of shards.
Whether to update the index prior to returning the result.
Allowable values: [
false
,true
,lazy
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Default:
true
Use this option to identify a specific index to answer the query, rather than letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id followed by index name, for example
["my_design_doc", "my_index"]
.It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later.
If the specified index doesn't exist or can't answer the query then the server ignores the value and answers using another index or a full scan of all documents. To change this behavior set
allow_fallback
tofalse
and the server responds instead with a400
status code if the requested index is unsuitable to answer the query.Possible values: number of items = 2, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The read quorum that is needed for the result. The value defaults to 1, in which case the document that was found in the index is returned. If set to a higher value, each document is read from at least that many replicas before it is returned in the results. The request will take more time than using only the document that is stored locally with the index.
Possible values: 1 ≤ value ≤ 3
Default:
1
The postExplain options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Examples:{ "email_verified": { "$eq": true } }
Whether to allow fallback to other indexes. Default is true.
Default:
true
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
A boolean value that indicates whether or not to include information about existing conflicts in the document.
Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when
include_docs=true
is used), and total quorum document lookups (when each document replica is fetched).JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Examples:[ "_id", "type", "name", "email" ]
Maximum number of results returned. The
type: text
indexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25
Examples:3
Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740992
The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields.
For example in JSON:
[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]
When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields must use the same sort direction, either all ascending or all descending.
Allowable values: [
asc
,desc
]Possible values: 0 ≤ number of items ≤ 65535
Whether or not the view results should be returned from a "stable" set of shards.
Whether to update the index prior to returning the result.
Allowable values: [
false
,true
,lazy
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Default:
true
Use this option to identify a specific index to answer the query, rather than letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id followed by index name, for example
["my_design_doc", "my_index"]
.It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later.
If the specified index doesn't exist or can't answer the query then the server ignores the value and answers using another index or a full scan of all documents. To change this behavior set
allow_fallback
tofalse
and the server responds instead with a400
status code if the requested index is unsuitable to answer the query.Possible values: number of items = 2, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The read quorum that is needed for the result. The value defaults to 1, in which case the document that was found in the index is returned. If set to a higher value, each document is read from at least that many replicas before it is returned in the results. The request will take more time than using only the document that is stored locally with the index.
Possible values: 1 ≤ value ≤ 3
Default:
1
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Examples:Whether to allow fallback to other indexes. Default is true.
Default:
true
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
A boolean value that indicates whether or not to include information about existing conflicts in the document.
Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when
include_docs=true
is used), and total quorum document lookups (when each document replica is fetched).JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Examples:Maximum number of results returned. The
type: text
indexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25
Examples:Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740992
The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields.
For example in JSON:
[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]
When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields must use the same sort direction, either all ascending or all descending.
Allowable values: [
asc
,desc
]Possible values: 0 ≤ number of items ≤ 65535
Whether or not the view results should be returned from a "stable" set of shards.
Whether to update the index prior to returning the result.
Allowable values: [
false
,true
,lazy
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Default:
true
Use this option to identify a specific index to answer the query, rather than letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id followed by index name, for example
["my_design_doc", "my_index"]
.It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later.
If the specified index doesn't exist or can't answer the query then the server ignores the value and answers using another index or a full scan of all documents. To change this behavior set
allow_fallback
tofalse
and the server responds instead with a400
status code if the requested index is unsuitable to answer the query.Possible values: number of items = 2, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The read quorum that is needed for the result. The value defaults to 1, in which case the document that was found in the index is returned. If set to a higher value, each document is read from at least that many replicas before it is returned in the results. The request will take more time than using only the document that is stored locally with the index.
Possible values: 1 ≤ value ≤ 3
Default:
1
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Examples:Whether to allow fallback to other indexes. Default is true.
Default:
true
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
A boolean value that indicates whether or not to include information about existing conflicts in the document.
Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when
include_docs=true
is used), and total quorum document lookups (when each document replica is fetched).JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Examples:Maximum number of results returned. The
type: text
indexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25
Examples:Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740992
The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields.
For example in JSON:
[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]
When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields must use the same sort direction, either all ascending or all descending.
Allowable values: [
asc
,desc
]Possible values: 0 ≤ number of items ≤ 65535
Whether or not the view results should be returned from a "stable" set of shards.
Whether to update the index prior to returning the result.
Allowable values: [
false
,true
,lazy
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Default:
true
Use this option to identify a specific index to answer the query, rather than letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id followed by index name, for example
["my_design_doc", "my_index"]
.It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later.
If the specified index doesn't exist or can't answer the query then the server ignores the value and answers using another index or a full scan of all documents. To change this behavior set
allow_fallback
tofalse
and the server responds instead with a400
status code if the requested index is unsuitable to answer the query.Possible values: number of items = 2, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The read quorum that is needed for the result. The value defaults to 1, in which case the document that was found in the index is returned. If set to a higher value, each document is read from at least that many replicas before it is returned in the results. The request will take more time than using only the document that is stored locally with the index.
Possible values: 1 ≤ value ≤ 3
Default:
1
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X POST "$SERVICE_URL/users/_explain" -H "Content-Type: application/json" --data '{ "execution_stats": true, "limit": 10, "selector": {"type": {"$eq": "user"}} }'
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } postExplainOptions := service.NewPostExplainOptions( "users", map[string]interface{}{ "type": map[string]string{ "$eq": "user", }, }, ) postExplainOptions.SetExecutionStats(true) postExplainOptions.SetLimit(10) explainResult, response, err := service.PostExplain(postExplainOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(explainResult, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.ExplainResult; import com.ibm.cloud.cloudant.v1.model.PostExplainOptions; import java.util.Collections; import java.util.Map;
Cloudant service = Cloudant.newInstance(); Map<String, Object> selector = Collections.singletonMap( "type", Collections.singletonMap("$eq", "user")); PostExplainOptions explainOptions = new PostExplainOptions.Builder() .db("users") .executionStats(true) .limit(10) .selector(selector) .build(); ExplainResult response = service.postExplain(explainOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); const selector = { type: { "$eq": "user" } }; service.postExplain({ db: 'users', executionStats: true, limit: 10, selector: selector }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.post_explain( db='users', execution_stats=True, limit=10, selector={'type': {"$eq": "user"}} ).get_result() print(response)
Response
Schema for information about the index used for a find query.
When
true
, the query is answered using the index only and no documents are fetched.Schema for a database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Fields that were requested to be projected from the document. If no fields were requested to be projected this will be empty and all fields will be returned.
Possible values: 0 ≤ number of items ≤ 4294967295, 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Schema for information about an index.
Schema for the list of all the other indexes that were not chosen for serving the query.
Possible values: 0 ≤ number of items ≤ 4294967295
The used maximum number of results returned.
Possible values: 0 ≤ value ≤ 4294967295
Options used for the request.
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate
the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax
- selector
Schema for a list of objects with extra information on the selector to provide insights about its usability.
Possible values: 1 ≤ number of items ≤ 3
Skip parameter used.
Possible values: 0 ≤ value ≤ 9007199254740992
Arguments passed to the underlying view.
Schema for any JSON type
Schema for information about the index used for a find query.
When
true
, the query is answered using the index only and no documents are fetched.Schema for a database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Fields that were requested to be projected from the document. If no fields were requested to be projected this will be empty and all fields will be returned.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for information about an index.
- Index
Schema for a nullable design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Schema for a
json
ortext
query index definition. Indexes of typetext
have additional configuration properties that do not apply tojson
indexes, these are:default_analyzer
- the default text analyzer to use *default_field
- whether to index the text in all document fields and what analyzer to use for that purpose.
- Def
Schema for a full text search analyzer.
- DefaultAnalyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the
$text
operator.- DefaultField
Schema for a full text search analyzer.
- Analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Whether or not the default_field is enabled.
List of field objects to index. Nested fields are also allowed, e.g.
person.name
.For "json" type indexes each object is a mapping of field name to sort direction (asc or desc).
For "text" type indexes each object has a
name
property of the field name and atype
property of the field type (string, number, or boolean).Possible values: 1 ≤ number of items ≤ 65535
- Fields
Name of the field.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The type of the named field.
Possible values: [
boolean
,number
,string
]
Whether to scan every document for arrays and store the length for each array found. Set the index_array_lengths field to false if:
- You do not need to know the length of an array. * You do not use the
$size
operator. * The documents in your database are complex, or not completely under your control. As a result, it is difficult to estimate the impact of the extra processing that is needed to determine and store the arrays lengths.
- You do not need to know the length of an array. * You do not use the
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$|^_all_docs$/
Indicates if index is partitioned.
Schema for the type of an index.
Possible values: [
json
,special
,text
]
Schema for the list of all the other indexes that were not chosen for serving the query.
Possible values: number of items ≥ 0
- IndexCandidates
Schema for detailed explanation of why the specific index was excluded by the query planner.
- Analysis
When
true
, the query is answered using the index only and no documents are fetched.A position of the unused index based on its potential relevance to the query.
Possible values: 1 ≤ value ≤ 4294967295
A list of reasons explaining why index was not chosen for the query.
Possible values: number of items ≥ 1
- Reasons
A reason code for index's exclusion.
The full list of possible reason codes is following:
- alphabetically_comes_after: json There is another suitable index whose name comes before that of this index.
- empty_selector: text "text" indexes do not support queries with empty selectors.
- excluded_by_user: any use_index was used to manually specify the index.
- field_mismatch: any Fields in "selector" of the query do match with the fields available in the index.
- is_partial: json, text Partial indexes can be selected only manually.
- less_overlap: json There is a better match of fields available within the indexes for the query.
- needs_text_search: json The use of the $text operator requires a "text" index.
- scope_mismatch: json The scope of the query and the index is not the same.
- sort_order_mismatch: json, special Fields in "sort" of the query do not match with the fields available in the index.
- too_many_fields: json The index has more fields than the chosen one.
- unfavored_type: any The type of the index is not preferred.
Possible values: [
alphabetically_comes_after
,empty_selector
,excluded_by_user
,field_mismatch
,is_partial
,less_overlap
,needs_text_search
,scope_mismatch
,sort_order_mismatch
,too_many_fields
,unfavored_type
]
Indicates whether an index can still be used for the query.
Schema for information about an index.
- Index
Schema for a nullable design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Schema for a
json
ortext
query index definition. Indexes of typetext
have additional configuration properties that do not apply tojson
indexes, these are:default_analyzer
- the default text analyzer to use *default_field
- whether to index the text in all document fields and what analyzer to use for that purpose.
- Def
Schema for a full text search analyzer.
- DefaultAnalyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the
$text
operator.- DefaultField
Schema for a full text search analyzer.
- Analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Whether or not the default_field is enabled.
List of field objects to index. Nested fields are also allowed, e.g.
person.name
.For "json" type indexes each object is a mapping of field name to sort direction (asc or desc).
For "text" type indexes each object has a
name
property of the field name and atype
property of the field type (string, number, or boolean).Possible values: 1 ≤ number of items ≤ 65535
- Fields
Name of the field.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The type of the named field.
Possible values: [
boolean
,number
,string
]
Whether to scan every document for arrays and store the length for each array found. Set the index_array_lengths field to false if:
- You do not need to know the length of an array. * You do not use the
$size
operator. * The documents in your database are complex, or not completely under your control. As a result, it is difficult to estimate the impact of the extra processing that is needed to determine and store the arrays lengths.
- You do not need to know the length of an array. * You do not use the
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$|^_all_docs$/
Indicates if index is partitioned.
Schema for the type of an index.
Possible values: [
json
,special
,text
]
The used maximum number of results returned.
Possible values: 0 ≤ value ≤ 4294967295
Arguments passed to the underlying view.
- Mrargs
Schema for any JSON type.
Direction parameter passed to the underlying view.
Possible values: [
fwd
,rev
]Schema for any JSON type.
A parameter that specifies whether to include the full content of the documents in the response in the underlying view.
Partition parameter passed to the underlying view.
Possible values: 0 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
A parameter that specifies returning only documents that match any of the specified keys in the underlying view.
A parameter that specifies whether the view results should be returned form a "stable" set of shards passed to the underlying view.
Schema for any JSON type.
Schema for any JSON type.
The type of the underlying view.
Possible values: [
map
,reduce
]
Options used for the request.
- Opts
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Conflicts used in the request query.
Execution statistics used in the request query.
JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Limit used in the request query.
Possible values: 0 ≤ value ≤ 4294967295
On which database partition the request was used. If it was not used on a database partition, it returns with
""
.Possible values: 0 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
The read quorum that is needed for the result.
Possible values: 1 ≤ value ≤ 3
Skip used in the request query.
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for any JSON type.
Stable used in the request query.
Stale used in the request query.
Update used in the request query.
Use index used in the request query.
Possible values: 0 ≤ number of items ≤ 2, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for any JSON type.
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Schema for a list of objects with extra information on the selector to provide insights about its usability.
Possible values: 1 ≤ number of items ≤ 3
- SelectorHints
A list of fields in the given selector that can be used to restrict the query.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
A type of the index.
Possible values: [
json
,text
]A list of fields in the given selector that can't be used to restrict the query.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Skip parameter used.
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for information about the index used for a find query.
When
true
, the query is answered using the index only and no documents are fetched.Schema for a database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Fields that were requested to be projected from the document. If no fields were requested to be projected this will be empty and all fields will be returned.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for information about an index.
- index
Schema for a nullable design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Schema for a
json
ortext
query index definition. Indexes of typetext
have additional configuration properties that do not apply tojson
indexes, these are:default_analyzer
- the default text analyzer to use *default_field
- whether to index the text in all document fields and what analyzer to use for that purpose.
- def
Schema for a full text search analyzer.
- defaultAnalyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the
$text
operator.- defaultField
Schema for a full text search analyzer.
- analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Whether or not the default_field is enabled.
List of field objects to index. Nested fields are also allowed, e.g.
person.name
.For "json" type indexes each object is a mapping of field name to sort direction (asc or desc).
For "text" type indexes each object has a
name
property of the field name and atype
property of the field type (string, number, or boolean).Possible values: 1 ≤ number of items ≤ 65535
- fields
Name of the field.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The type of the named field.
Possible values: [
boolean
,number
,string
]
Whether to scan every document for arrays and store the length for each array found. Set the index_array_lengths field to false if:
- You do not need to know the length of an array. * You do not use the
$size
operator. * The documents in your database are complex, or not completely under your control. As a result, it is difficult to estimate the impact of the extra processing that is needed to determine and store the arrays lengths.
- You do not need to know the length of an array. * You do not use the
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$|^_all_docs$/
Indicates if index is partitioned.
Schema for the type of an index.
Possible values: [
json
,special
,text
]
Schema for the list of all the other indexes that were not chosen for serving the query.
Possible values: number of items ≥ 0
- indexCandidates
Schema for detailed explanation of why the specific index was excluded by the query planner.
- analysis
When
true
, the query is answered using the index only and no documents are fetched.A position of the unused index based on its potential relevance to the query.
Possible values: 1 ≤ value ≤ 4294967295
A list of reasons explaining why index was not chosen for the query.
Possible values: number of items ≥ 1
- reasons
A reason code for index's exclusion.
The full list of possible reason codes is following:
- alphabetically_comes_after: json There is another suitable index whose name comes before that of this index.
- empty_selector: text "text" indexes do not support queries with empty selectors.
- excluded_by_user: any use_index was used to manually specify the index.
- field_mismatch: any Fields in "selector" of the query do match with the fields available in the index.
- is_partial: json, text Partial indexes can be selected only manually.
- less_overlap: json There is a better match of fields available within the indexes for the query.
- needs_text_search: json The use of the $text operator requires a "text" index.
- scope_mismatch: json The scope of the query and the index is not the same.
- sort_order_mismatch: json, special Fields in "sort" of the query do not match with the fields available in the index.
- too_many_fields: json The index has more fields than the chosen one.
- unfavored_type: any The type of the index is not preferred.
Possible values: [
alphabetically_comes_after
,empty_selector
,excluded_by_user
,field_mismatch
,is_partial
,less_overlap
,needs_text_search
,scope_mismatch
,sort_order_mismatch
,too_many_fields
,unfavored_type
]
Indicates whether an index can still be used for the query.
Schema for information about an index.
- index
Schema for a nullable design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Schema for a
json
ortext
query index definition. Indexes of typetext
have additional configuration properties that do not apply tojson
indexes, these are:default_analyzer
- the default text analyzer to use *default_field
- whether to index the text in all document fields and what analyzer to use for that purpose.
- def
Schema for a full text search analyzer.
- defaultAnalyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the
$text
operator.- defaultField
Schema for a full text search analyzer.
- analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Whether or not the default_field is enabled.
List of field objects to index. Nested fields are also allowed, e.g.
person.name
.For "json" type indexes each object is a mapping of field name to sort direction (asc or desc).
For "text" type indexes each object has a
name
property of the field name and atype
property of the field type (string, number, or boolean).Possible values: 1 ≤ number of items ≤ 65535
- fields
Name of the field.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The type of the named field.
Possible values: [
boolean
,number
,string
]
Whether to scan every document for arrays and store the length for each array found. Set the index_array_lengths field to false if:
- You do not need to know the length of an array. * You do not use the
$size
operator. * The documents in your database are complex, or not completely under your control. As a result, it is difficult to estimate the impact of the extra processing that is needed to determine and store the arrays lengths.
- You do not need to know the length of an array. * You do not use the
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$|^_all_docs$/
Indicates if index is partitioned.
Schema for the type of an index.
Possible values: [
json
,special
,text
]
The used maximum number of results returned.
Possible values: 0 ≤ value ≤ 4294967295
Arguments passed to the underlying view.
- mrargs
Schema for any JSON type.
Direction parameter passed to the underlying view.
Possible values: [
fwd
,rev
]Schema for any JSON type.
A parameter that specifies whether to include the full content of the documents in the response in the underlying view.
Partition parameter passed to the underlying view.
Possible values: 0 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
A parameter that specifies returning only documents that match any of the specified keys in the underlying view.
A parameter that specifies whether the view results should be returned form a "stable" set of shards passed to the underlying view.
Schema for any JSON type.
Schema for any JSON type.
The type of the underlying view.
Possible values: [
map
,reduce
]
Options used for the request.
- opts
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Conflicts used in the request query.
Execution statistics used in the request query.
JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Limit used in the request query.
Possible values: 0 ≤ value ≤ 4294967295
On which database partition the request was used. If it was not used on a database partition, it returns with
""
.Possible values: 0 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
The read quorum that is needed for the result.
Possible values: 1 ≤ value ≤ 3
Skip used in the request query.
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for any JSON type.
Stable used in the request query.
Stale used in the request query.
Update used in the request query.
Use index used in the request query.
Possible values: 0 ≤ number of items ≤ 2, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for any JSON type.
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Schema for a list of objects with extra information on the selector to provide insights about its usability.
Possible values: 1 ≤ number of items ≤ 3
- selectorHints
A list of fields in the given selector that can be used to restrict the query.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
A type of the index.
Possible values: [
json
,text
]A list of fields in the given selector that can't be used to restrict the query.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Skip parameter used.
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for information about the index used for a find query.
When
true
, the query is answered using the index only and no documents are fetched.Schema for a database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Fields that were requested to be projected from the document. If no fields were requested to be projected this will be empty and all fields will be returned.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for information about an index.
- index
Schema for a nullable design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Schema for a
json
ortext
query index definition. Indexes of typetext
have additional configuration properties that do not apply tojson
indexes, these are:default_analyzer
- the default text analyzer to use *default_field
- whether to index the text in all document fields and what analyzer to use for that purpose.
- def
Schema for a full text search analyzer.
- defaultAnalyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the
$text
operator.- defaultField
Schema for a full text search analyzer.
- analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Whether or not the default_field is enabled.
List of field objects to index. Nested fields are also allowed, e.g.
person.name
.For "json" type indexes each object is a mapping of field name to sort direction (asc or desc).
For "text" type indexes each object has a
name
property of the field name and atype
property of the field type (string, number, or boolean).Possible values: 1 ≤ number of items ≤ 65535
- fields
Name of the field.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The type of the named field.
Possible values: [
boolean
,number
,string
]
Whether to scan every document for arrays and store the length for each array found. Set the index_array_lengths field to false if:
- You do not need to know the length of an array. * You do not use the
$size
operator. * The documents in your database are complex, or not completely under your control. As a result, it is difficult to estimate the impact of the extra processing that is needed to determine and store the arrays lengths.
- You do not need to know the length of an array. * You do not use the
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$|^_all_docs$/
Indicates if index is partitioned.
Schema for the type of an index.
Possible values: [
json
,special
,text
]
Schema for the list of all the other indexes that were not chosen for serving the query.
Possible values: number of items ≥ 0
- indexCandidates
Schema for detailed explanation of why the specific index was excluded by the query planner.
- analysis
When
true
, the query is answered using the index only and no documents are fetched.A position of the unused index based on its potential relevance to the query.
Possible values: 1 ≤ value ≤ 4294967295
A list of reasons explaining why index was not chosen for the query.
Possible values: number of items ≥ 1
- reasons
A reason code for index's exclusion.
The full list of possible reason codes is following:
- alphabetically_comes_after: json There is another suitable index whose name comes before that of this index.
- empty_selector: text "text" indexes do not support queries with empty selectors.
- excluded_by_user: any use_index was used to manually specify the index.
- field_mismatch: any Fields in "selector" of the query do match with the fields available in the index.
- is_partial: json, text Partial indexes can be selected only manually.
- less_overlap: json There is a better match of fields available within the indexes for the query.
- needs_text_search: json The use of the $text operator requires a "text" index.
- scope_mismatch: json The scope of the query and the index is not the same.
- sort_order_mismatch: json, special Fields in "sort" of the query do not match with the fields available in the index.
- too_many_fields: json The index has more fields than the chosen one.
- unfavored_type: any The type of the index is not preferred.
Possible values: [
alphabetically_comes_after
,empty_selector
,excluded_by_user
,field_mismatch
,is_partial
,less_overlap
,needs_text_search
,scope_mismatch
,sort_order_mismatch
,too_many_fields
,unfavored_type
]
Indicates whether an index can still be used for the query.
Schema for information about an index.
- index
Schema for a nullable design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Schema for a
json
ortext
query index definition. Indexes of typetext
have additional configuration properties that do not apply tojson
indexes, these are:default_analyzer
- the default text analyzer to use *default_field
- whether to index the text in all document fields and what analyzer to use for that purpose.
- def
Schema for a full text search analyzer.
- defaultAnalyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the
$text
operator.- defaultField
Schema for a full text search analyzer.
- analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Whether or not the default_field is enabled.
List of field objects to index. Nested fields are also allowed, e.g.
person.name
.For "json" type indexes each object is a mapping of field name to sort direction (asc or desc).
For "text" type indexes each object has a
name
property of the field name and atype
property of the field type (string, number, or boolean).Possible values: 1 ≤ number of items ≤ 65535
- fields
Name of the field.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The type of the named field.
Possible values: [
boolean
,number
,string
]
Whether to scan every document for arrays and store the length for each array found. Set the index_array_lengths field to false if:
- You do not need to know the length of an array. * You do not use the
$size
operator. * The documents in your database are complex, or not completely under your control. As a result, it is difficult to estimate the impact of the extra processing that is needed to determine and store the arrays lengths.
- You do not need to know the length of an array. * You do not use the
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$|^_all_docs$/
Indicates if index is partitioned.
Schema for the type of an index.
Possible values: [
json
,special
,text
]
The used maximum number of results returned.
Possible values: 0 ≤ value ≤ 4294967295
Arguments passed to the underlying view.
- mrargs
Schema for any JSON type.
Direction parameter passed to the underlying view.
Possible values: [
fwd
,rev
]Schema for any JSON type.
A parameter that specifies whether to include the full content of the documents in the response in the underlying view.
Partition parameter passed to the underlying view.
Possible values: 0 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
A parameter that specifies returning only documents that match any of the specified keys in the underlying view.
A parameter that specifies whether the view results should be returned form a "stable" set of shards passed to the underlying view.
Schema for any JSON type.
Schema for any JSON type.
The type of the underlying view.
Possible values: [
map
,reduce
]
Options used for the request.
- opts
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Conflicts used in the request query.
Execution statistics used in the request query.
JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Limit used in the request query.
Possible values: 0 ≤ value ≤ 4294967295
On which database partition the request was used. If it was not used on a database partition, it returns with
""
.Possible values: 0 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
The read quorum that is needed for the result.
Possible values: 1 ≤ value ≤ 3
Skip used in the request query.
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for any JSON type.
Stable used in the request query.
Stale used in the request query.
Update used in the request query.
Use index used in the request query.
Possible values: 0 ≤ number of items ≤ 2, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for any JSON type.
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Schema for a list of objects with extra information on the selector to provide insights about its usability.
Possible values: 1 ≤ number of items ≤ 3
- selectorHints
A list of fields in the given selector that can be used to restrict the query.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
A type of the index.
Possible values: [
json
,text
]A list of fields in the given selector that can't be used to restrict the query.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Skip parameter used.
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for information about the index used for a find query.
When
true
, the query is answered using the index only and no documents are fetched.Schema for a database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Fields that were requested to be projected from the document. If no fields were requested to be projected this will be empty and all fields will be returned.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for information about an index.
- index
Schema for a nullable design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Schema for a
json
ortext
query index definition. Indexes of typetext
have additional configuration properties that do not apply tojson
indexes, these are:default_analyzer
- the default text analyzer to use *default_field
- whether to index the text in all document fields and what analyzer to use for that purpose.
- def_
Schema for a full text search analyzer.
- default_analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the
$text
operator.- default_field
Schema for a full text search analyzer.
- analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Whether or not the default_field is enabled.
List of field objects to index. Nested fields are also allowed, e.g.
person.name
.For "json" type indexes each object is a mapping of field name to sort direction (asc or desc).
For "text" type indexes each object has a
name
property of the field name and atype
property of the field type (string, number, or boolean).Possible values: 1 ≤ number of items ≤ 65535
- fields
Name of the field.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The type of the named field.
Possible values: [
boolean
,number
,string
]
Whether to scan every document for arrays and store the length for each array found. Set the index_array_lengths field to false if:
- You do not need to know the length of an array. * You do not use the
$size
operator. * The documents in your database are complex, or not completely under your control. As a result, it is difficult to estimate the impact of the extra processing that is needed to determine and store the arrays lengths.
- You do not need to know the length of an array. * You do not use the
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$|^_all_docs$/
Indicates if index is partitioned.
Schema for the type of an index.
Possible values: [
json
,special
,text
]
Schema for the list of all the other indexes that were not chosen for serving the query.
Possible values: number of items ≥ 0
- index_candidates
Schema for detailed explanation of why the specific index was excluded by the query planner.
- analysis
When
true
, the query is answered using the index only and no documents are fetched.A position of the unused index based on its potential relevance to the query.
Possible values: 1 ≤ value ≤ 4294967295
A list of reasons explaining why index was not chosen for the query.
Possible values: number of items ≥ 1
- reasons
A reason code for index's exclusion.
The full list of possible reason codes is following:
- alphabetically_comes_after: json There is another suitable index whose name comes before that of this index.
- empty_selector: text "text" indexes do not support queries with empty selectors.
- excluded_by_user: any use_index was used to manually specify the index.
- field_mismatch: any Fields in "selector" of the query do match with the fields available in the index.
- is_partial: json, text Partial indexes can be selected only manually.
- less_overlap: json There is a better match of fields available within the indexes for the query.
- needs_text_search: json The use of the $text operator requires a "text" index.
- scope_mismatch: json The scope of the query and the index is not the same.
- sort_order_mismatch: json, special Fields in "sort" of the query do not match with the fields available in the index.
- too_many_fields: json The index has more fields than the chosen one.
- unfavored_type: any The type of the index is not preferred.
Possible values: [
alphabetically_comes_after
,empty_selector
,excluded_by_user
,field_mismatch
,is_partial
,less_overlap
,needs_text_search
,scope_mismatch
,sort_order_mismatch
,too_many_fields
,unfavored_type
]
Indicates whether an index can still be used for the query.
Schema for information about an index.
- index
Schema for a nullable design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Schema for a
json
ortext
query index definition. Indexes of typetext
have additional configuration properties that do not apply tojson
indexes, these are:default_analyzer
- the default text analyzer to use *default_field
- whether to index the text in all document fields and what analyzer to use for that purpose.
- def_
Schema for a full text search analyzer.
- default_analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the
$text
operator.- default_field
Schema for a full text search analyzer.
- analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Whether or not the default_field is enabled.
List of field objects to index. Nested fields are also allowed, e.g.
person.name
.For "json" type indexes each object is a mapping of field name to sort direction (asc or desc).
For "text" type indexes each object has a
name
property of the field name and atype
property of the field type (string, number, or boolean).Possible values: 1 ≤ number of items ≤ 65535
- fields
Name of the field.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The type of the named field.
Possible values: [
boolean
,number
,string
]
Whether to scan every document for arrays and store the length for each array found. Set the index_array_lengths field to false if:
- You do not need to know the length of an array. * You do not use the
$size
operator. * The documents in your database are complex, or not completely under your control. As a result, it is difficult to estimate the impact of the extra processing that is needed to determine and store the arrays lengths.
- You do not need to know the length of an array. * You do not use the
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$|^_all_docs$/
Indicates if index is partitioned.
Schema for the type of an index.
Possible values: [
json
,special
,text
]
The used maximum number of results returned.
Possible values: 0 ≤ value ≤ 4294967295
Arguments passed to the underlying view.
- mrargs
Schema for any JSON type.
Direction parameter passed to the underlying view.
Possible values: [
fwd
,rev
]Schema for any JSON type.
A parameter that specifies whether to include the full content of the documents in the response in the underlying view.
Partition parameter passed to the underlying view.
Possible values: 0 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
A parameter that specifies returning only documents that match any of the specified keys in the underlying view.
A parameter that specifies whether the view results should be returned form a "stable" set of shards passed to the underlying view.
Schema for any JSON type.
Schema for any JSON type.
The type of the underlying view.
Possible values: [
map
,reduce
]
Options used for the request.
- opts
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Conflicts used in the request query.
Execution statistics used in the request query.
JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Limit used in the request query.
Possible values: 0 ≤ value ≤ 4294967295
On which database partition the request was used. If it was not used on a database partition, it returns with
""
.Possible values: 0 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
The read quorum that is needed for the result.
Possible values: 1 ≤ value ≤ 3
Skip used in the request query.
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for any JSON type.
Stable used in the request query.
Stale used in the request query.
Update used in the request query.
Use index used in the request query.
Possible values: 0 ≤ number of items ≤ 2, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for any JSON type.
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Schema for a list of objects with extra information on the selector to provide insights about its usability.
Possible values: 1 ≤ number of items ≤ 3
- selector_hints
A list of fields in the given selector that can be used to restrict the query.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
A type of the index.
Possible values: [
json
,text
]A list of fields in the given selector that can't be used to restrict the query.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Skip parameter used.
Possible values: 0 ≤ value ≤ 9007199254740992
Status Code
HTTP response for postExplain.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example ExplainResult response.
{ "covering": false, "dbname": "users", "fields": [ "surname", "email" ], "index": { "ddoc": "_design/id-index", "def": { "fields": [ { "_id": "asc" } ] }, "name": "d479bdddf50865e520a0193704c8b93a3bd48f77", "type": "json" }, "index_candidates": [ { "analysis": { "covering": null, "ranking": 1, "reasons": [ { "name": "unfavored_type" } ], "usable": false }, "index": { "ddoc": null, "def": { "fields": [ { "_id": "asc" } ] }, "name": "_all_docs", "type": "special" } }, { "analysis": { "covering": false, "ranking": 2, "reasons": [ { "name": "field_mismatch" } ], "usable": false }, "index": { "ddoc": "_design/json-index", "def": { "fields": [ { "name": "asc" } ] }, "name": "getUserByName", "partitioned": false, "type": "json" } } ], "limit": 10, "mrargs": { "conflicts": "undefined", "direction": "fwd", "end_key": [ "<MAX>" ], "include_docs": true, "partition": null, "reduce": false, "stable": false, "start_key": [], "update": true, "view_type": "map" }, "opts": { "bookmark": "nil", "conflicts": false, "execution_stats": true, "fields": [], "limit": 10, "partition": "", "r": 1, "skip": 0, "sort": {}, "stable": false, "stale": false, "update": false, "use_index": [] }, "partitioned": true, "selector": { "type": { "$eq": "user" } }, "selector_hints": [ { "indexable_fields": [ "email" ], "type": "json", "unindexable_fields": [ "surname" ] } ], "skip": 0 }
Example ExplainResult response.
{ "covering": false, "dbname": "users", "fields": [ "surname", "email" ], "index": { "ddoc": "_design/id-index", "def": { "fields": [ { "_id": "asc" } ] }, "name": "d479bdddf50865e520a0193704c8b93a3bd48f77", "type": "json" }, "index_candidates": [ { "analysis": { "covering": null, "ranking": 1, "reasons": [ { "name": "unfavored_type" } ], "usable": false }, "index": { "ddoc": null, "def": { "fields": [ { "_id": "asc" } ] }, "name": "_all_docs", "type": "special" } }, { "analysis": { "covering": false, "ranking": 2, "reasons": [ { "name": "field_mismatch" } ], "usable": false }, "index": { "ddoc": "_design/json-index", "def": { "fields": [ { "name": "asc" } ] }, "name": "getUserByName", "partitioned": false, "type": "json" } } ], "limit": 10, "mrargs": { "conflicts": "undefined", "direction": "fwd", "end_key": [ "<MAX>" ], "include_docs": true, "partition": null, "reduce": false, "stable": false, "start_key": [], "update": true, "view_type": "map" }, "opts": { "bookmark": "nil", "conflicts": false, "execution_stats": true, "fields": [], "limit": 10, "partition": "", "r": 1, "skip": 0, "sort": {}, "stable": false, "stale": false, "update": false, "use_index": [] }, "partitioned": true, "selector": { "type": { "$eq": "user" } }, "selector_hints": [ { "indexable_fields": [ "email" ], "type": "json", "unindexable_fields": [ "surname" ] } ], "skip": 0 }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Query an index by using selector syntax
Query documents by using a
declarative JSON querying syntax.
It's best practice to create an appropriate index
for all fields in selector by using the _index
endpoint.
Queries without an appropriate backing index by default
fallback to using the built-in _all_docs
index.
This isn't recommended because it has a significant
performance impact causing a full scan of the database
with each request.
In this case the response body includes a warning field
recommending the creation of an index.
To avoid the fallback behavior set the allow_fallback
option
to false
and the server responds with a 400
status code
if no suitable index exists.
If you want to use only a specific index for your query set
allow_fallback
to false
and set the use_index
option.
Query documents by using a declarative JSON querying syntax. It's best practice to create an appropriate index for all fields in selector by using the _index
endpoint.
Queries without an appropriate backing index by default fallback to using the built-in _all_docs
index. This isn't recommended because it has a significant performance impact causing a full scan of the database with each request. In this case the response body includes a warning field recommending the creation of an index.
To avoid the fallback behavior set the allow_fallback
option to false
and the server responds with a 400
status code if no suitable index exists. If you want to use only a specific index for your query set
allow_fallback
to false
and set the use_index
option.
Query documents by using a declarative JSON querying syntax. It's best practice to create an appropriate index for all fields in selector by using the _index
endpoint.
Queries without an appropriate backing index by default fallback to using the built-in _all_docs
index. This isn't recommended because it has a significant performance impact causing a full scan of the database with each request. In this case the response body includes a warning field recommending the creation of an index.
To avoid the fallback behavior set the allow_fallback
option to false
and the server responds with a 400
status code if no suitable index exists. If you want to use only a specific index for your query set
allow_fallback
to false
and set the use_index
option.
Query documents by using a declarative JSON querying syntax. It's best practice to create an appropriate index for all fields in selector by using the _index
endpoint.
Queries without an appropriate backing index by default fallback to using the built-in _all_docs
index. This isn't recommended because it has a significant performance impact causing a full scan of the database with each request. In this case the response body includes a warning field recommending the creation of an index.
To avoid the fallback behavior set the allow_fallback
option to false
and the server responds with a 400
status code if no suitable index exists. If you want to use only a specific index for your query set
allow_fallback
to false
and set the use_index
option.
Query documents by using a declarative JSON querying syntax. It's best practice to create an appropriate index for all fields in selector by using the _index
endpoint.
Queries without an appropriate backing index by default fallback to using the built-in _all_docs
index. This isn't recommended because it has a significant performance impact causing a full scan of the database with each request. In this case the response body includes a warning field recommending the creation of an index.
To avoid the fallback behavior set the allow_fallback
option to false
and the server responds with a 400
status code if no suitable index exists. If you want to use only a specific index for your query set
allow_fallback
to false
and set the use_index
option.
POST /{db}/_find
(cloudant *CloudantV1) PostFind(postFindOptions *PostFindOptions) (result *FindResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostFindWithContext(ctx context.Context, postFindOptions *PostFindOptions) (result *FindResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostFindAsStream(postFindOptions *PostFindOptions) (result io.ReadCloser, response *core.DetailedResponse, err error)
ServiceCall<FindResult> postFind(PostFindOptions postFindOptions)
ServiceCall<InputStream> postFindAsStream(PostFindOptions postFindOptions)
postFind(params)
postFindAsStream(params)
post_find(
self,
db: str,
selector: dict,
*,
allow_fallback: Optional[bool] = None,
bookmark: Optional[str] = None,
conflicts: Optional[bool] = None,
execution_stats: Optional[bool] = None,
fields: Optional[List[str]] = None,
limit: Optional[int] = None,
skip: Optional[int] = None,
sort: Optional[List[dict]] = None,
stable: Optional[bool] = None,
update: Optional[str] = None,
use_index: Optional[List[str]] = None,
r: Optional[int] = None,
**kwargs,
) -> DetailedResponse
post_find_as_stream(
self,
db: str,
selector: dict,
*,
allow_fallback: Optional[bool] = None,
bookmark: Optional[str] = None,
conflicts: Optional[bool] = None,
execution_stats: Optional[bool] = None,
fields: Optional[List[str]] = None,
limit: Optional[int] = None,
skip: Optional[int] = None,
sort: Optional[List[dict]] = None,
stable: Optional[bool] = None,
update: Optional[str] = None,
use_index: Optional[List[str]] = None,
r: Optional[int] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the PostFindOptions
struct and set the fields to provide parameter values for the PostFind
method.
Use the PostFindOptions.Builder
to create a PostFindOptions
object that contains the parameter values for the postFind
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
HTTP request body for postFind and postExplain.
Example FindQuery request.
{
"fields": [
"_id",
"type",
"name",
"email"
],
"limit": 3,
"selector": {
"email_verified": {
"$eq": true
}
}
}
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate
the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax
- selector
Whether to allow fallback to other indexes. Default is true.
Default:
true
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
^[A-Za-z0-9=_-]*$
A boolean value that indicates whether or not to include information about existing conflicts in the document.
Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when
include_docs=true
is used), and total quorum document lookups (when each document replica is fetched).JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Maximum number of results returned. The
type: text
indexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25
Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740992
The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields.
For example in JSON:
[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]
When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields must use the same sort direction, either all ascending or all descending.
Possible values: 0 ≤ number of items ≤ 65535
- sort
Schema for sort direction.
Allowable values: [
asc
,desc
]Default:
asc
Whether or not the view results should be returned from a "stable" set of shards.
Whether to update the index prior to returning the result.
Allowable values: [
false
,true
,lazy
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Default:
true
Use this option to identify a specific index to answer the query, rather than letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id followed by index name, for example
["my_design_doc", "my_index"]
.It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later.
If the specified index doesn't exist or can't answer the query then the server ignores the value and answers using another index or a full scan of all documents. To change this behavior set
allow_fallback
tofalse
and the server responds instead with a400
status code if the requested index is unsuitable to answer the query.Possible values: number of items = 2, 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The read quorum that is needed for the result. The value defaults to 1, in which case the document that was found in the index is returned. If set to a higher value, each document is read from at least that many replicas before it is returned in the results. The request will take more time than using only the document that is stored locally with the index.
Possible values: 1 ≤ value ≤ 3
Default:
1
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The PostFind options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Examples:{ "email_verified": { "$eq": true } }
Whether to allow fallback to other indexes. Default is true.
Default:
true
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
A boolean value that indicates whether or not to include information about existing conflicts in the document.
Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when
include_docs=true
is used), and total quorum document lookups (when each document replica is fetched).JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Examples:[ "_id", "type", "name", "email" ]
Maximum number of results returned. The
type: text
indexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25
Examples:3
Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740992
The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields.
For example in JSON:
[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]
When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields must use the same sort direction, either all ascending or all descending.
Allowable values: [
asc
,desc
]Possible values: 0 ≤ number of items ≤ 65535
Whether or not the view results should be returned from a "stable" set of shards.
Whether to update the index prior to returning the result.
Allowable values: [
false
,true
,lazy
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Default:
true
Use this option to identify a specific index to answer the query, rather than letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id followed by index name, for example
["my_design_doc", "my_index"]
.It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later.
If the specified index doesn't exist or can't answer the query then the server ignores the value and answers using another index or a full scan of all documents. To change this behavior set
allow_fallback
tofalse
and the server responds instead with a400
status code if the requested index is unsuitable to answer the query.Possible values: number of items = 2, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The read quorum that is needed for the result. The value defaults to 1, in which case the document that was found in the index is returned. If set to a higher value, each document is read from at least that many replicas before it is returned in the results. The request will take more time than using only the document that is stored locally with the index.
Possible values: 1 ≤ value ≤ 3
Default:
1
The postFind options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Examples:{ "email_verified": { "$eq": true } }
Whether to allow fallback to other indexes. Default is true.
Default:
true
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
A boolean value that indicates whether or not to include information about existing conflicts in the document.
Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when
include_docs=true
is used), and total quorum document lookups (when each document replica is fetched).JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Examples:[ "_id", "type", "name", "email" ]
Maximum number of results returned. The
type: text
indexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25
Examples:3
Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740992
The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields.
For example in JSON:
[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]
When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields must use the same sort direction, either all ascending or all descending.
Allowable values: [
asc
,desc
]Possible values: 0 ≤ number of items ≤ 65535
Whether or not the view results should be returned from a "stable" set of shards.
Whether to update the index prior to returning the result.
Allowable values: [
false
,true
,lazy
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Default:
true
Use this option to identify a specific index to answer the query, rather than letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id followed by index name, for example
["my_design_doc", "my_index"]
.It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later.
If the specified index doesn't exist or can't answer the query then the server ignores the value and answers using another index or a full scan of all documents. To change this behavior set
allow_fallback
tofalse
and the server responds instead with a400
status code if the requested index is unsuitable to answer the query.Possible values: number of items = 2, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The read quorum that is needed for the result. The value defaults to 1, in which case the document that was found in the index is returned. If set to a higher value, each document is read from at least that many replicas before it is returned in the results. The request will take more time than using only the document that is stored locally with the index.
Possible values: 1 ≤ value ≤ 3
Default:
1
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Examples:Whether to allow fallback to other indexes. Default is true.
Default:
true
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
A boolean value that indicates whether or not to include information about existing conflicts in the document.
Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when
include_docs=true
is used), and total quorum document lookups (when each document replica is fetched).JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Examples:Maximum number of results returned. The
type: text
indexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25
Examples:Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740992
The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields.
For example in JSON:
[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]
When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields must use the same sort direction, either all ascending or all descending.
Allowable values: [
asc
,desc
]Possible values: 0 ≤ number of items ≤ 65535
Whether or not the view results should be returned from a "stable" set of shards.
Whether to update the index prior to returning the result.
Allowable values: [
false
,true
,lazy
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Default:
true
Use this option to identify a specific index to answer the query, rather than letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id followed by index name, for example
["my_design_doc", "my_index"]
.It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later.
If the specified index doesn't exist or can't answer the query then the server ignores the value and answers using another index or a full scan of all documents. To change this behavior set
allow_fallback
tofalse
and the server responds instead with a400
status code if the requested index is unsuitable to answer the query.Possible values: number of items = 2, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The read quorum that is needed for the result. The value defaults to 1, in which case the document that was found in the index is returned. If set to a higher value, each document is read from at least that many replicas before it is returned in the results. The request will take more time than using only the document that is stored locally with the index.
Possible values: 1 ≤ value ≤ 3
Default:
1
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Examples:Whether to allow fallback to other indexes. Default is true.
Default:
true
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
A boolean value that indicates whether or not to include information about existing conflicts in the document.
Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when
include_docs=true
is used), and total quorum document lookups (when each document replica is fetched).JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Examples:Maximum number of results returned. The
type: text
indexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25
Examples:Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740992
The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields.
For example in JSON:
[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]
When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields must use the same sort direction, either all ascending or all descending.
Allowable values: [
asc
,desc
]Possible values: 0 ≤ number of items ≤ 65535
Whether or not the view results should be returned from a "stable" set of shards.
Whether to update the index prior to returning the result.
Allowable values: [
false
,true
,lazy
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Default:
true
Use this option to identify a specific index to answer the query, rather than letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id followed by index name, for example
["my_design_doc", "my_index"]
.It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later.
If the specified index doesn't exist or can't answer the query then the server ignores the value and answers using another index or a full scan of all documents. To change this behavior set
allow_fallback
tofalse
and the server responds instead with a400
status code if the requested index is unsuitable to answer the query.Possible values: number of items = 2, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The read quorum that is needed for the result. The value defaults to 1, in which case the document that was found in the index is returned. If set to a higher value, each document is read from at least that many replicas before it is returned in the results. The request will take more time than using only the document that is stored locally with the index.
Possible values: 1 ≤ value ≤ 3
Default:
1
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X POST "$SERVICE_URL/users/_find" -H "Content-Type: application/json" --data '{ "fields": ["_id", "type", "name", "email"], "limit": 3, "selector": { "email_verified": { "$eq": true } }, "sort": [{ "email": "desc" }] }'
This example requires the
getUserByEmail
Cloudant Query "json" index to exist. To create the index, see Create a new index on a database.curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X POST "$SERVICE_URL/users/_find" -H "Content-Type: application/json" --data '{ "fields": ["_id", "type", "name", "email", "address"], "limit": 3, "selector": { "address": { "$regex": "Street" } } }'
This example requires the
getUserByAddress
Cloudant Query "text" index to exist. To create the index, see Create a new index on a database.
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } postFindOptions := service.NewPostFindOptions( "users", map[string]interface{}{ "email_verified": map[string]bool{ "$eq": true, }, }, ) postFindOptions.SetFields( []string{"_id", "type", "name", "email"}, ) postFindOptions.SetSort([]map[string]string{{"email": "desc"}}) postFindOptions.SetLimit(3) findResult, response, err := service.PostFind(postFindOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(findResult, "", " ") fmt.Println(string(b))
This example requires the
getUserByEmail
Cloudant Query "json" index to exist. To create the index, see Create a new index on a database.import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } postFindOptions := service.NewPostFindOptions( "users", map[string]interface{}{ "address": map[string]string{ "$regex": "Street", }, }, ) postFindOptions.SetFields( []string{"_id", "type", "name", "email", "address"}, ) postFindOptions.SetLimit(3) findResult, response, err := service.PostFind(postFindOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(findResult, "", " ") fmt.Println(string(b))
This example requires the
getUserByAddress
Cloudant Query "text" index to exist. To create the index, see Create a new index on a database.
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.FindResult; import com.ibm.cloud.cloudant.v1.model.PostFindOptions; import java.util.Arrays; import java.util.Collections; import java.util.Map;
Cloudant service = Cloudant.newInstance(); Map<String, Object> selector = Collections.singletonMap( "email_verified", Collections.singletonMap("$eq", true)); Map<String, String> fieldSort = Collections.singletonMap("email", "desc"); PostFindOptions findOptions = new PostFindOptions.Builder() .db("users") .selector(selector) .fields(Arrays.asList("_id", "type", "name", "email")) .addSort(fieldSort) .limit(3) .build(); FindResult response = service.postFind(findOptions).execute() .getResult(); System.out.println(response);
This example requires the
getUserByEmail
Cloudant Query "json" index to exist. To create the index, see Create a new index on a database.import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.FindResult; import com.ibm.cloud.cloudant.v1.model.PostFindOptions; import java.util.Arrays; import java.util.Collections; import java.util.Map;
Cloudant service = Cloudant.newInstance(); Map<String, Object> selector = Collections.singletonMap( "address", Collections.singletonMap("$regex", "Street")); PostFindOptions findOptions = new PostFindOptions.Builder() .db("users") .selector(selector) .fields(Arrays.asList("_id", "type", "name", "email", "address")) .limit(3) .build(); FindResult response = service.postFind(findOptions).execute() .getResult(); System.out.println(response);
This example requires the
getUserByAddress
Cloudant Query "text" index to exist. To create the index, see Create a new index on a database.
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); const selector: CloudantV1.JsonObject = { email_verified: { '$eq': true } }; const sort: CloudantV1.JsonObject = { email: 'desc' }; service.postFind({ db: 'users', selector: selector, fields: ['_id', 'type', 'name', 'email'], sort: [sort], limit: 3 }).then(response => { console.log(response.result); });
This example requires the
getUserByEmail
Cloudant Query "json" index to exist. To create the index, see Create a new index on a database.import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); const selector: CloudantV1.JsonObject = { address: { '$regex': 'Street' } }; service.postFind({ db: 'users', selector: selector, fields: ['_id', 'type', 'name', 'email', 'address'], limit: 3 }).then(response => { console.log(response.result); });
This example requires the
getUserByAddress
Cloudant Query "text" index to exist. To create the index, see Create a new index on a database.
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.post_find( db='users', selector={'email_verified': {'$eq': True}}, fields=["_id", "type", "name", "email"], sort=[{'email': 'desc'}], limit=3 ).get_result() print(response)
This example requires the
getUserByEmail
Cloudant Query "json" index to exist. To create the index, see Create a new index on a database.from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.post_find( db='users', selector={'address': {'$regex': 'Street'}}, fields=["_id", "type", "name", "email", "address"], limit=3 ).get_result() print(response)
This example requires the
getUserByAddress
Cloudant Query "text" index to exist. To create the index, see Create a new index on a database.
Response
Response type for PostFind
: FindResult
Response type for PostFindAsStream
: io.ReadCloser
Response type for postFind
: FindResult
Response type for postFindAsStream
: InputStream
Response type for postFind
: FindResult
Response type for postFindAsStream
: NodeJS.ReadableStream
Response type for post_find
: FindResult
Response type for post_find_as_stream
: BinaryIO
Schema for the result of a query find operation.
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
^[A-Za-z0-9=_-]*$
Documents matching the selector.
Possible values: 0 ≤ number of items ≤ 4294967295
- docs
Schema for find query execution statistics.
warning
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Schema for the result of a query find operation.
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Documents matching the selector.
Possible values: number of items ≥ 0
- Docs
Schema for a map of attachment name to attachment metadata.
- Attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- Revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- RevsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for find query execution statistics.
- ExecutionStats
Time to execute the query.
Number of results returned.
Possible values: 0 ≤ value ≤ 4294967295
Number of documents fetched from the index.
Possible values: 0 ≤ value ≤ 9007199254740992
Number of rows scanned in the index.
Possible values: 0 ≤ value ≤ 9007199254740992
Number of documents fetched from the primary index with the specified read quorum.
Possible values: 0 ≤ value ≤ 9007199254740992
warning.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the result of a query find operation.
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Documents matching the selector.
Possible values: number of items ≥ 0
- docs
Schema for a map of attachment name to attachment metadata.
- attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- revsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for find query execution statistics.
- executionStats
Time to execute the query.
Number of results returned.
Possible values: 0 ≤ value ≤ 4294967295
Number of documents fetched from the index.
Possible values: 0 ≤ value ≤ 9007199254740992
Number of rows scanned in the index.
Possible values: 0 ≤ value ≤ 9007199254740992
Number of documents fetched from the primary index with the specified read quorum.
Possible values: 0 ≤ value ≤ 9007199254740992
warning.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the result of a query find operation.
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Documents matching the selector.
Possible values: number of items ≥ 0
- docs
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for find query execution statistics.
- executionStats
Time to execute the query.
Number of results returned.
Possible values: 0 ≤ value ≤ 4294967295
Number of documents fetched from the index.
Possible values: 0 ≤ value ≤ 9007199254740992
Number of rows scanned in the index.
Possible values: 0 ≤ value ≤ 9007199254740992
Number of documents fetched from the primary index with the specified read quorum.
Possible values: 0 ≤ value ≤ 9007199254740992
warning.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the result of a query find operation.
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Documents matching the selector.
Possible values: number of items ≥ 0
- docs
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for find query execution statistics.
- execution_stats
Time to execute the query.
Number of results returned.
Possible values: 0 ≤ value ≤ 4294967295
Number of documents fetched from the index.
Possible values: 0 ≤ value ≤ 9007199254740992
Number of rows scanned in the index.
Possible values: 0 ≤ value ≤ 9007199254740992
Number of documents fetched from the primary index with the specified read quorum.
Possible values: 0 ≤ value ≤ 9007199254740992
warning.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Status Code
HTTP response for postFind.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example FindResult response.
{ "bookmark": "g1AAAABCeJzLYWBgYMpgSmHgKy5JLCrJTq2MT8lPzkzJBYqzJSYlGxoZg2Q5YLI5QHFGJMmsLABByhEQ", "docs": [ { "_id": "exampleid", "description": "A professional, high powered innovative kitchen tool", "email": "amelie.smith@aol.com", "name": "Amelie Smith", "productId": "1000043", "productName": "1100", "type": "user" }, { "_id": "exampleid2", "description": "New and improved kitchen blender", "email": "bob.smith@aol.com", "name": "Bob Smith", "productId": "1000044", "productName": "Pro System 3000", "type": "user" } ], "execution_stats": { "execution_time_ms": 4.37, "results_returned": 2, "total_docs_examined": 4, "total_keys_examined": 0, "total_quorum_docs_examined": 0 } }
Example FindResult response.
{ "bookmark": "g1AAAABCeJzLYWBgYMpgSmHgKy5JLCrJTq2MT8lPzkzJBYqzJSYlGxoZg2Q5YLI5QHFGJMmsLABByhEQ", "docs": [ { "_id": "exampleid", "description": "A professional, high powered innovative kitchen tool", "email": "amelie.smith@aol.com", "name": "Amelie Smith", "productId": "1000043", "productName": "1100", "type": "user" }, { "_id": "exampleid2", "description": "New and improved kitchen blender", "email": "bob.smith@aol.com", "name": "Bob Smith", "productId": "1000044", "productName": "Pro System 3000", "type": "user" } ], "execution_stats": { "execution_time_ms": 4.37, "results_returned": 2, "total_docs_examined": 4, "total_keys_examined": 0, "total_quorum_docs_examined": 0 } }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve information about all indexes
When you make a GET request to /db/_index
, you get a list of all the indexes using "language":"query"
in the database and the primary index. In addition to the information available through this API, the indexes are stored in the indexes
property of their respective design documents.
When you make a GET request to /db/_index
, you get a list of all the indexes using "language":"query"
in the database and the primary index. In addition to the information available through this API, the indexes are stored in the indexes
property of their respective design documents.
When you make a GET request to /db/_index
, you get a list of all the indexes using "language":"query"
in the database and the primary index. In addition to the information available through this API, the indexes are stored in the indexes
property of their respective design documents.
When you make a GET request to /db/_index
, you get a list of all the indexes using "language":"query"
in the database and the primary index. In addition to the information available through this API, the indexes are stored in the indexes
property of their respective design documents.
When you make a GET request to /db/_index
, you get a list of all the indexes using "language":"query"
in the database and the primary index. In addition to the information available through this API, the indexes are stored in the indexes
property of their respective design documents.
GET /{db}/_index
(cloudant *CloudantV1) GetIndexesInformation(getIndexesInformationOptions *GetIndexesInformationOptions) (result *IndexesInformation, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) GetIndexesInformationWithContext(ctx context.Context, getIndexesInformationOptions *GetIndexesInformationOptions) (result *IndexesInformation, response *core.DetailedResponse, err error)
ServiceCall<IndexesInformation> getIndexesInformation(GetIndexesInformationOptions getIndexesInformationOptions)
getIndexesInformation(params)
get_indexes_information(
self,
db: str,
**kwargs,
) -> DetailedResponse
Request
Instantiate the GetIndexesInformationOptions
struct and set the fields to provide parameter values for the GetIndexesInformation
method.
Use the GetIndexesInformationOptions.Builder
to create a GetIndexesInformationOptions
object that contains the parameter values for the getIndexesInformation
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The GetIndexesInformation options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
The getIndexesInformation options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/users/_index"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } getIndexesInformationOptions := service.NewGetIndexesInformationOptions( "users", ) indexesInformation, response, err := service.GetIndexesInformation(getIndexesInformationOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(indexesInformation, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.GetIndexesInformationOptions; import com.ibm.cloud.cloudant.v1.model.IndexesInformation;
Cloudant service = Cloudant.newInstance(); GetIndexesInformationOptions indexesInformationOptions = new GetIndexesInformationOptions.Builder() .db("users") .build(); IndexesInformation response = service.getIndexesInformation(indexesInformationOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.getIndexesInformation({ db: 'users' }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.get_indexes_information( db='users' ).get_result() print(response)
Response
Schema for information about the indexes in a database.
Total number of query indexes in the database.
Possible values: 0 ≤ value ≤ 4294967295
Indexes.
Possible values: 1 ≤ number of items ≤ 4294967295
Offset where the list started.
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for information about the indexes in a database.
Total number of query indexes in the database.
Possible values: 0 ≤ value ≤ 4294967295
Indexes.
Possible values: number of items ≥ 1
- Indexes
Schema for a nullable design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Schema for a
json
ortext
query index definition. Indexes of typetext
have additional configuration properties that do not apply tojson
indexes, these are:default_analyzer
- the default text analyzer to use *default_field
- whether to index the text in all document fields and what analyzer to use for that purpose.
- Def
Schema for a full text search analyzer.
- DefaultAnalyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the
$text
operator.- DefaultField
Schema for a full text search analyzer.
- Analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Whether or not the default_field is enabled.
List of field objects to index. Nested fields are also allowed, e.g.
person.name
.For "json" type indexes each object is a mapping of field name to sort direction (asc or desc).
For "text" type indexes each object has a
name
property of the field name and atype
property of the field type (string, number, or boolean).Possible values: 1 ≤ number of items ≤ 65535
- Fields
Name of the field.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The type of the named field.
Possible values: [
boolean
,number
,string
]
Whether to scan every document for arrays and store the length for each array found. Set the index_array_lengths field to false if:
- You do not need to know the length of an array. * You do not use the
$size
operator. * The documents in your database are complex, or not completely under your control. As a result, it is difficult to estimate the impact of the extra processing that is needed to determine and store the arrays lengths.
- You do not need to know the length of an array. * You do not use the
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$|^_all_docs$/
Indicates if index is partitioned.
Schema for the type of an index.
Possible values: [
json
,special
,text
]
Schema for information about the indexes in a database.
Total number of query indexes in the database.
Possible values: 0 ≤ value ≤ 4294967295
Indexes.
Possible values: number of items ≥ 1
- indexes
Schema for a nullable design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Schema for a
json
ortext
query index definition. Indexes of typetext
have additional configuration properties that do not apply tojson
indexes, these are:default_analyzer
- the default text analyzer to use *default_field
- whether to index the text in all document fields and what analyzer to use for that purpose.
- def
Schema for a full text search analyzer.
- defaultAnalyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the
$text
operator.- defaultField
Schema for a full text search analyzer.
- analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Whether or not the default_field is enabled.
List of field objects to index. Nested fields are also allowed, e.g.
person.name
.For "json" type indexes each object is a mapping of field name to sort direction (asc or desc).
For "text" type indexes each object has a
name
property of the field name and atype
property of the field type (string, number, or boolean).Possible values: 1 ≤ number of items ≤ 65535
- fields
Name of the field.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The type of the named field.
Possible values: [
boolean
,number
,string
]
Whether to scan every document for arrays and store the length for each array found. Set the index_array_lengths field to false if:
- You do not need to know the length of an array. * You do not use the
$size
operator. * The documents in your database are complex, or not completely under your control. As a result, it is difficult to estimate the impact of the extra processing that is needed to determine and store the arrays lengths.
- You do not need to know the length of an array. * You do not use the
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$|^_all_docs$/
Indicates if index is partitioned.
Schema for the type of an index.
Possible values: [
json
,special
,text
]
Schema for information about the indexes in a database.
Total number of query indexes in the database.
Possible values: 0 ≤ value ≤ 4294967295
Indexes.
Possible values: number of items ≥ 1
- indexes
Schema for a nullable design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Schema for a
json
ortext
query index definition. Indexes of typetext
have additional configuration properties that do not apply tojson
indexes, these are:default_analyzer
- the default text analyzer to use *default_field
- whether to index the text in all document fields and what analyzer to use for that purpose.
- def
Schema for a full text search analyzer.
- defaultAnalyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the
$text
operator.- defaultField
Schema for a full text search analyzer.
- analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Whether or not the default_field is enabled.
List of field objects to index. Nested fields are also allowed, e.g.
person.name
.For "json" type indexes each object is a mapping of field name to sort direction (asc or desc).
For "text" type indexes each object has a
name
property of the field name and atype
property of the field type (string, number, or boolean).Possible values: 1 ≤ number of items ≤ 65535
- fields
Name of the field.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The type of the named field.
Possible values: [
boolean
,number
,string
]
Whether to scan every document for arrays and store the length for each array found. Set the index_array_lengths field to false if:
- You do not need to know the length of an array. * You do not use the
$size
operator. * The documents in your database are complex, or not completely under your control. As a result, it is difficult to estimate the impact of the extra processing that is needed to determine and store the arrays lengths.
- You do not need to know the length of an array. * You do not use the
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$|^_all_docs$/
Indicates if index is partitioned.
Schema for the type of an index.
Possible values: [
json
,special
,text
]
Schema for information about the indexes in a database.
Total number of query indexes in the database.
Possible values: 0 ≤ value ≤ 4294967295
Indexes.
Possible values: number of items ≥ 1
- indexes
Schema for a nullable design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Schema for a
json
ortext
query index definition. Indexes of typetext
have additional configuration properties that do not apply tojson
indexes, these are:default_analyzer
- the default text analyzer to use *default_field
- whether to index the text in all document fields and what analyzer to use for that purpose.
- def_
Schema for a full text search analyzer.
- default_analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the
$text
operator.- default_field
Schema for a full text search analyzer.
- analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Whether or not the default_field is enabled.
List of field objects to index. Nested fields are also allowed, e.g.
person.name
.For "json" type indexes each object is a mapping of field name to sort direction (asc or desc).
For "text" type indexes each object has a
name
property of the field name and atype
property of the field type (string, number, or boolean).Possible values: 1 ≤ number of items ≤ 65535
- fields
Name of the field.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The type of the named field.
Possible values: [
boolean
,number
,string
]
Whether to scan every document for arrays and store the length for each array found. Set the index_array_lengths field to false if:
- You do not need to know the length of an array. * You do not use the
$size
operator. * The documents in your database are complex, or not completely under your control. As a result, it is difficult to estimate the impact of the extra processing that is needed to determine and store the arrays lengths.
- You do not need to know the length of an array. * You do not use the
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$|^_all_docs$/
Indicates if index is partitioned.
Schema for the type of an index.
Possible values: [
json
,special
,text
]
Status Code
HTTP response for
/{db}/_index
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example IndexInformation response.
{ "indexes": [ { "ddoc": null, "def": { "fields": [ { "_id": "asc" } ] }, "name": "_all_docs", "type": "special" }, { "ddoc": "_design/json-index", "def": { "fields": [ { "name": "asc" } ] }, "name": "getUserByName", "partitioned": false, "type": "json" } ], "total_rows": 2 }
Example IndexInformation response.
{ "indexes": [ { "ddoc": null, "def": { "fields": [ { "_id": "asc" } ] }, "name": "_all_docs", "type": "special" }, { "ddoc": "_design/json-index", "def": { "fields": [ { "name": "asc" } ] }, "name": "getUserByName", "partitioned": false, "type": "json" } ], "total_rows": 2 }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve HTTP headers for information about all indexes
Retrieves the HTTP headers for information about all indexes.
HEAD /{db}/_index
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for
/{db}/_index
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Create a new index on a database
Create a new index on a database.
Create a new index on a database.
Create a new index on a database.
Create a new index on a database.
Create a new index on a database.
POST /{db}/_index
(cloudant *CloudantV1) PostIndex(postIndexOptions *PostIndexOptions) (result *IndexResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostIndexWithContext(ctx context.Context, postIndexOptions *PostIndexOptions) (result *IndexResult, response *core.DetailedResponse, err error)
ServiceCall<IndexResult> postIndex(PostIndexOptions postIndexOptions)
postIndex(params)
post_index(
self,
db: str,
index: 'IndexDefinition',
*,
ddoc: Optional[str] = None,
name: Optional[str] = None,
partitioned: Optional[bool] = None,
type: Optional[str] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the PostIndexOptions
struct and set the fields to provide parameter values for the PostIndex
method.
Use the PostIndexOptions.Builder
to create a PostIndexOptions
object that contains the parameter values for the postIndex
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
HTTP request body for postIndex.
Example IndexConfiguration request.
{
"ddoc": "json-index",
"index": {
"fields": [
{
"name": "asc"
}
]
},
"name": "getUserByName",
"type": "json"
}
Schema for a
json
ortext
query index definition. Indexes of typetext
have additional configuration properties that do not apply tojson
indexes, these are:default_analyzer
- the default text analyzer to use *default_field
- whether to index the text in all document fields and what analyzer to use for that purpose.
Specifies the design document name in which the index will be created. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_design/].*$
name
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].*$
The default value is
true
for databases withpartitioned: true
andfalse
otherwise. For databases withpartitioned: false
if this option is specified the value must befalse
.Schema for the type of an index.
Allowable values: [
json
,special
,text
]
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The PostIndex options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Schema for a
json
ortext
query index definition. Indexes of typetext
have additional configuration properties that do not apply tojson
indexes, these are:default_analyzer
- the default text analyzer to use *default_field
- whether to index the text in all document fields and what analyzer to use for that purpose.
Examples:{ "fields": [ { "name": "asc" } ] }
- Index
Schema for a full text search analyzer.
- DefaultAnalyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Allowable values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the
$text
operator.- DefaultField
Schema for a full text search analyzer.
- Analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Allowable values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Whether or not the default_field is enabled.
Default:
true
List of field objects to index. Nested fields are also allowed, e.g.
person.name
.For "json" type indexes each object is a mapping of field name to sort direction (asc or desc).
For "text" type indexes each object has a
name
property of the field name and atype
property of the field type (string, number, or boolean).Possible values: 1 ≤ number of items ≤ 65535
- Fields
Name of the field.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The type of the named field.
Allowable values: [
boolean
,number
,string
]
Whether to scan every document for arrays and store the length for each array found. Set the index_array_lengths field to false if:
- You do not need to know the length of an array. * You do not use the
$size
operator. * The documents in your database are complex, or not completely under your control. As a result, it is difficult to estimate the impact of the extra processing that is needed to determine and store the arrays lengths.
Default:
true
- You do not need to know the length of an array. * You do not use the
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Specifies the design document name in which the index will be created. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_design\/].*$/
Examples:json-index
name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
Examples:getUserByName
The default value is
true
for databases withpartitioned: true
andfalse
otherwise. For databases withpartitioned: false
if this option is specified the value must befalse
.Schema for the type of an index.
Allowable values: [
json
,special
,text
]Examples:json
The postIndex options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Schema for a
json
ortext
query index definition. Indexes of typetext
have additional configuration properties that do not apply tojson
indexes, these are:default_analyzer
- the default text analyzer to use *default_field
- whether to index the text in all document fields and what analyzer to use for that purpose.
Examples:{ "fields": [ { "name": "asc" } ] }
- index
Schema for a full text search analyzer.
- defaultAnalyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Allowable values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the
$text
operator.- defaultField
Schema for a full text search analyzer.
- analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Allowable values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Whether or not the default_field is enabled.
Default:
true
List of field objects to index. Nested fields are also allowed, e.g.
person.name
.For "json" type indexes each object is a mapping of field name to sort direction (asc or desc).
For "text" type indexes each object has a
name
property of the field name and atype
property of the field type (string, number, or boolean).Possible values: 1 ≤ number of items ≤ 65535
- fields
Name of the field.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The type of the named field.
Allowable values: [
boolean
,number
,string
]
Whether to scan every document for arrays and store the length for each array found. Set the index_array_lengths field to false if:
- You do not need to know the length of an array. * You do not use the
$size
operator. * The documents in your database are complex, or not completely under your control. As a result, it is difficult to estimate the impact of the extra processing that is needed to determine and store the arrays lengths.
Default:
true
- You do not need to know the length of an array. * You do not use the
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Specifies the design document name in which the index will be created. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_design\/].*$/
Examples:json-index
name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
Examples:getUserByName
The default value is
true
for databases withpartitioned: true
andfalse
otherwise. For databases withpartitioned: false
if this option is specified the value must befalse
.Schema for the type of an index.
Allowable values: [
json
,special
,text
]Examples:json
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Schema for a
json
ortext
query index definition. Indexes of typetext
have additional configuration properties that do not apply tojson
indexes, these are:default_analyzer
- the default text analyzer to use *default_field
- whether to index the text in all document fields and what analyzer to use for that purpose.
- index
Schema for a full text search analyzer.
- defaultAnalyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Allowable values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the
$text
operator.- defaultField
Schema for a full text search analyzer.
- analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Allowable values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Whether or not the default_field is enabled.
Default:
true
List of field objects to index. Nested fields are also allowed, e.g.
person.name
.For "json" type indexes each object is a mapping of field name to sort direction (asc or desc).
For "text" type indexes each object has a
name
property of the field name and atype
property of the field type (string, number, or boolean).Possible values: 1 ≤ number of items ≤ 65535
- fields
Name of the field.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The type of the named field.
Allowable values: [
boolean
,number
,string
]
Whether to scan every document for arrays and store the length for each array found. Set the index_array_lengths field to false if:
- You do not need to know the length of an array. * You do not use the
$size
operator. * The documents in your database are complex, or not completely under your control. As a result, it is difficult to estimate the impact of the extra processing that is needed to determine and store the arrays lengths.
Default:
true
- You do not need to know the length of an array. * You do not use the
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Specifies the design document name in which the index will be created. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_design\/].*$/
Examples:name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
Examples:The default value is
true
for databases withpartitioned: true
andfalse
otherwise. For databases withpartitioned: false
if this option is specified the value must befalse
.Schema for the type of an index.
Allowable values: [
json
,special
,text
]Examples:
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Schema for a
json
ortext
query index definition. Indexes of typetext
have additional configuration properties that do not apply tojson
indexes, these are:default_analyzer
- the default text analyzer to use *default_field
- whether to index the text in all document fields and what analyzer to use for that purpose.
- index
Schema for a full text search analyzer.
- default_analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Allowable values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the
$text
operator.- default_field
Schema for a full text search analyzer.
- analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Allowable values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Whether or not the default_field is enabled.
Default:
true
List of field objects to index. Nested fields are also allowed, e.g.
person.name
.For "json" type indexes each object is a mapping of field name to sort direction (asc or desc).
For "text" type indexes each object has a
name
property of the field name and atype
property of the field type (string, number, or boolean).Possible values: 1 ≤ number of items ≤ 65535
- fields
Name of the field.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The type of the named field.
Allowable values: [
boolean
,number
,string
]
Whether to scan every document for arrays and store the length for each array found. Set the index_array_lengths field to false if:
- You do not need to know the length of an array. * You do not use the
$size
operator. * The documents in your database are complex, or not completely under your control. As a result, it is difficult to estimate the impact of the extra processing that is needed to determine and store the arrays lengths.
Default:
true
- You do not need to know the length of an array. * You do not use the
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Specifies the design document name in which the index will be created. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_design\/].*$/
Examples:name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
Examples:The default value is
true
for databases withpartitioned: true
andfalse
otherwise. For databases withpartitioned: false
if this option is specified the value must befalse
.Schema for the type of an index.
Allowable values: [
json
,special
,text
]Examples:
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X POST "$SERVICE_URL/users/_index" -H "Content-Type: application/json" --data '{ "ddoc": "json-index", "index": { "fields": [{ "email": "asc" }] }, "name": "getUserByEmail", "type": "json" }'
Type "json" index fields require an object that maps the name of a field to a sort direction.
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X POST "$SERVICE_URL/users/_index" -H "Content-Type: application/json" --data '{ "ddoc": "text-index", "index": { "fields": [{ "name": "address", "type": "string" }] }, "name": "getUserByAddress", "type": "text" }'
Type "text" index fields require an object with a name and type properties for the field.
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" "github.com/IBM/go-sdk-core/v5/core" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } // Type "json" index fields require an object that maps the name of a field to a sort direction. var indexField cloudantv1.IndexField indexField.SetProperty("email", core.StringPtr("asc")) postIndexOptions := service.NewPostIndexOptions( "users", &cloudantv1.IndexDefinition{ Fields: []cloudantv1.IndexField{ indexField, }, }, ) postIndexOptions.SetDdoc("json-index") postIndexOptions.SetName("getUserByEmail") postIndexOptions.SetType("json") indexResult, response, err := service.PostIndex(postIndexOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(indexResult, "", " ") fmt.Println(string(b))
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" "github.com/IBM/go-sdk-core/v5/core" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } // Type "text" index fields require an object with a name and type properties for the field. var indexField cloudantv1.IndexField indexField.SetProperty("name", core.StringPtr("address")) indexField.SetProperty("type", core.StringPtr("string")) postIndexOptions := service.NewPostIndexOptions( "users", &cloudantv1.IndexDefinition{ Fields: []cloudantv1.IndexField{ indexField, }, }, ) postIndexOptions.SetDdoc("text-index") postIndexOptions.SetName("getUserByAddress") postIndexOptions.SetType("text") indexResult, response, err := service.PostIndex(postIndexOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(indexResult, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.IndexDefinition; import com.ibm.cloud.cloudant.v1.model.IndexField; import com.ibm.cloud.cloudant.v1.model.IndexResult; import com.ibm.cloud.cloudant.v1.model.PostIndexOptions;
Cloudant service = Cloudant.newInstance(); // Type "json" index fields require an object that maps the name of a field to a sort direction. IndexField field = new IndexField.Builder() .add("email", "asc") .build(); IndexDefinition indexDefinition = new IndexDefinition.Builder() .addFields(field) .build(); PostIndexOptions indexOptions = new PostIndexOptions.Builder() .db("users") .ddoc("json-index") .index(indexDefinition) .name("getUserByEmail") .type("json") .build(); IndexResult response = service.postIndex(indexOptions).execute() .getResult(); System.out.println(response);
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.IndexDefinition; import com.ibm.cloud.cloudant.v1.model.IndexField; import com.ibm.cloud.cloudant.v1.model.IndexResult; import com.ibm.cloud.cloudant.v1.model.PostIndexOptions;
Cloudant service = Cloudant.newInstance(); // Type "text" index fields require an object with a name and type properties for the field. IndexField field = new IndexField.Builder() .add("name", "address") .add("type", "string") .build(); IndexDefinition indexDefinition = new IndexDefinition.Builder() .addFields(field) .build(); PostIndexOptions indexOptions = new PostIndexOptions.Builder() .db("users") .ddoc("text-index") .index(indexDefinition) .name("getUserByAddress") .type("text") .build(); IndexResult response = service.postIndex(indexOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); // Type "json" index fields require an object that maps the name of a field to a sort direction. const indexField: CloudantV1.IndexField = { email: 'asc' } const index: CloudantV1.IndexDefinition = { fields: [indexField] } service.postIndex({ db: 'users', ddoc: 'json-index', name: 'getUserByEmail', index: index, type: 'json' }).then(response => { console.log(response.result); });
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); // Type "text" index fields require an object with a name and type properties for the field. const indexField: CloudantV1.IndexField = { name: 'address', type: 'string' } const index: CloudantV1.IndexDefinition = { fields: [indexField] } service.postIndex({ db: 'users', ddoc: 'text-index', name: 'getUserByAddress', index: index, type: 'text' }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1, IndexDefinition, IndexField service = CloudantV1.new_instance() # Type "json" index fields require an object that maps the name of a field to a sort direction. index_field = IndexField( email="asc" ) index = IndexDefinition( fields=[index_field] ) response = service.post_index( db='users', ddoc='json-index', name='getUserByEmail', index=index, type='json' ).get_result() print(response)
from ibmcloudant.cloudant_v1 import CloudantV1, IndexDefinition, IndexField service = CloudantV1.new_instance() # Type "text" index fields require an object with a name and type properties for the field. index_field = IndexField( name="address", type="string" ) index = IndexDefinition( fields=[index_field] ) response = service.post_index( db='users', ddoc='text-index', name='getUserByAddress', index=index, type='text' ).get_result() print(response)
Response
Schema for the result of creating an index.
Id of the design document the index was created in.
Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
^_design\/.+$
Name of the index created.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Flag to show whether the index was created or one already exists.
Possible values: [
created
,exists
]
Schema for the result of creating an index.
Id of the design document the index was created in.
Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Name of the index created.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Flag to show whether the index was created or one already exists.
Possible values: [
created
,exists
]
Schema for the result of creating an index.
Id of the design document the index was created in.
Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Name of the index created.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Flag to show whether the index was created or one already exists.
Possible values: [
created
,exists
]
Schema for the result of creating an index.
Id of the design document the index was created in.
Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Name of the index created.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Flag to show whether the index was created or one already exists.
Possible values: [
created
,exists
]
Schema for the result of creating an index.
Id of the design document the index was created in.
Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Name of the index created.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Flag to show whether the index was created or one already exists.
Possible values: [
created
,exists
]
Status Code
HTTP response for postIndex.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example IndexResult response.
{ "id": "_design/json-index", "name": "getUserByName", "result": "created" }
Example IndexResult response.
{ "id": "_design/json-index", "name": "getUserByName", "result": "created" }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Delete an index
Delete the index functions from the design document and index files on the server.
Delete the index functions from the design document and index files on the server.
Delete the index functions from the design document and index files on the server.
Delete the index functions from the design document and index files on the server.
Delete the index functions from the design document and index files on the server.
DELETE /{db}/_index/_design/{ddoc}/{type}/{index}
(cloudant *CloudantV1) DeleteIndex(deleteIndexOptions *DeleteIndexOptions) (result *Ok, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) DeleteIndexWithContext(ctx context.Context, deleteIndexOptions *DeleteIndexOptions) (result *Ok, response *core.DetailedResponse, err error)
ServiceCall<Ok> deleteIndex(DeleteIndexOptions deleteIndexOptions)
deleteIndex(params)
delete_index(
self,
db: str,
ddoc: str,
type: str,
index: str,
**kwargs,
) -> DetailedResponse
Request
Instantiate the DeleteIndexOptions
struct and set the fields to provide parameter values for the DeleteIndex
method.
Use the DeleteIndexOptions.Builder
to create a DeleteIndexOptions
object that contains the parameter values for the deleteIndex
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Path parameter to specify the index type.
Allowable values: [
json
,special
,text
]Path parameter to specify the index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The DeleteIndex options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the index type.
Allowable values: [
json
,special
,text
]Path parameter to specify the index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The deleteIndex options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the index type.
Allowable values: [
json
,special
,text
]Path parameter to specify the index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the index type.
Allowable values: [
json
,special
,text
]Path parameter to specify the index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the index type.
Allowable values: [
json
,special
,text
]Path parameter to specify the index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X DELETE "$SERVICE_URL/users/_index/_design/json-index/json/getUserByName"
This example will fail if
getUserByName
index doesn't exist. To create the index, see Create a new index on a database.
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } deleteIndexOptions := service.NewDeleteIndexOptions( "users", "json-index", "json", "getUserByName", ) ok, response, err := service.DeleteIndex(deleteIndexOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(ok, "", " ") fmt.Println(string(b))
This example will fail if
getUserByName
index doesn't exist. To create the index, see Create a new index on a database.
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.DeleteIndexOptions; import com.ibm.cloud.cloudant.v1.model.Ok;
Cloudant service = Cloudant.newInstance(); DeleteIndexOptions indexOptions = new DeleteIndexOptions.Builder() .db("users") .ddoc("json-index") .index("getUserByName") .type("json") .build(); Ok response = service.deleteIndex(indexOptions).execute() .getResult(); System.out.println(response);
This example will fail if
getUserByName
index doesn't exist. To create the index, see Create a new index on a database.
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.deleteIndex({ db: 'users', ddoc: 'json-index', index: 'getUserByName', type: 'json' }).then(response => { console.log(response.result); });
This example will fail if
getUserByName
index doesn't exist. To create the index, see Create a new index on a database.
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.delete_index( db='users', ddoc='json-index', index='getUserByName', type='json' ).get_result() print(response)
This example will fail if
getUserByName
index doesn't exist. To create the index, see Create a new index on a database.
Response
Schema for an OK result.
ok
Schema for an OK result.
ok.
Schema for an OK result.
ok.
Schema for an OK result.
ok.
Schema for an OK result.
ok.
Status Code
HTTP response for Ok operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example Ok response.
{ "ok": true }
Example Ok response.
{ "ok": true }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve information about which partition index is used for a query
Shows which index is being used by the query. Parameters
are the same as the
/{db}/_partition/{partition_key}/_find
endpoint.
Shows which index is being used by the query. Parameters are the same as the
/{db}/_partition/{partition_key}/_find
endpoint.
Shows which index is being used by the query. Parameters are the same as the
/{db}/_partition/{partition_key}/_find
endpoint.
Shows which index is being used by the query. Parameters are the same as the
/{db}/_partition/{partition_key}/_find
endpoint.
Shows which index is being used by the query. Parameters are the same as the
/{db}/_partition/{partition_key}/_find
endpoint.
POST /{db}/_partition/{partition_key}/_explain
(cloudant *CloudantV1) PostPartitionExplain(postPartitionExplainOptions *PostPartitionExplainOptions) (result *ExplainResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostPartitionExplainWithContext(ctx context.Context, postPartitionExplainOptions *PostPartitionExplainOptions) (result *ExplainResult, response *core.DetailedResponse, err error)
ServiceCall<ExplainResult> postPartitionExplain(PostPartitionExplainOptions postPartitionExplainOptions)
postPartitionExplain(params)
post_partition_explain(
self,
db: str,
partition_key: str,
selector: dict,
*,
allow_fallback: Optional[bool] = None,
bookmark: Optional[str] = None,
conflicts: Optional[bool] = None,
execution_stats: Optional[bool] = None,
fields: Optional[List[str]] = None,
limit: Optional[int] = None,
skip: Optional[int] = None,
sort: Optional[List[dict]] = None,
stable: Optional[bool] = None,
update: Optional[str] = None,
use_index: Optional[List[str]] = None,
**kwargs,
) -> DetailedResponse
Auditing
Calling this method generates the following auditing event.
cloudantnosqldb.any-document.read
Rate limit
This operation consumes 0.01 read
requests per row read from the index (rounded up) and one further read for each document read. Additional document reads occur if the selector includes unindexed fields or if the projected values cannot be read from the index row. If no rows are read, the minimum cost is 1 read
.
Request
Instantiate the PostPartitionExplainOptions
struct and set the fields to provide parameter values for the PostPartitionExplain
method.
Use the PostPartitionExplainOptions.Builder
to create a PostPartitionExplainOptions
object that contains the parameter values for the postPartitionExplain
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_:][^:]*$
HTTP request body for postPartitionFind.
Example PartitionFindQuery request.
{
"fields": [
"productid",
"name",
"description"
],
"selector": {
"type": {
"$eq": "product"
}
}
}
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate
the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax
- selector
Whether to allow fallback to other indexes. Default is true.
Default:
true
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
^[A-Za-z0-9=_-]*$
A boolean value that indicates whether or not to include information about existing conflicts in the document.
Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when
include_docs=true
is used), and total quorum document lookups (when each document replica is fetched).JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Maximum number of results returned. The
type: text
indexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25
Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740992
The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields.
For example in JSON:
[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]
When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields must use the same sort direction, either all ascending or all descending.
Possible values: 0 ≤ number of items ≤ 65535
- sort
Schema for sort direction.
Allowable values: [
asc
,desc
]Default:
asc
Whether or not the view results should be returned from a "stable" set of shards.
Whether to update the index prior to returning the result.
Allowable values: [
false
,true
,lazy
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Default:
true
Use this option to identify a specific index to answer the query, rather than letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id followed by index name, for example
["my_design_doc", "my_index"]
.It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later.
If the specified index doesn't exist or can't answer the query then the server ignores the value and answers using another index or a full scan of all documents. To change this behavior set
allow_fallback
tofalse
and the server responds instead with a400
status code if the requested index is unsuitable to answer the query.Possible values: number of items = 2, 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The PostPartitionExplain options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Examples:{ "type": { "$eq": "product" } }
Whether to allow fallback to other indexes. Default is true.
Default:
true
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
A boolean value that indicates whether or not to include information about existing conflicts in the document.
Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when
include_docs=true
is used), and total quorum document lookups (when each document replica is fetched).JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Examples:[ "productid", "name", "description" ]
Maximum number of results returned. The
type: text
indexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25
Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740992
The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields.
For example in JSON:
[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]
When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields must use the same sort direction, either all ascending or all descending.
Allowable values: [
asc
,desc
]Possible values: 0 ≤ number of items ≤ 65535
Whether or not the view results should be returned from a "stable" set of shards.
Whether to update the index prior to returning the result.
Allowable values: [
false
,true
,lazy
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Default:
true
Use this option to identify a specific index to answer the query, rather than letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id followed by index name, for example
["my_design_doc", "my_index"]
.It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later.
If the specified index doesn't exist or can't answer the query then the server ignores the value and answers using another index or a full scan of all documents. To change this behavior set
allow_fallback
tofalse
and the server responds instead with a400
status code if the requested index is unsuitable to answer the query.Possible values: number of items = 2, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The postPartitionExplain options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Examples:{ "type": { "$eq": "product" } }
Whether to allow fallback to other indexes. Default is true.
Default:
true
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
A boolean value that indicates whether or not to include information about existing conflicts in the document.
Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when
include_docs=true
is used), and total quorum document lookups (when each document replica is fetched).JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Examples:[ "productid", "name", "description" ]
Maximum number of results returned. The
type: text
indexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25
Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740992
The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields.
For example in JSON:
[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]
When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields must use the same sort direction, either all ascending or all descending.
Allowable values: [
asc
,desc
]Possible values: 0 ≤ number of items ≤ 65535
Whether or not the view results should be returned from a "stable" set of shards.
Whether to update the index prior to returning the result.
Allowable values: [
false
,true
,lazy
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Default:
true
Use this option to identify a specific index to answer the query, rather than letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id followed by index name, for example
["my_design_doc", "my_index"]
.It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later.
If the specified index doesn't exist or can't answer the query then the server ignores the value and answers using another index or a full scan of all documents. To change this behavior set
allow_fallback
tofalse
and the server responds instead with a400
status code if the requested index is unsuitable to answer the query.Possible values: number of items = 2, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Examples:Whether to allow fallback to other indexes. Default is true.
Default:
true
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
A boolean value that indicates whether or not to include information about existing conflicts in the document.
Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when
include_docs=true
is used), and total quorum document lookups (when each document replica is fetched).JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Examples:Maximum number of results returned. The
type: text
indexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25
Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740992
The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields.
For example in JSON:
[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]
When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields must use the same sort direction, either all ascending or all descending.
Allowable values: [
asc
,desc
]Possible values: 0 ≤ number of items ≤ 65535
Whether or not the view results should be returned from a "stable" set of shards.
Whether to update the index prior to returning the result.
Allowable values: [
false
,true
,lazy
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Default:
true
Use this option to identify a specific index to answer the query, rather than letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id followed by index name, for example
["my_design_doc", "my_index"]
.It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later.
If the specified index doesn't exist or can't answer the query then the server ignores the value and answers using another index or a full scan of all documents. To change this behavior set
allow_fallback
tofalse
and the server responds instead with a400
status code if the requested index is unsuitable to answer the query.Possible values: number of items = 2, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Examples:Whether to allow fallback to other indexes. Default is true.
Default:
true
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
A boolean value that indicates whether or not to include information about existing conflicts in the document.
Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when
include_docs=true
is used), and total quorum document lookups (when each document replica is fetched).JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Examples:Maximum number of results returned. The
type: text
indexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25
Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740992
The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields.
For example in JSON:
[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]
When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields must use the same sort direction, either all ascending or all descending.
Allowable values: [
asc
,desc
]Possible values: 0 ≤ number of items ≤ 65535
Whether or not the view results should be returned from a "stable" set of shards.
Whether to update the index prior to returning the result.
Allowable values: [
false
,true
,lazy
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Default:
true
Use this option to identify a specific index to answer the query, rather than letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id followed by index name, for example
["my_design_doc", "my_index"]
.It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later.
If the specified index doesn't exist or can't answer the query then the server ignores the value and answers using another index or a full scan of all documents. To change this behavior set
allow_fallback
tofalse
and the server responds instead with a400
status code if the requested index is unsuitable to answer the query.Possible values: number of items = 2, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } selector := map[string]interface{}{ "userId": map[string]string{ "$eq": "abc123", }, } postPartitionExplainOptions := service.NewPostPartitionExplainOptions( "events", "ns1HJS13AMkK", selector, ) postExplainOptions.SetExecutionStats(true) postExplainOptions.SetLimit(10) explainResult, response, err := service.PostPartitionExplain(postPartitionExplainOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(explainResult, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.ExplainResult; import com.ibm.cloud.cloudant.v1.model.PostPartitionExplainOptions; import java.util.Collections; import java.util.Map;
Cloudant service = Cloudant.newInstance(); Map<String, Object> selector = Collections.singletonMap( "userId", Collections.singletonMap("$eq", "abc123")); PostPartitionExplainOptions explainOptions = new PostPartitionExplainOptions.Builder() .db("events") .executionStats(true) .limit(10) .partitionKey("ns1HJS13AMkK") .selector(selector) .build(); ExplainResult response = service.postPartitionExplain(explainOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); const selector: CloudantV1.Selector = { userId: {'$eq': 'abc123'} } service.postPartitionExplain({ db: 'events', executionStats: true, limit: 10, partitionKey: 'ns1HJS13AMkK', selector: selector }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.post_partition_explain( db='events', execution_stats=True, limit=10, partition_key='ns1HJS13AMkK', selector={'userId': {'$eq': 'abc123'}} ).get_result() print(response)
Response
Schema for information about the index used for a find query.
When
true
, the query is answered using the index only and no documents are fetched.Schema for a database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Fields that were requested to be projected from the document. If no fields were requested to be projected this will be empty and all fields will be returned.
Possible values: 0 ≤ number of items ≤ 4294967295, 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Schema for information about an index.
Schema for the list of all the other indexes that were not chosen for serving the query.
Possible values: 0 ≤ number of items ≤ 4294967295
The used maximum number of results returned.
Possible values: 0 ≤ value ≤ 4294967295
Options used for the request.
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate
the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax
- selector
Schema for a list of objects with extra information on the selector to provide insights about its usability.
Possible values: 1 ≤ number of items ≤ 3
Skip parameter used.
Possible values: 0 ≤ value ≤ 9007199254740992
Arguments passed to the underlying view.
Schema for any JSON type
Schema for information about the index used for a find query.
When
true
, the query is answered using the index only and no documents are fetched.Schema for a database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Fields that were requested to be projected from the document. If no fields were requested to be projected this will be empty and all fields will be returned.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for information about an index.
- Index
Schema for a nullable design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Schema for a
json
ortext
query index definition. Indexes of typetext
have additional configuration properties that do not apply tojson
indexes, these are:default_analyzer
- the default text analyzer to use *default_field
- whether to index the text in all document fields and what analyzer to use for that purpose.
- Def
Schema for a full text search analyzer.
- DefaultAnalyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the
$text
operator.- DefaultField
Schema for a full text search analyzer.
- Analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Whether or not the default_field is enabled.
List of field objects to index. Nested fields are also allowed, e.g.
person.name
.For "json" type indexes each object is a mapping of field name to sort direction (asc or desc).
For "text" type indexes each object has a
name
property of the field name and atype
property of the field type (string, number, or boolean).Possible values: 1 ≤ number of items ≤ 65535
- Fields
Name of the field.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The type of the named field.
Possible values: [
boolean
,number
,string
]
Whether to scan every document for arrays and store the length for each array found. Set the index_array_lengths field to false if:
- You do not need to know the length of an array. * You do not use the
$size
operator. * The documents in your database are complex, or not completely under your control. As a result, it is difficult to estimate the impact of the extra processing that is needed to determine and store the arrays lengths.
- You do not need to know the length of an array. * You do not use the
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$|^_all_docs$/
Indicates if index is partitioned.
Schema for the type of an index.
Possible values: [
json
,special
,text
]
Schema for the list of all the other indexes that were not chosen for serving the query.
Possible values: number of items ≥ 0
- IndexCandidates
Schema for detailed explanation of why the specific index was excluded by the query planner.
- Analysis
When
true
, the query is answered using the index only and no documents are fetched.A position of the unused index based on its potential relevance to the query.
Possible values: 1 ≤ value ≤ 4294967295
A list of reasons explaining why index was not chosen for the query.
Possible values: number of items ≥ 1
- Reasons
A reason code for index's exclusion.
The full list of possible reason codes is following:
- alphabetically_comes_after: json There is another suitable index whose name comes before that of this index.
- empty_selector: text "text" indexes do not support queries with empty selectors.
- excluded_by_user: any use_index was used to manually specify the index.
- field_mismatch: any Fields in "selector" of the query do match with the fields available in the index.
- is_partial: json, text Partial indexes can be selected only manually.
- less_overlap: json There is a better match of fields available within the indexes for the query.
- needs_text_search: json The use of the $text operator requires a "text" index.
- scope_mismatch: json The scope of the query and the index is not the same.
- sort_order_mismatch: json, special Fields in "sort" of the query do not match with the fields available in the index.
- too_many_fields: json The index has more fields than the chosen one.
- unfavored_type: any The type of the index is not preferred.
Possible values: [
alphabetically_comes_after
,empty_selector
,excluded_by_user
,field_mismatch
,is_partial
,less_overlap
,needs_text_search
,scope_mismatch
,sort_order_mismatch
,too_many_fields
,unfavored_type
]
Indicates whether an index can still be used for the query.
Schema for information about an index.
- Index
Schema for a nullable design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Schema for a
json
ortext
query index definition. Indexes of typetext
have additional configuration properties that do not apply tojson
indexes, these are:default_analyzer
- the default text analyzer to use *default_field
- whether to index the text in all document fields and what analyzer to use for that purpose.
- Def
Schema for a full text search analyzer.
- DefaultAnalyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the
$text
operator.- DefaultField
Schema for a full text search analyzer.
- Analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Whether or not the default_field is enabled.
List of field objects to index. Nested fields are also allowed, e.g.
person.name
.For "json" type indexes each object is a mapping of field name to sort direction (asc or desc).
For "text" type indexes each object has a
name
property of the field name and atype
property of the field type (string, number, or boolean).Possible values: 1 ≤ number of items ≤ 65535
- Fields
Name of the field.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The type of the named field.
Possible values: [
boolean
,number
,string
]
Whether to scan every document for arrays and store the length for each array found. Set the index_array_lengths field to false if:
- You do not need to know the length of an array. * You do not use the
$size
operator. * The documents in your database are complex, or not completely under your control. As a result, it is difficult to estimate the impact of the extra processing that is needed to determine and store the arrays lengths.
- You do not need to know the length of an array. * You do not use the
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$|^_all_docs$/
Indicates if index is partitioned.
Schema for the type of an index.
Possible values: [
json
,special
,text
]
The used maximum number of results returned.
Possible values: 0 ≤ value ≤ 4294967295
Arguments passed to the underlying view.
- Mrargs
Schema for any JSON type.
Direction parameter passed to the underlying view.
Possible values: [
fwd
,rev
]Schema for any JSON type.
A parameter that specifies whether to include the full content of the documents in the response in the underlying view.
Partition parameter passed to the underlying view.
Possible values: 0 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
A parameter that specifies returning only documents that match any of the specified keys in the underlying view.
A parameter that specifies whether the view results should be returned form a "stable" set of shards passed to the underlying view.
Schema for any JSON type.
Schema for any JSON type.
The type of the underlying view.
Possible values: [
map
,reduce
]
Options used for the request.
- Opts
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Conflicts used in the request query.
Execution statistics used in the request query.
JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Limit used in the request query.
Possible values: 0 ≤ value ≤ 4294967295
On which database partition the request was used. If it was not used on a database partition, it returns with
""
.Possible values: 0 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
The read quorum that is needed for the result.
Possible values: 1 ≤ value ≤ 3
Skip used in the request query.
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for any JSON type.
Stable used in the request query.
Stale used in the request query.
Update used in the request query.
Use index used in the request query.
Possible values: 0 ≤ number of items ≤ 2, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for any JSON type.
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Schema for a list of objects with extra information on the selector to provide insights about its usability.
Possible values: 1 ≤ number of items ≤ 3
- SelectorHints
A list of fields in the given selector that can be used to restrict the query.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
A type of the index.
Possible values: [
json
,text
]A list of fields in the given selector that can't be used to restrict the query.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Skip parameter used.
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for information about the index used for a find query.
When
true
, the query is answered using the index only and no documents are fetched.Schema for a database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Fields that were requested to be projected from the document. If no fields were requested to be projected this will be empty and all fields will be returned.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for information about an index.
- index
Schema for a nullable design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Schema for a
json
ortext
query index definition. Indexes of typetext
have additional configuration properties that do not apply tojson
indexes, these are:default_analyzer
- the default text analyzer to use *default_field
- whether to index the text in all document fields and what analyzer to use for that purpose.
- def
Schema for a full text search analyzer.
- defaultAnalyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the
$text
operator.- defaultField
Schema for a full text search analyzer.
- analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Whether or not the default_field is enabled.
List of field objects to index. Nested fields are also allowed, e.g.
person.name
.For "json" type indexes each object is a mapping of field name to sort direction (asc or desc).
For "text" type indexes each object has a
name
property of the field name and atype
property of the field type (string, number, or boolean).Possible values: 1 ≤ number of items ≤ 65535
- fields
Name of the field.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The type of the named field.
Possible values: [
boolean
,number
,string
]
Whether to scan every document for arrays and store the length for each array found. Set the index_array_lengths field to false if:
- You do not need to know the length of an array. * You do not use the
$size
operator. * The documents in your database are complex, or not completely under your control. As a result, it is difficult to estimate the impact of the extra processing that is needed to determine and store the arrays lengths.
- You do not need to know the length of an array. * You do not use the
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$|^_all_docs$/
Indicates if index is partitioned.
Schema for the type of an index.
Possible values: [
json
,special
,text
]
Schema for the list of all the other indexes that were not chosen for serving the query.
Possible values: number of items ≥ 0
- indexCandidates
Schema for detailed explanation of why the specific index was excluded by the query planner.
- analysis
When
true
, the query is answered using the index only and no documents are fetched.A position of the unused index based on its potential relevance to the query.
Possible values: 1 ≤ value ≤ 4294967295
A list of reasons explaining why index was not chosen for the query.
Possible values: number of items ≥ 1
- reasons
A reason code for index's exclusion.
The full list of possible reason codes is following:
- alphabetically_comes_after: json There is another suitable index whose name comes before that of this index.
- empty_selector: text "text" indexes do not support queries with empty selectors.
- excluded_by_user: any use_index was used to manually specify the index.
- field_mismatch: any Fields in "selector" of the query do match with the fields available in the index.
- is_partial: json, text Partial indexes can be selected only manually.
- less_overlap: json There is a better match of fields available within the indexes for the query.
- needs_text_search: json The use of the $text operator requires a "text" index.
- scope_mismatch: json The scope of the query and the index is not the same.
- sort_order_mismatch: json, special Fields in "sort" of the query do not match with the fields available in the index.
- too_many_fields: json The index has more fields than the chosen one.
- unfavored_type: any The type of the index is not preferred.
Possible values: [
alphabetically_comes_after
,empty_selector
,excluded_by_user
,field_mismatch
,is_partial
,less_overlap
,needs_text_search
,scope_mismatch
,sort_order_mismatch
,too_many_fields
,unfavored_type
]
Indicates whether an index can still be used for the query.
Schema for information about an index.
- index
Schema for a nullable design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Schema for a
json
ortext
query index definition. Indexes of typetext
have additional configuration properties that do not apply tojson
indexes, these are:default_analyzer
- the default text analyzer to use *default_field
- whether to index the text in all document fields and what analyzer to use for that purpose.
- def
Schema for a full text search analyzer.
- defaultAnalyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the
$text
operator.- defaultField
Schema for a full text search analyzer.
- analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Whether or not the default_field is enabled.
List of field objects to index. Nested fields are also allowed, e.g.
person.name
.For "json" type indexes each object is a mapping of field name to sort direction (asc or desc).
For "text" type indexes each object has a
name
property of the field name and atype
property of the field type (string, number, or boolean).Possible values: 1 ≤ number of items ≤ 65535
- fields
Name of the field.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The type of the named field.
Possible values: [
boolean
,number
,string
]
Whether to scan every document for arrays and store the length for each array found. Set the index_array_lengths field to false if:
- You do not need to know the length of an array. * You do not use the
$size
operator. * The documents in your database are complex, or not completely under your control. As a result, it is difficult to estimate the impact of the extra processing that is needed to determine and store the arrays lengths.
- You do not need to know the length of an array. * You do not use the
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$|^_all_docs$/
Indicates if index is partitioned.
Schema for the type of an index.
Possible values: [
json
,special
,text
]
The used maximum number of results returned.
Possible values: 0 ≤ value ≤ 4294967295
Arguments passed to the underlying view.
- mrargs
Schema for any JSON type.
Direction parameter passed to the underlying view.
Possible values: [
fwd
,rev
]Schema for any JSON type.
A parameter that specifies whether to include the full content of the documents in the response in the underlying view.
Partition parameter passed to the underlying view.
Possible values: 0 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
A parameter that specifies returning only documents that match any of the specified keys in the underlying view.
A parameter that specifies whether the view results should be returned form a "stable" set of shards passed to the underlying view.
Schema for any JSON type.
Schema for any JSON type.
The type of the underlying view.
Possible values: [
map
,reduce
]
Options used for the request.
- opts
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Conflicts used in the request query.
Execution statistics used in the request query.
JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Limit used in the request query.
Possible values: 0 ≤ value ≤ 4294967295
On which database partition the request was used. If it was not used on a database partition, it returns with
""
.Possible values: 0 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
The read quorum that is needed for the result.
Possible values: 1 ≤ value ≤ 3
Skip used in the request query.
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for any JSON type.
Stable used in the request query.
Stale used in the request query.
Update used in the request query.
Use index used in the request query.
Possible values: 0 ≤ number of items ≤ 2, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for any JSON type.
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Schema for a list of objects with extra information on the selector to provide insights about its usability.
Possible values: 1 ≤ number of items ≤ 3
- selectorHints
A list of fields in the given selector that can be used to restrict the query.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
A type of the index.
Possible values: [
json
,text
]A list of fields in the given selector that can't be used to restrict the query.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Skip parameter used.
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for information about the index used for a find query.
When
true
, the query is answered using the index only and no documents are fetched.Schema for a database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Fields that were requested to be projected from the document. If no fields were requested to be projected this will be empty and all fields will be returned.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for information about an index.
- index
Schema for a nullable design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Schema for a
json
ortext
query index definition. Indexes of typetext
have additional configuration properties that do not apply tojson
indexes, these are:default_analyzer
- the default text analyzer to use *default_field
- whether to index the text in all document fields and what analyzer to use for that purpose.
- def
Schema for a full text search analyzer.
- defaultAnalyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the
$text
operator.- defaultField
Schema for a full text search analyzer.
- analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Whether or not the default_field is enabled.
List of field objects to index. Nested fields are also allowed, e.g.
person.name
.For "json" type indexes each object is a mapping of field name to sort direction (asc or desc).
For "text" type indexes each object has a
name
property of the field name and atype
property of the field type (string, number, or boolean).Possible values: 1 ≤ number of items ≤ 65535
- fields
Name of the field.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The type of the named field.
Possible values: [
boolean
,number
,string
]
Whether to scan every document for arrays and store the length for each array found. Set the index_array_lengths field to false if:
- You do not need to know the length of an array. * You do not use the
$size
operator. * The documents in your database are complex, or not completely under your control. As a result, it is difficult to estimate the impact of the extra processing that is needed to determine and store the arrays lengths.
- You do not need to know the length of an array. * You do not use the
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$|^_all_docs$/
Indicates if index is partitioned.
Schema for the type of an index.
Possible values: [
json
,special
,text
]
Schema for the list of all the other indexes that were not chosen for serving the query.
Possible values: number of items ≥ 0
- indexCandidates
Schema for detailed explanation of why the specific index was excluded by the query planner.
- analysis
When
true
, the query is answered using the index only and no documents are fetched.A position of the unused index based on its potential relevance to the query.
Possible values: 1 ≤ value ≤ 4294967295
A list of reasons explaining why index was not chosen for the query.
Possible values: number of items ≥ 1
- reasons
A reason code for index's exclusion.
The full list of possible reason codes is following:
- alphabetically_comes_after: json There is another suitable index whose name comes before that of this index.
- empty_selector: text "text" indexes do not support queries with empty selectors.
- excluded_by_user: any use_index was used to manually specify the index.
- field_mismatch: any Fields in "selector" of the query do match with the fields available in the index.
- is_partial: json, text Partial indexes can be selected only manually.
- less_overlap: json There is a better match of fields available within the indexes for the query.
- needs_text_search: json The use of the $text operator requires a "text" index.
- scope_mismatch: json The scope of the query and the index is not the same.
- sort_order_mismatch: json, special Fields in "sort" of the query do not match with the fields available in the index.
- too_many_fields: json The index has more fields than the chosen one.
- unfavored_type: any The type of the index is not preferred.
Possible values: [
alphabetically_comes_after
,empty_selector
,excluded_by_user
,field_mismatch
,is_partial
,less_overlap
,needs_text_search
,scope_mismatch
,sort_order_mismatch
,too_many_fields
,unfavored_type
]
Indicates whether an index can still be used for the query.
Schema for information about an index.
- index
Schema for a nullable design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Schema for a
json
ortext
query index definition. Indexes of typetext
have additional configuration properties that do not apply tojson
indexes, these are:default_analyzer
- the default text analyzer to use *default_field
- whether to index the text in all document fields and what analyzer to use for that purpose.
- def
Schema for a full text search analyzer.
- defaultAnalyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the
$text
operator.- defaultField
Schema for a full text search analyzer.
- analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Whether or not the default_field is enabled.
List of field objects to index. Nested fields are also allowed, e.g.
person.name
.For "json" type indexes each object is a mapping of field name to sort direction (asc or desc).
For "text" type indexes each object has a
name
property of the field name and atype
property of the field type (string, number, or boolean).Possible values: 1 ≤ number of items ≤ 65535
- fields
Name of the field.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The type of the named field.
Possible values: [
boolean
,number
,string
]
Whether to scan every document for arrays and store the length for each array found. Set the index_array_lengths field to false if:
- You do not need to know the length of an array. * You do not use the
$size
operator. * The documents in your database are complex, or not completely under your control. As a result, it is difficult to estimate the impact of the extra processing that is needed to determine and store the arrays lengths.
- You do not need to know the length of an array. * You do not use the
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$|^_all_docs$/
Indicates if index is partitioned.
Schema for the type of an index.
Possible values: [
json
,special
,text
]
The used maximum number of results returned.
Possible values: 0 ≤ value ≤ 4294967295
Arguments passed to the underlying view.
- mrargs
Schema for any JSON type.
Direction parameter passed to the underlying view.
Possible values: [
fwd
,rev
]Schema for any JSON type.
A parameter that specifies whether to include the full content of the documents in the response in the underlying view.
Partition parameter passed to the underlying view.
Possible values: 0 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
A parameter that specifies returning only documents that match any of the specified keys in the underlying view.
A parameter that specifies whether the view results should be returned form a "stable" set of shards passed to the underlying view.
Schema for any JSON type.
Schema for any JSON type.
The type of the underlying view.
Possible values: [
map
,reduce
]
Options used for the request.
- opts
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Conflicts used in the request query.
Execution statistics used in the request query.
JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Limit used in the request query.
Possible values: 0 ≤ value ≤ 4294967295
On which database partition the request was used. If it was not used on a database partition, it returns with
""
.Possible values: 0 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
The read quorum that is needed for the result.
Possible values: 1 ≤ value ≤ 3
Skip used in the request query.
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for any JSON type.
Stable used in the request query.
Stale used in the request query.
Update used in the request query.
Use index used in the request query.
Possible values: 0 ≤ number of items ≤ 2, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for any JSON type.
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Schema for a list of objects with extra information on the selector to provide insights about its usability.
Possible values: 1 ≤ number of items ≤ 3
- selectorHints
A list of fields in the given selector that can be used to restrict the query.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
A type of the index.
Possible values: [
json
,text
]A list of fields in the given selector that can't be used to restrict the query.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Skip parameter used.
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for information about the index used for a find query.
When
true
, the query is answered using the index only and no documents are fetched.Schema for a database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Fields that were requested to be projected from the document. If no fields were requested to be projected this will be empty and all fields will be returned.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for information about an index.
- index
Schema for a nullable design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Schema for a
json
ortext
query index definition. Indexes of typetext
have additional configuration properties that do not apply tojson
indexes, these are:default_analyzer
- the default text analyzer to use *default_field
- whether to index the text in all document fields and what analyzer to use for that purpose.
- def_
Schema for a full text search analyzer.
- default_analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the
$text
operator.- default_field
Schema for a full text search analyzer.
- analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Whether or not the default_field is enabled.
List of field objects to index. Nested fields are also allowed, e.g.
person.name
.For "json" type indexes each object is a mapping of field name to sort direction (asc or desc).
For "text" type indexes each object has a
name
property of the field name and atype
property of the field type (string, number, or boolean).Possible values: 1 ≤ number of items ≤ 65535
- fields
Name of the field.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The type of the named field.
Possible values: [
boolean
,number
,string
]
Whether to scan every document for arrays and store the length for each array found. Set the index_array_lengths field to false if:
- You do not need to know the length of an array. * You do not use the
$size
operator. * The documents in your database are complex, or not completely under your control. As a result, it is difficult to estimate the impact of the extra processing that is needed to determine and store the arrays lengths.
- You do not need to know the length of an array. * You do not use the
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$|^_all_docs$/
Indicates if index is partitioned.
Schema for the type of an index.
Possible values: [
json
,special
,text
]
Schema for the list of all the other indexes that were not chosen for serving the query.
Possible values: number of items ≥ 0
- index_candidates
Schema for detailed explanation of why the specific index was excluded by the query planner.
- analysis
When
true
, the query is answered using the index only and no documents are fetched.A position of the unused index based on its potential relevance to the query.
Possible values: 1 ≤ value ≤ 4294967295
A list of reasons explaining why index was not chosen for the query.
Possible values: number of items ≥ 1
- reasons
A reason code for index's exclusion.
The full list of possible reason codes is following:
- alphabetically_comes_after: json There is another suitable index whose name comes before that of this index.
- empty_selector: text "text" indexes do not support queries with empty selectors.
- excluded_by_user: any use_index was used to manually specify the index.
- field_mismatch: any Fields in "selector" of the query do match with the fields available in the index.
- is_partial: json, text Partial indexes can be selected only manually.
- less_overlap: json There is a better match of fields available within the indexes for the query.
- needs_text_search: json The use of the $text operator requires a "text" index.
- scope_mismatch: json The scope of the query and the index is not the same.
- sort_order_mismatch: json, special Fields in "sort" of the query do not match with the fields available in the index.
- too_many_fields: json The index has more fields than the chosen one.
- unfavored_type: any The type of the index is not preferred.
Possible values: [
alphabetically_comes_after
,empty_selector
,excluded_by_user
,field_mismatch
,is_partial
,less_overlap
,needs_text_search
,scope_mismatch
,sort_order_mismatch
,too_many_fields
,unfavored_type
]
Indicates whether an index can still be used for the query.
Schema for information about an index.
- index
Schema for a nullable design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Schema for a
json
ortext
query index definition. Indexes of typetext
have additional configuration properties that do not apply tojson
indexes, these are:default_analyzer
- the default text analyzer to use *default_field
- whether to index the text in all document fields and what analyzer to use for that purpose.
- def_
Schema for a full text search analyzer.
- default_analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the
$text
operator.- default_field
Schema for a full text search analyzer.
- analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Whether or not the default_field is enabled.
List of field objects to index. Nested fields are also allowed, e.g.
person.name
.For "json" type indexes each object is a mapping of field name to sort direction (asc or desc).
For "text" type indexes each object has a
name
property of the field name and atype
property of the field type (string, number, or boolean).Possible values: 1 ≤ number of items ≤ 65535
- fields
Name of the field.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The type of the named field.
Possible values: [
boolean
,number
,string
]
Whether to scan every document for arrays and store the length for each array found. Set the index_array_lengths field to false if:
- You do not need to know the length of an array. * You do not use the
$size
operator. * The documents in your database are complex, or not completely under your control. As a result, it is difficult to estimate the impact of the extra processing that is needed to determine and store the arrays lengths.
- You do not need to know the length of an array. * You do not use the
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$|^_all_docs$/
Indicates if index is partitioned.
Schema for the type of an index.
Possible values: [
json
,special
,text
]
The used maximum number of results returned.
Possible values: 0 ≤ value ≤ 4294967295
Arguments passed to the underlying view.
- mrargs
Schema for any JSON type.
Direction parameter passed to the underlying view.
Possible values: [
fwd
,rev
]Schema for any JSON type.
A parameter that specifies whether to include the full content of the documents in the response in the underlying view.
Partition parameter passed to the underlying view.
Possible values: 0 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
A parameter that specifies returning only documents that match any of the specified keys in the underlying view.
A parameter that specifies whether the view results should be returned form a "stable" set of shards passed to the underlying view.
Schema for any JSON type.
Schema for any JSON type.
The type of the underlying view.
Possible values: [
map
,reduce
]
Options used for the request.
- opts
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Conflicts used in the request query.
Execution statistics used in the request query.
JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Limit used in the request query.
Possible values: 0 ≤ value ≤ 4294967295
On which database partition the request was used. If it was not used on a database partition, it returns with
""
.Possible values: 0 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
The read quorum that is needed for the result.
Possible values: 1 ≤ value ≤ 3
Skip used in the request query.
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for any JSON type.
Stable used in the request query.
Stale used in the request query.
Update used in the request query.
Use index used in the request query.
Possible values: 0 ≤ number of items ≤ 2, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for any JSON type.
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Schema for a list of objects with extra information on the selector to provide insights about its usability.
Possible values: 1 ≤ number of items ≤ 3
- selector_hints
A list of fields in the given selector that can be used to restrict the query.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
A type of the index.
Possible values: [
json
,text
]A list of fields in the given selector that can't be used to restrict the query.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Skip parameter used.
Possible values: 0 ≤ value ≤ 9007199254740992
Status Code
HTTP response for postExplain.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example ExplainResult response.
{ "covering": false, "dbname": "users", "fields": [ "surname", "email" ], "index": { "ddoc": "_design/id-index", "def": { "fields": [ { "_id": "asc" } ] }, "name": "d479bdddf50865e520a0193704c8b93a3bd48f77", "type": "json" }, "index_candidates": [ { "analysis": { "covering": null, "ranking": 1, "reasons": [ { "name": "unfavored_type" } ], "usable": false }, "index": { "ddoc": null, "def": { "fields": [ { "_id": "asc" } ] }, "name": "_all_docs", "type": "special" } }, { "analysis": { "covering": false, "ranking": 2, "reasons": [ { "name": "field_mismatch" } ], "usable": false }, "index": { "ddoc": "_design/json-index", "def": { "fields": [ { "name": "asc" } ] }, "name": "getUserByName", "partitioned": false, "type": "json" } } ], "limit": 10, "mrargs": { "conflicts": "undefined", "direction": "fwd", "end_key": [ "<MAX>" ], "include_docs": true, "partition": null, "reduce": false, "stable": false, "start_key": [], "update": true, "view_type": "map" }, "opts": { "bookmark": "nil", "conflicts": false, "execution_stats": true, "fields": [], "limit": 10, "partition": "", "r": 1, "skip": 0, "sort": {}, "stable": false, "stale": false, "update": false, "use_index": [] }, "partitioned": true, "selector": { "type": { "$eq": "user" } }, "selector_hints": [ { "indexable_fields": [ "email" ], "type": "json", "unindexable_fields": [ "surname" ] } ], "skip": 0 }
Example ExplainResult response.
{ "covering": false, "dbname": "users", "fields": [ "surname", "email" ], "index": { "ddoc": "_design/id-index", "def": { "fields": [ { "_id": "asc" } ] }, "name": "d479bdddf50865e520a0193704c8b93a3bd48f77", "type": "json" }, "index_candidates": [ { "analysis": { "covering": null, "ranking": 1, "reasons": [ { "name": "unfavored_type" } ], "usable": false }, "index": { "ddoc": null, "def": { "fields": [ { "_id": "asc" } ] }, "name": "_all_docs", "type": "special" } }, { "analysis": { "covering": false, "ranking": 2, "reasons": [ { "name": "field_mismatch" } ], "usable": false }, "index": { "ddoc": "_design/json-index", "def": { "fields": [ { "name": "asc" } ] }, "name": "getUserByName", "partitioned": false, "type": "json" } } ], "limit": 10, "mrargs": { "conflicts": "undefined", "direction": "fwd", "end_key": [ "<MAX>" ], "include_docs": true, "partition": null, "reduce": false, "stable": false, "start_key": [], "update": true, "view_type": "map" }, "opts": { "bookmark": "nil", "conflicts": false, "execution_stats": true, "fields": [], "limit": 10, "partition": "", "r": 1, "skip": 0, "sort": {}, "stable": false, "stale": false, "update": false, "use_index": [] }, "partitioned": true, "selector": { "type": { "$eq": "user" } }, "selector_hints": [ { "indexable_fields": [ "email" ], "type": "json", "unindexable_fields": [ "surname" ] } ], "skip": 0 }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Query a database partition index by using selector syntax
Query documents by using a
declarative JSON querying syntax.
It's best practice to create an appropriate index
for all fields in selector by using the _index
endpoint.
Queries without an appropriate backing index by default
fallback to using the built-in _all_docs
index.
This isn't recommended because it has a significant
performance impact causing a full scan of the partition
with each request.
In this case the response body includes a warning field
recommending the creation of an index.
To avoid the fallback behavior set the allow_fallback
option
to false
and the server responds with a 400
status code
if no suitable index exists.
If you want to use only a specific index for your query set
allow_fallback
to false
and set the use_index
option.
Before using read the FAQs to understand the limitations and appropriate use cases.
Query documents by using a declarative JSON querying syntax. It's best practice to create an appropriate index for all fields in selector by using the _index
endpoint.
Queries without an appropriate backing index by default fallback to using the built-in _all_docs
index. This isn't recommended because it has a significant performance impact causing a full scan of the partition with each request. In this case the response body includes a warning field recommending the creation of an index.
To avoid the fallback behavior set the allow_fallback
option to false
and the server responds with a 400
status code if no suitable index exists. If you want to use only a specific index for your query set
allow_fallback
to false
and set the use_index
option.
Before using read the FAQs to understand the limitations and appropriate use cases.
Query documents by using a declarative JSON querying syntax. It's best practice to create an appropriate index for all fields in selector by using the _index
endpoint.
Queries without an appropriate backing index by default fallback to using the built-in _all_docs
index. This isn't recommended because it has a significant performance impact causing a full scan of the partition with each request. In this case the response body includes a warning field recommending the creation of an index.
To avoid the fallback behavior set the allow_fallback
option to false
and the server responds with a 400
status code if no suitable index exists. If you want to use only a specific index for your query set
allow_fallback
to false
and set the use_index
option.
Before using read the FAQs to understand the limitations and appropriate use cases.
Query documents by using a declarative JSON querying syntax. It's best practice to create an appropriate index for all fields in selector by using the _index
endpoint.
Queries without an appropriate backing index by default fallback to using the built-in _all_docs
index. This isn't recommended because it has a significant performance impact causing a full scan of the partition with each request. In this case the response body includes a warning field recommending the creation of an index.
To avoid the fallback behavior set the allow_fallback
option to false
and the server responds with a 400
status code if no suitable index exists. If you want to use only a specific index for your query set
allow_fallback
to false
and set the use_index
option.
Before using read the FAQs to understand the limitations and appropriate use cases.
Query documents by using a declarative JSON querying syntax. It's best practice to create an appropriate index for all fields in selector by using the _index
endpoint.
Queries without an appropriate backing index by default fallback to using the built-in _all_docs
index. This isn't recommended because it has a significant performance impact causing a full scan of the partition with each request. In this case the response body includes a warning field recommending the creation of an index.
To avoid the fallback behavior set the allow_fallback
option to false
and the server responds with a 400
status code if no suitable index exists. If you want to use only a specific index for your query set
allow_fallback
to false
and set the use_index
option.
Before using read the FAQs to understand the limitations and appropriate use cases.
POST /{db}/_partition/{partition_key}/_find
(cloudant *CloudantV1) PostPartitionFind(postPartitionFindOptions *PostPartitionFindOptions) (result *FindResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostPartitionFindWithContext(ctx context.Context, postPartitionFindOptions *PostPartitionFindOptions) (result *FindResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostPartitionFindAsStream(postPartitionFindOptions *PostPartitionFindOptions) (result io.ReadCloser, response *core.DetailedResponse, err error)
ServiceCall<FindResult> postPartitionFind(PostPartitionFindOptions postPartitionFindOptions)
ServiceCall<InputStream> postPartitionFindAsStream(PostPartitionFindOptions postPartitionFindOptions)
postPartitionFind(params)
postPartitionFindAsStream(params)
post_partition_find(
self,
db: str,
partition_key: str,
selector: dict,
*,
allow_fallback: Optional[bool] = None,
bookmark: Optional[str] = None,
conflicts: Optional[bool] = None,
execution_stats: Optional[bool] = None,
fields: Optional[List[str]] = None,
limit: Optional[int] = None,
skip: Optional[int] = None,
sort: Optional[List[dict]] = None,
stable: Optional[bool] = None,
update: Optional[str] = None,
use_index: Optional[List[str]] = None,
**kwargs,
) -> DetailedResponse
post_partition_find_as_stream(
self,
db: str,
partition_key: str,
selector: dict,
*,
allow_fallback: Optional[bool] = None,
bookmark: Optional[str] = None,
conflicts: Optional[bool] = None,
execution_stats: Optional[bool] = None,
fields: Optional[List[str]] = None,
limit: Optional[int] = None,
skip: Optional[int] = None,
sort: Optional[List[dict]] = None,
stable: Optional[bool] = None,
update: Optional[str] = None,
use_index: Optional[List[str]] = None,
**kwargs,
) -> DetailedResponse
Auditing
Calling this method generates the following auditing event.
cloudantnosqldb.any-document.read
Rate limit
This operation consumes 0.01 read
requests per row read from the index (rounded up) and one further read for each document read. Additional document reads occur if the selector includes unindexed fields or if the projected values cannot be read from the index row. If no rows are read, the minimum cost is 1 read
.
Request
Instantiate the PostPartitionFindOptions
struct and set the fields to provide parameter values for the PostPartitionFind
method.
Use the PostPartitionFindOptions.Builder
to create a PostPartitionFindOptions
object that contains the parameter values for the postPartitionFind
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_:][^:]*$
HTTP request body for postPartitionFind.
Example PartitionFindQuery request.
{
"fields": [
"productid",
"name",
"description"
],
"selector": {
"type": {
"$eq": "product"
}
}
}
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate
the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax
- selector
Whether to allow fallback to other indexes. Default is true.
Default:
true
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
^[A-Za-z0-9=_-]*$
A boolean value that indicates whether or not to include information about existing conflicts in the document.
Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when
include_docs=true
is used), and total quorum document lookups (when each document replica is fetched).JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Maximum number of results returned. The
type: text
indexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25
Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740992
The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields.
For example in JSON:
[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]
When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields must use the same sort direction, either all ascending or all descending.
Possible values: 0 ≤ number of items ≤ 65535
- sort
Schema for sort direction.
Allowable values: [
asc
,desc
]Default:
asc
Whether or not the view results should be returned from a "stable" set of shards.
Whether to update the index prior to returning the result.
Allowable values: [
false
,true
,lazy
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Default:
true
Use this option to identify a specific index to answer the query, rather than letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id followed by index name, for example
["my_design_doc", "my_index"]
.It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later.
If the specified index doesn't exist or can't answer the query then the server ignores the value and answers using another index or a full scan of all documents. To change this behavior set
allow_fallback
tofalse
and the server responds instead with a400
status code if the requested index is unsuitable to answer the query.Possible values: number of items = 2, 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The PostPartitionFind options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Examples:{ "type": { "$eq": "product" } }
Whether to allow fallback to other indexes. Default is true.
Default:
true
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
A boolean value that indicates whether or not to include information about existing conflicts in the document.
Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when
include_docs=true
is used), and total quorum document lookups (when each document replica is fetched).JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Examples:[ "productid", "name", "description" ]
Maximum number of results returned. The
type: text
indexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25
Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740992
The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields.
For example in JSON:
[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]
When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields must use the same sort direction, either all ascending or all descending.
Allowable values: [
asc
,desc
]Possible values: 0 ≤ number of items ≤ 65535
Whether or not the view results should be returned from a "stable" set of shards.
Whether to update the index prior to returning the result.
Allowable values: [
false
,true
,lazy
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Default:
true
Use this option to identify a specific index to answer the query, rather than letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id followed by index name, for example
["my_design_doc", "my_index"]
.It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later.
If the specified index doesn't exist or can't answer the query then the server ignores the value and answers using another index or a full scan of all documents. To change this behavior set
allow_fallback
tofalse
and the server responds instead with a400
status code if the requested index is unsuitable to answer the query.Possible values: number of items = 2, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The postPartitionFind options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Examples:{ "type": { "$eq": "product" } }
Whether to allow fallback to other indexes. Default is true.
Default:
true
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
A boolean value that indicates whether or not to include information about existing conflicts in the document.
Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when
include_docs=true
is used), and total quorum document lookups (when each document replica is fetched).JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Examples:[ "productid", "name", "description" ]
Maximum number of results returned. The
type: text
indexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25
Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740992
The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields.
For example in JSON:
[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]
When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields must use the same sort direction, either all ascending or all descending.
Allowable values: [
asc
,desc
]Possible values: 0 ≤ number of items ≤ 65535
Whether or not the view results should be returned from a "stable" set of shards.
Whether to update the index prior to returning the result.
Allowable values: [
false
,true
,lazy
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Default:
true
Use this option to identify a specific index to answer the query, rather than letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id followed by index name, for example
["my_design_doc", "my_index"]
.It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later.
If the specified index doesn't exist or can't answer the query then the server ignores the value and answers using another index or a full scan of all documents. To change this behavior set
allow_fallback
tofalse
and the server responds instead with a400
status code if the requested index is unsuitable to answer the query.Possible values: number of items = 2, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Examples:Whether to allow fallback to other indexes. Default is true.
Default:
true
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
A boolean value that indicates whether or not to include information about existing conflicts in the document.
Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when
include_docs=true
is used), and total quorum document lookups (when each document replica is fetched).JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Examples:Maximum number of results returned. The
type: text
indexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25
Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740992
The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields.
For example in JSON:
[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]
When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields must use the same sort direction, either all ascending or all descending.
Allowable values: [
asc
,desc
]Possible values: 0 ≤ number of items ≤ 65535
Whether or not the view results should be returned from a "stable" set of shards.
Whether to update the index prior to returning the result.
Allowable values: [
false
,true
,lazy
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Default:
true
Use this option to identify a specific index to answer the query, rather than letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id followed by index name, for example
["my_design_doc", "my_index"]
.It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later.
If the specified index doesn't exist or can't answer the query then the server ignores the value and answers using another index or a full scan of all documents. To change this behavior set
allow_fallback
tofalse
and the server responds instead with a400
status code if the requested index is unsuitable to answer the query.Possible values: number of items = 2, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Examples:Whether to allow fallback to other indexes. Default is true.
Default:
true
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
A boolean value that indicates whether or not to include information about existing conflicts in the document.
Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when
include_docs=true
is used), and total quorum document lookups (when each document replica is fetched).JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Examples:Maximum number of results returned. The
type: text
indexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25
Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740992
The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields.
For example in JSON:
[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]
When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields must use the same sort direction, either all ascending or all descending.
Allowable values: [
asc
,desc
]Possible values: 0 ≤ number of items ≤ 65535
Whether or not the view results should be returned from a "stable" set of shards.
Whether to update the index prior to returning the result.
Allowable values: [
false
,true
,lazy
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Default:
true
Use this option to identify a specific index to answer the query, rather than letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id followed by index name, for example
["my_design_doc", "my_index"]
.It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later.
If the specified index doesn't exist or can't answer the query then the server ignores the value and answers using another index or a full scan of all documents. To change this behavior set
allow_fallback
tofalse
and the server responds instead with a400
status code if the requested index is unsuitable to answer the query.Possible values: number of items = 2, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X POST "$SERVICE_URL/products/_partition/small-appliances/_find" -H "Content-Type: application/json" --data '{ "fields": [ "productid", "name", "description" ], "selector": { "type": { "$eq": "product" } } }'
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } selector := map[string]interface{}{ "userId": map[string]string{ "$eq": "abc123", }, } postPartitionFindOptions := service.NewPostPartitionFindOptions( "events", "ns1HJS13AMkK", selector, ) postPartitionFindOptions.SetFields([]string{ "productId", "eventType", "date", }) findResult, response, err := service.PostPartitionFind(postPartitionFindOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(findResult, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.FindResult; import com.ibm.cloud.cloudant.v1.model.PostPartitionFindOptions; import java.util.Arrays; import java.util.HashMap; import java.util.Map;
Cloudant service = Cloudant.newInstance(); Map<String, String> typeEqualsProduct = new HashMap<>(); typeEqualsProduct.put("$eq", "abc123"); Map<String, Object> selector = new HashMap<>(); selector.put("userId", typeEqualsProduct); PostPartitionFindOptions findOptions = new PostPartitionFindOptions.Builder() .db("events") .partitionKey("ns1HJS13AMkK") .fields(Arrays.asList("productId", "eventType", "date")) .selector(selector) .build(); FindResult response = service.postPartitionFind(findOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); const selector: CloudantV1.Selector = { userId: {'$eq': 'abc123'} } service.postPartitionFind({ db: 'events', partitionKey: 'ns1HJS13AMkK', fields: ['productId', 'eventType', 'date'], selector: selector }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.post_partition_find( db='events', partition_key='ns1HJS13AMkK', fields=['productId', 'eventType', 'date'], selector={'userId': {'$eq': 'abc123'}} ).get_result() print(response)
Response
Response type for PostPartitionFind
: FindResult
Response type for PostPartitionFindAsStream
: io.ReadCloser
Response type for postPartitionFind
: FindResult
Response type for postPartitionFindAsStream
: InputStream
Response type for postPartitionFind
: FindResult
Response type for postPartitionFindAsStream
: NodeJS.ReadableStream
Response type for post_partition_find
: FindResult
Response type for post_partition_find_as_stream
: BinaryIO
Schema for the result of a query find operation.
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
^[A-Za-z0-9=_-]*$
Documents matching the selector.
Possible values: 0 ≤ number of items ≤ 4294967295
- docs
Schema for find query execution statistics.
warning
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Schema for the result of a query find operation.
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Documents matching the selector.
Possible values: number of items ≥ 0
- Docs
Schema for a map of attachment name to attachment metadata.
- Attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- Revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- RevsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for find query execution statistics.
- ExecutionStats
Time to execute the query.
Number of results returned.
Possible values: 0 ≤ value ≤ 4294967295
Number of documents fetched from the index.
Possible values: 0 ≤ value ≤ 9007199254740992
Number of rows scanned in the index.
Possible values: 0 ≤ value ≤ 9007199254740992
Number of documents fetched from the primary index with the specified read quorum.
Possible values: 0 ≤ value ≤ 9007199254740992
warning.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the result of a query find operation.
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Documents matching the selector.
Possible values: number of items ≥ 0
- docs
Schema for a map of attachment name to attachment metadata.
- attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- revsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for find query execution statistics.
- executionStats
Time to execute the query.
Number of results returned.
Possible values: 0 ≤ value ≤ 4294967295
Number of documents fetched from the index.
Possible values: 0 ≤ value ≤ 9007199254740992
Number of rows scanned in the index.
Possible values: 0 ≤ value ≤ 9007199254740992
Number of documents fetched from the primary index with the specified read quorum.
Possible values: 0 ≤ value ≤ 9007199254740992
warning.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the result of a query find operation.
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Documents matching the selector.
Possible values: number of items ≥ 0
- docs
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for find query execution statistics.
- executionStats
Time to execute the query.
Number of results returned.
Possible values: 0 ≤ value ≤ 4294967295
Number of documents fetched from the index.
Possible values: 0 ≤ value ≤ 9007199254740992
Number of rows scanned in the index.
Possible values: 0 ≤ value ≤ 9007199254740992
Number of documents fetched from the primary index with the specified read quorum.
Possible values: 0 ≤ value ≤ 9007199254740992
warning.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the result of a query find operation.
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Documents matching the selector.
Possible values: number of items ≥ 0
- docs
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for find query execution statistics.
- execution_stats
Time to execute the query.
Number of results returned.
Possible values: 0 ≤ value ≤ 4294967295
Number of documents fetched from the index.
Possible values: 0 ≤ value ≤ 9007199254740992
Number of rows scanned in the index.
Possible values: 0 ≤ value ≤ 9007199254740992
Number of documents fetched from the primary index with the specified read quorum.
Possible values: 0 ≤ value ≤ 9007199254740992
warning.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Status Code
HTTP response for postPartitionFind.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example FindResult response for a database partition.
{ "bookmark": "g1AAAABgeJzLYWBgYMpgSmHgKy5JLCrJTq2MT8lPzkzJBYpLFOcm5uToJhYU5GQm5iWnFlsZGgCBiQlIPQdMPV6VWQBXehzX", "docs": [ { "description": "Slim Colourful Design Electronic Cooking...", "name": "Digital Kitchen Scales", "productid": "1000042" }, { "description": "Easily make delicious and fluffy omelets...", "name": "Housewares Omelet Maker", "productid": "1000044" } ], "warning": "No matching index found, create an index to optimize query time." }
Example FindResult response for a database partition.
{ "bookmark": "g1AAAABgeJzLYWBgYMpgSmHgKy5JLCrJTq2MT8lPzkzJBYpLFOcm5uToJhYU5GQm5iWnFlsZGgCBiQlIPQdMPV6VWQBXehzX", "docs": [ { "description": "Slim Colourful Design Electronic Cooking...", "name": "Digital Kitchen Scales", "productid": "1000042" }, { "description": "Easily make delicious and fluffy omelets...", "name": "Housewares Omelet Maker", "productid": "1000044" } ], "warning": "No matching index found, create an index to optimize query time." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Query tokenization of sample text (GET)
Returns the results of analyzer tokenization of the provided sample text. This endpoint can be used for testing analyzer tokenization.
GET /_search_analyze
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Query Parameters
Query parameter to specify search analyzer type.
Allowable values: [
arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,classic
,czech
,danish
,dutch
,email
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,keyword
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,simple
,spanish
,standard
,swedish
,thai
,turkish
,whitespace
]Query parameter to specify search analyzer text.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Response
Schema for the output of testing search analyzer tokenization.
tokens
Possible values: 1 ≤ number of items ≤ 7168, 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for postSearchAnalyzer.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example SearchAnalyzeResult response.
{ "tokens": [ "run", "fun" ] }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Query tokenization of sample text
Returns the HTTP headers that contain a minimal amount of information about search analyze.
HEAD /_search_analyze
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Query Parameters
Query parameter to specify search analyzer type.
Allowable values: [
arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,classic
,czech
,danish
,dutch
,email
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,keyword
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,simple
,spanish
,standard
,swedish
,thai
,turkish
,whitespace
]Query parameter to specify search analyzer text.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for search analyze operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Query tokenization of sample text
Returns the results of analyzer tokenization of the provided sample text. This endpoint can be used for testing analyzer tokenization.
Returns the results of analyzer tokenization of the provided sample text. This endpoint can be used for testing analyzer tokenization.
Returns the results of analyzer tokenization of the provided sample text. This endpoint can be used for testing analyzer tokenization.
Returns the results of analyzer tokenization of the provided sample text. This endpoint can be used for testing analyzer tokenization.
Returns the results of analyzer tokenization of the provided sample text. This endpoint can be used for testing analyzer tokenization.
POST /_search_analyze
(cloudant *CloudantV1) PostSearchAnalyze(postSearchAnalyzeOptions *PostSearchAnalyzeOptions) (result *SearchAnalyzeResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostSearchAnalyzeWithContext(ctx context.Context, postSearchAnalyzeOptions *PostSearchAnalyzeOptions) (result *SearchAnalyzeResult, response *core.DetailedResponse, err error)
ServiceCall<SearchAnalyzeResult> postSearchAnalyze(PostSearchAnalyzeOptions postSearchAnalyzeOptions)
postSearchAnalyze(params)
post_search_analyze(
self,
analyzer: str,
text: str,
**kwargs,
) -> DetailedResponse
Request
Instantiate the PostSearchAnalyzeOptions
struct and set the fields to provide parameter values for the PostSearchAnalyze
method.
Use the PostSearchAnalyzeOptions.Builder
to create a PostSearchAnalyzeOptions
object that contains the parameter values for the postSearchAnalyze
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
HTTP request body for postSearchAnalyze.
Example SearchAnalyzeQuery request.
{
"analyzer": "english",
"text": "running is fun"
}
The analyzer type that is being used at the tokenization.
Allowable values: [
arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,classic
,czech
,danish
,dutch
,email
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,keyword
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,simple
,spanish
,standard
,swedish
,thai
,turkish
,whitespace
]The text to tokenize with the analyzer.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The PostSearchAnalyze options.
The analyzer type that is being used at the tokenization.
Allowable values: [
arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,classic
,czech
,danish
,dutch
,email
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,keyword
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,simple
,spanish
,standard
,swedish
,thai
,turkish
,whitespace
]Examples:english
The text to tokenize with the analyzer.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Examples:running is fun
The postSearchAnalyze options.
The analyzer type that is being used at the tokenization.
Allowable values: [
arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,classic
,czech
,danish
,dutch
,email
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,keyword
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,simple
,spanish
,standard
,swedish
,thai
,turkish
,whitespace
]Examples:english
The text to tokenize with the analyzer.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Examples:running is fun
parameters
The analyzer type that is being used at the tokenization.
Allowable values: [
arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,classic
,czech
,danish
,dutch
,email
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,keyword
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,simple
,spanish
,standard
,swedish
,thai
,turkish
,whitespace
]Examples:The text to tokenize with the analyzer.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Examples:
parameters
The analyzer type that is being used at the tokenization.
Allowable values: [
arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,classic
,czech
,danish
,dutch
,email
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,keyword
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,simple
,spanish
,standard
,swedish
,thai
,turkish
,whitespace
]Examples:The text to tokenize with the analyzer.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Examples:
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X POST "$SERVICE_URL/_search_analyze" -H "Content-Type: application/json" --data '{ "analyzer": "english", "text": "running is fun" }'
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } postSearchAnalyzeOptions := service.NewPostSearchAnalyzeOptions( "english", "running is fun", ) searchAnalyzeResult, response, err := service.PostSearchAnalyze(postSearchAnalyzeOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(searchAnalyzeResult, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.PostSearchAnalyzeOptions; import com.ibm.cloud.cloudant.v1.model.SearchAnalyzeResult;
Cloudant service = Cloudant.newInstance(); PostSearchAnalyzeOptions searchAnalyzerOptions = new PostSearchAnalyzeOptions.Builder() .analyzer("english") .text("running is fun") .build(); SearchAnalyzeResult response = service.postSearchAnalyze(searchAnalyzerOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.postSearchAnalyze({ analyzer: 'english', text: 'running is fun', }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.post_search_analyze( analyzer='english', text='running is fun' ).get_result() print(response)
Response
Schema for the output of testing search analyzer tokenization.
tokens
Possible values: 1 ≤ number of items ≤ 7168, 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Schema for the output of testing search analyzer tokenization.
tokens.
Possible values: 1 ≤ number of items ≤ 7168, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the output of testing search analyzer tokenization.
tokens.
Possible values: 1 ≤ number of items ≤ 7168, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the output of testing search analyzer tokenization.
tokens.
Possible values: 1 ≤ number of items ≤ 7168, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the output of testing search analyzer tokenization.
tokens.
Possible values: 1 ≤ number of items ≤ 7168, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Status Code
HTTP response for postSearchAnalyzer.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example SearchAnalyzeResult response.
{ "tokens": [ "run", "fun" ] }
Example SearchAnalyzeResult response.
{ "tokens": [ "run", "fun" ] }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Query a search index (GET)
Search indexes, which are defined in design documents, allow databases to be queried by using Lucene Query Parser Syntax. An index function defines search indexes, similar to a map function in MapReduce views. The index function decides what data to index and what data to store in the index.
GET /{db}/_design/{ddoc}/_search/{index}
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Path parameter to specify the index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query Parameters
Query parameter to specify a Lucene search query. Alias of
q
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query parameter to specify a bookmark that was received from a previous request. This parameter enables paging through the results. If there are no more results after the bookmark, you get a response containing no further results and the same bookmark, confirming the end of the result list.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
^[A-Za-z0-9=_-]*$
Query parameter to specify an array of names of string fields, for which counts are requested. The response contains counts for each unique value of the string field name among the documents that match the search query. Faceting must be enabled for this parameter to function.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Restrict results to documents with a dimension equal to the specified label(s). The search matches only documents containing the value that was provided in the named field. It differs from using "fieldname:value" in the q parameter only in that the values are not analyzed. Faceting must be enabled for this parameter to function.
Possible values: 1 ≤ number of items ≤ 65535
Query parameter to specify the field name by which to group search matches. It must be a string that contains the name of a string field. Fields containing other data such as numbers, objects, or arrays cannot be used.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query parameter to specify the maximum group count. This parameter can be used only if group_field is specified.
Possible values: 1 ≤ value ≤ 4294967295
Query parameter to specify the order of the groups in a search that uses group_field. The default sort order is relevance. This parameter can have the same values as the sort field, so single fields and arrays of fields are supported.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query parameter to specify which fields to highlight. If specified, the result object contains a highlights field with an entry for each specified field.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query parameter to specify a string that is inserted before the highlighted word in the highlights output.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^<.*>$
Default:
<em>
Query parameter to specify a string that is inserted after the highlighted word in the highlights output.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^$
Default:
</em>
Query parameter to specify the number of fragments that are returned in highlights. If the search term occurs less often than the number of fragments that are specified, longer fragments are returned.
Possible values: 1 ≤ value ≤ 1048521
Default:
1
Query parameter to specify the number of characters in each fragment for highlights.
Possible values: 1 ≤ value ≤ 1048521
Default:
100
Query parameter to specify whether to include the full content of the documents in the response.
Default:
false
Query parameter to specify a JSON array of field names to include in search results. Any fields that are included must be indexed with the
store:true
option. The default is all fields.Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify ranges for faceted, numeric search fields. The value is a JSON object where the fields names are faceted numeric search fields, and the values of the fields are JSON objects. For each of these objects the field names of the JSON objects are names for ranges. The values are strings that describe the range, for example "[0 TO 10]".
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^{.+}$
Query parameter to specify the sort order of the results. In a grouped search (when group_field is used), this parameter specifies the sort order within a group. The default sort order is relevance. A JSON string of the form "fieldname<type>" or -fieldname<type> for descending order, where fieldname is the name of a string or number field, and type is either a number, a string, or a JSON array of strings. The type part is optional, and defaults to number. Some examples are "foo", "-foo", "bar<string>", "-foo<number>" and ["-foo<number>", "bar<string>"]. String fields that are used for sorting must not be analyzed fields. Fields that are used for sorting must be indexed by the same indexer that is used for the search query.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^-?[^<>]+(<(?:string|number)>)?$
Query parameter to specify to not wait for the index to finish building before returning results.
Allowable values: [
ok
]
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/users/_design/allusers/_search/activeUsers?query=name:Jane*%20AND%20active:True"
This example requires the
activeUsers
Cloudant Search index to exist. To create the design document with this index, see Create or modify a design document.
Response
Schema for the result of a query search operation.
Total number of rows in the index matching the search query. The limit may truncate the number of matches returned.
Possible values: 0 ≤ value ≤ 4294967295
Array of row objects.
Possible values: 0 ≤ number of items ≤ 200
Offset where the list started.
Possible values: 0 ≤ value ≤ 9007199254740992
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
^[A-Za-z0-9=_-]*$
Grouped search matches.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The counts facet syntax returns the number of query results for each unique value of each named field.
- counts
The count of query results for each unique value.
- any property
Possible values: 0 ≤ value ≤ 9007199254740992
The range facet syntax reuses the standard Lucene syntax for ranges to return counts of results that fit into each specified category.
- ranges
Search range result counts.
- any property
Counts of range results that fit into each specified category.
Possible values: 0 ≤ value ≤ 9007199254740992
Array of grouped search matches.
Possible values: 1 ≤ number of items ≤ 4294967295
Status Code
HTTP response for search operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example SearchResult response.
{ "bookmark": "g2wAAAEPeJzLYWBgYMlgTmGQT0lKzi9KdUhJMtFLykxPyilN1UvOyS9NScwr0ctLLckBKmRKZEiy____f1YGk5v9iztMQCGGRGZU3Wa4dSc5AMmkepgBlxdXgQ1gINr6PBaQhgYgBTRjP9iQDwxgkMhEtCsghhyAGAJxybeak2BDGLMAi8FWFQ", "rows": [ { "fields": {}, "id": "exampleid", "order": [ "0.8410536050796509", "1" ] } ], "total_rows": 1 }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve HTTP headers for a queried search index (GET)
Retrieves the HTTP headers for a queried search index (GET).
HEAD /{db}/_design/{ddoc}/_search/{index}
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Path parameter to specify the index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for search operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Query a search index
Search indexes, which are defined in design documents, allow databases to be queried by using Lucene Query Parser Syntax. An index function defines a search index, similar to a map function in MapReduce views. The index function decides what data to index and what data to store in the index.
The advantage of using the HTTP POST
method is that the query is submitted as a JSON object in the request body. This avoids the limitations of passing query options as URL query parameters of a GET
request.
Search indexes, which are defined in design documents, allow databases to be queried by using Lucene Query Parser Syntax. An index function defines a search index, similar to a map function in MapReduce views. The index function decides what data to index and what data to store in the index. The advantage of using the HTTP POST
method is that the query is submitted as a JSON object in the request body. This avoids the limitations of passing query options as URL query parameters of a GET
request.
Search indexes, which are defined in design documents, allow databases to be queried by using Lucene Query Parser Syntax. An index function defines a search index, similar to a map function in MapReduce views. The index function decides what data to index and what data to store in the index. The advantage of using the HTTP POST
method is that the query is submitted as a JSON object in the request body. This avoids the limitations of passing query options as URL query parameters of a GET
request.
Search indexes, which are defined in design documents, allow databases to be queried by using Lucene Query Parser Syntax. An index function defines a search index, similar to a map function in MapReduce views. The index function decides what data to index and what data to store in the index. The advantage of using the HTTP POST
method is that the query is submitted as a JSON object in the request body. This avoids the limitations of passing query options as URL query parameters of a GET
request.
Search indexes, which are defined in design documents, allow databases to be queried by using Lucene Query Parser Syntax. An index function defines a search index, similar to a map function in MapReduce views. The index function decides what data to index and what data to store in the index. The advantage of using the HTTP POST
method is that the query is submitted as a JSON object in the request body. This avoids the limitations of passing query options as URL query parameters of a GET
request.
POST /{db}/_design/{ddoc}/_search/{index}
(cloudant *CloudantV1) PostSearch(postSearchOptions *PostSearchOptions) (result *SearchResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostSearchWithContext(ctx context.Context, postSearchOptions *PostSearchOptions) (result *SearchResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostSearchAsStream(postSearchOptions *PostSearchOptions) (result io.ReadCloser, response *core.DetailedResponse, err error)
ServiceCall<SearchResult> postSearch(PostSearchOptions postSearchOptions)
ServiceCall<InputStream> postSearchAsStream(PostSearchOptions postSearchOptions)
postSearch(params)
postSearchAsStream(params)
post_search(
self,
db: str,
ddoc: str,
index: str,
query: str,
*,
bookmark: Optional[str] = None,
highlight_fields: Optional[List[str]] = None,
highlight_number: Optional[int] = None,
highlight_post_tag: Optional[str] = None,
highlight_pre_tag: Optional[str] = None,
highlight_size: Optional[int] = None,
include_docs: Optional[bool] = None,
include_fields: Optional[List[str]] = None,
limit: Optional[int] = None,
sort: Optional[List[str]] = None,
stale: Optional[str] = None,
counts: Optional[List[str]] = None,
drilldown: Optional[List[List[str]]] = None,
group_field: Optional[str] = None,
group_limit: Optional[int] = None,
group_sort: Optional[List[str]] = None,
ranges: Optional[dict] = None,
**kwargs,
) -> DetailedResponse
post_search_as_stream(
self,
db: str,
ddoc: str,
index: str,
query: str,
*,
bookmark: Optional[str] = None,
highlight_fields: Optional[List[str]] = None,
highlight_number: Optional[int] = None,
highlight_post_tag: Optional[str] = None,
highlight_pre_tag: Optional[str] = None,
highlight_size: Optional[int] = None,
include_docs: Optional[bool] = None,
include_fields: Optional[List[str]] = None,
limit: Optional[int] = None,
sort: Optional[List[str]] = None,
stale: Optional[str] = None,
counts: Optional[List[str]] = None,
drilldown: Optional[List[List[str]]] = None,
group_field: Optional[str] = None,
group_limit: Optional[int] = None,
group_sort: Optional[List[str]] = None,
ranges: Optional[dict] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the PostSearchOptions
struct and set the fields to provide parameter values for the PostSearch
method.
Use the PostSearchOptions.Builder
to create a PostSearchOptions
object that contains the parameter values for the postSearch
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Path parameter to specify the index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
HTTP request body for postSearch.
Example SearchQuery request.
{
"limit": 3,
"query": "name:Jane* AND active:True"
}
The Lucene query to execute.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
^[A-Za-z0-9=_-]*$
Specifies which fields to highlight. If specified, the result object contains a highlights field with an entry for each specified field.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Number of fragments that are returned in highlights. If the search term occurs less often than the number of fragments that are specified, longer fragments are returned.
Possible values: 1 ≤ value ≤ 1048521
Default:
1
A string that is inserted after the highlighted word in the highlights output.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^$
Default:
</em>
A string that is inserted before the highlighted word in the highlights output.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^<.*>$
Default:
<em>
Number of characters in each fragment for highlights.
Possible values: 1 ≤ value ≤ 1048521
Default:
100
Include the full content of the documents in the return.
Default:
false
A JSON array of field names to include in search results. Any fields that are included must be indexed with the store:true option. The default is all fields.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Limit the number of the returned documents to the specified number.
Possible values: 0 ≤ value ≤ 200
Specifies the sort order of the results. In a grouped search (when group_field is used), this parameter specifies the sort order within a group. The default sort order is relevance. A JSON string of the form "fieldname<type>" or "-fieldname<type>" for descending order, where fieldname is the name of a string or number field, and type is either a number, a string, or a JSON array of strings. The type part is optional, and defaults to number. Some examples are "foo", "-foo", "bar<string>", "-foo<number>" and ["-foo<number>", "bar<string>"]. String fields that are used for sorting must not be analyzed fields. Fields that are used for sorting must be indexed by the same indexer that is used for the search query.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^-?[^<>]+(<(?:string|number)>)?$
Do not wait for the index to finish building to return results.
Allowable values: [
ok
]This field defines an array of names of string fields, for which counts are requested. The response contains counts for each unique value of this field name among the documents that match the search query. Faceting must be enabled for this parameter to function. This option is only available when making global queries.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Restrict results to documents with a dimension equal to the specified label(s). The search matches only documents containing the value that was provided in the named field. It differs from using "fieldname:value" in the q parameter only in that the values are not analyzed. Faceting must be enabled for this parameter to function.
Possible values: 1 ≤ number of items ≤ 65535
Field by which to group search matches. A string that contains the name of a string field. Fields containing other data such as numbers, objects, or arrays cannot be used. This option is only available when making global queries.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Maximum group count. This field can be used only if group_field is specified. This option is only available when making global queries.
Possible values: 1 ≤ value ≤ 4294967295
This field defines the order of the groups in a search that uses group_field. The default sort order is relevance. This field can have the same values as the sort field, so single fields and arrays of fields are supported. This option is only available when making global queries.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Object mapping faceted, numeric search field names to the required ranges. Each key is a field name and each value is another object defining the ranges by mapping range name keys to string values describing the numeric ranges, for example "[0 TO 10]". This option is only available when making global queries.
- ranges
Schema for mapping range count category names to the Apache Lucene range query syntax defining the category.
- any property
The range facet syntax reuses the standard Lucene syntax for ranges to return counts of results that fit into each specified category. Inclusive range queries are denoted by brackets (
[
,]
). Exclusive range queries are denoted by curly brackets ({
,}
).Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[\[\{][+-]?(Infinity|([0-9]+\.)?[0-9]+) TO [+-]?(Infinity|([0-9]+\.)?[0-9]+)[\]\}]$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The PostSearch options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The Lucene query to execute.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Examples:name:Jane* AND active:True
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Specifies which fields to highlight. If specified, the result object contains a highlights field with an entry for each specified field.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Number of fragments that are returned in highlights. If the search term occurs less often than the number of fragments that are specified, longer fragments are returned.
Possible values: 1 ≤ value ≤ 1048521
Default:
1
A string that is inserted after the highlighted word in the highlights output.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^<\/.*>$/
Default:
</em>
A string that is inserted before the highlighted word in the highlights output.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^<.*>$/
Default:
<em>
Number of characters in each fragment for highlights.
Possible values: 1 ≤ value ≤ 1048521
Default:
100
Include the full content of the documents in the return.
Default:
false
A JSON array of field names to include in search results. Any fields that are included must be indexed with the store:true option. The default is all fields.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Limit the number of the returned documents to the specified number.
Possible values: 0 ≤ value ≤ 200
Examples:3
Specifies the sort order of the results. In a grouped search (when group_field is used), this parameter specifies the sort order within a group. The default sort order is relevance. A JSON string of the form "fieldname<type>" or "-fieldname<type>" for descending order, where fieldname is the name of a string or number field, and type is either a number, a string, or a JSON array of strings. The type part is optional, and defaults to number. Some examples are "foo", "-foo", "bar<string>", "-foo<number>" and ["-foo<number>", "bar<string>"]. String fields that are used for sorting must not be analyzed fields. Fields that are used for sorting must be indexed by the same indexer that is used for the search query.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^-?[^<>]+(<(?:string|number)>)?$/
Do not wait for the index to finish building to return results.
Allowable values: [
ok
]This field defines an array of names of string fields, for which counts are requested. The response contains counts for each unique value of this field name among the documents that match the search query. Faceting must be enabled for this parameter to function. This option is only available when making global queries.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Restrict results to documents with a dimension equal to the specified label(s). The search matches only documents containing the value that was provided in the named field. It differs from using "fieldname:value" in the q parameter only in that the values are not analyzed. Faceting must be enabled for this parameter to function.
Possible values: 1 ≤ number of items ≤ 65535
Field by which to group search matches. A string that contains the name of a string field. Fields containing other data such as numbers, objects, or arrays cannot be used. This option is only available when making global queries.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Maximum group count. This field can be used only if group_field is specified. This option is only available when making global queries.
Possible values: 1 ≤ value ≤ 4294967295
This field defines the order of the groups in a search that uses group_field. The default sort order is relevance. This field can have the same values as the sort field, so single fields and arrays of fields are supported. This option is only available when making global queries.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Object mapping faceted, numeric search field names to the required ranges. Each key is a field name and each value is another object defining the ranges by mapping range name keys to string values describing the numeric ranges, for example "[0 TO 10]". This option is only available when making global queries.
The postSearch options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The Lucene query to execute.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Examples:name:Jane* AND active:True
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Specifies which fields to highlight. If specified, the result object contains a highlights field with an entry for each specified field.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Number of fragments that are returned in highlights. If the search term occurs less often than the number of fragments that are specified, longer fragments are returned.
Possible values: 1 ≤ value ≤ 1048521
Default:
1
A string that is inserted after the highlighted word in the highlights output.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^<\/.*>$/
Default:
</em>
A string that is inserted before the highlighted word in the highlights output.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^<.*>$/
Default:
<em>
Number of characters in each fragment for highlights.
Possible values: 1 ≤ value ≤ 1048521
Default:
100
Include the full content of the documents in the return.
Default:
false
A JSON array of field names to include in search results. Any fields that are included must be indexed with the store:true option. The default is all fields.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Limit the number of the returned documents to the specified number.
Possible values: 0 ≤ value ≤ 200
Examples:3
Specifies the sort order of the results. In a grouped search (when group_field is used), this parameter specifies the sort order within a group. The default sort order is relevance. A JSON string of the form "fieldname<type>" or "-fieldname<type>" for descending order, where fieldname is the name of a string or number field, and type is either a number, a string, or a JSON array of strings. The type part is optional, and defaults to number. Some examples are "foo", "-foo", "bar<string>", "-foo<number>" and ["-foo<number>", "bar<string>"]. String fields that are used for sorting must not be analyzed fields. Fields that are used for sorting must be indexed by the same indexer that is used for the search query.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^-?[^<>]+(<(?:string|number)>)?$/
Do not wait for the index to finish building to return results.
Allowable values: [
ok
]This field defines an array of names of string fields, for which counts are requested. The response contains counts for each unique value of this field name among the documents that match the search query. Faceting must be enabled for this parameter to function. This option is only available when making global queries.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Restrict results to documents with a dimension equal to the specified label(s). The search matches only documents containing the value that was provided in the named field. It differs from using "fieldname:value" in the q parameter only in that the values are not analyzed. Faceting must be enabled for this parameter to function.
Possible values: 1 ≤ number of items ≤ 65535
Field by which to group search matches. A string that contains the name of a string field. Fields containing other data such as numbers, objects, or arrays cannot be used. This option is only available when making global queries.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Maximum group count. This field can be used only if group_field is specified. This option is only available when making global queries.
Possible values: 1 ≤ value ≤ 4294967295
This field defines the order of the groups in a search that uses group_field. The default sort order is relevance. This field can have the same values as the sort field, so single fields and arrays of fields are supported. This option is only available when making global queries.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Object mapping faceted, numeric search field names to the required ranges. Each key is a field name and each value is another object defining the ranges by mapping range name keys to string values describing the numeric ranges, for example "[0 TO 10]". This option is only available when making global queries.
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The Lucene query to execute.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Examples:Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Specifies which fields to highlight. If specified, the result object contains a highlights field with an entry for each specified field.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Number of fragments that are returned in highlights. If the search term occurs less often than the number of fragments that are specified, longer fragments are returned.
Possible values: 1 ≤ value ≤ 1048521
Default:
1
A string that is inserted after the highlighted word in the highlights output.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^<\/.*>$/
Default:
</em>
A string that is inserted before the highlighted word in the highlights output.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^<.*>$/
Default:
<em>
Number of characters in each fragment for highlights.
Possible values: 1 ≤ value ≤ 1048521
Default:
100
Include the full content of the documents in the return.
Default:
false
A JSON array of field names to include in search results. Any fields that are included must be indexed with the store:true option. The default is all fields.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Limit the number of the returned documents to the specified number.
Possible values: 0 ≤ value ≤ 200
Examples:Specifies the sort order of the results. In a grouped search (when group_field is used), this parameter specifies the sort order within a group. The default sort order is relevance. A JSON string of the form "fieldname<type>" or "-fieldname<type>" for descending order, where fieldname is the name of a string or number field, and type is either a number, a string, or a JSON array of strings. The type part is optional, and defaults to number. Some examples are "foo", "-foo", "bar<string>", "-foo<number>" and ["-foo<number>", "bar<string>"]. String fields that are used for sorting must not be analyzed fields. Fields that are used for sorting must be indexed by the same indexer that is used for the search query.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^-?[^<>]+(<(?:string|number)>)?$/
Do not wait for the index to finish building to return results.
Allowable values: [
ok
]This field defines an array of names of string fields, for which counts are requested. The response contains counts for each unique value of this field name among the documents that match the search query. Faceting must be enabled for this parameter to function. This option is only available when making global queries.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Restrict results to documents with a dimension equal to the specified label(s). The search matches only documents containing the value that was provided in the named field. It differs from using "fieldname:value" in the q parameter only in that the values are not analyzed. Faceting must be enabled for this parameter to function.
Possible values: 1 ≤ number of items ≤ 65535
Field by which to group search matches. A string that contains the name of a string field. Fields containing other data such as numbers, objects, or arrays cannot be used. This option is only available when making global queries.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Maximum group count. This field can be used only if group_field is specified. This option is only available when making global queries.
Possible values: 1 ≤ value ≤ 4294967295
This field defines the order of the groups in a search that uses group_field. The default sort order is relevance. This field can have the same values as the sort field, so single fields and arrays of fields are supported. This option is only available when making global queries.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Object mapping faceted, numeric search field names to the required ranges. Each key is a field name and each value is another object defining the ranges by mapping range name keys to string values describing the numeric ranges, for example "[0 TO 10]". This option is only available when making global queries.
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The Lucene query to execute.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Examples:Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Specifies which fields to highlight. If specified, the result object contains a highlights field with an entry for each specified field.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Number of fragments that are returned in highlights. If the search term occurs less often than the number of fragments that are specified, longer fragments are returned.
Possible values: 1 ≤ value ≤ 1048521
Default:
1
A string that is inserted after the highlighted word in the highlights output.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^<\/.*>$/
Default:
</em>
A string that is inserted before the highlighted word in the highlights output.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^<.*>$/
Default:
<em>
Number of characters in each fragment for highlights.
Possible values: 1 ≤ value ≤ 1048521
Default:
100
Include the full content of the documents in the return.
Default:
false
A JSON array of field names to include in search results. Any fields that are included must be indexed with the store:true option. The default is all fields.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Limit the number of the returned documents to the specified number.
Possible values: 0 ≤ value ≤ 200
Examples:Specifies the sort order of the results. In a grouped search (when group_field is used), this parameter specifies the sort order within a group. The default sort order is relevance. A JSON string of the form "fieldname<type>" or "-fieldname<type>" for descending order, where fieldname is the name of a string or number field, and type is either a number, a string, or a JSON array of strings. The type part is optional, and defaults to number. Some examples are "foo", "-foo", "bar<string>", "-foo<number>" and ["-foo<number>", "bar<string>"]. String fields that are used for sorting must not be analyzed fields. Fields that are used for sorting must be indexed by the same indexer that is used for the search query.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^-?[^<>]+(<(?:string|number)>)?$/
Do not wait for the index to finish building to return results.
Allowable values: [
ok
]This field defines an array of names of string fields, for which counts are requested. The response contains counts for each unique value of this field name among the documents that match the search query. Faceting must be enabled for this parameter to function. This option is only available when making global queries.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Restrict results to documents with a dimension equal to the specified label(s). The search matches only documents containing the value that was provided in the named field. It differs from using "fieldname:value" in the q parameter only in that the values are not analyzed. Faceting must be enabled for this parameter to function.
Possible values: 1 ≤ number of items ≤ 65535
Field by which to group search matches. A string that contains the name of a string field. Fields containing other data such as numbers, objects, or arrays cannot be used. This option is only available when making global queries.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Maximum group count. This field can be used only if group_field is specified. This option is only available when making global queries.
Possible values: 1 ≤ value ≤ 4294967295
This field defines the order of the groups in a search that uses group_field. The default sort order is relevance. This field can have the same values as the sort field, so single fields and arrays of fields are supported. This option is only available when making global queries.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Object mapping faceted, numeric search field names to the required ranges. Each key is a field name and each value is another object defining the ranges by mapping range name keys to string values describing the numeric ranges, for example "[0 TO 10]". This option is only available when making global queries.
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X POST "$SERVICE_URL/users/_design/allusers/_search/activeUsers" --data '{ "query": "name:Jane* AND active:True" }'
This example requires the
activeUsers
Cloudant Search index to exist. To create the design document with this index, see Create or modify a design document.
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } postSearchOptions := service.NewPostSearchOptions( "users", "allusers", "activeUsers", "name:Jane* AND active:True", ) searchResult, response, err := service.PostSearch(postSearchOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(searchResult, "", " ") fmt.Println(string(b))
This example requires the
activeUsers
Cloudant Search index to exist. To create the design document with this index, see Create or modify a design document.
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.PostSearchOptions; import com.ibm.cloud.cloudant.v1.model.SearchResult;
Cloudant service = Cloudant.newInstance(); PostSearchOptions searchOptions = new PostSearchOptions.Builder() .db("users") .ddoc("allusers") .index("activeUsers") .query("name:Jane* AND active:True") .build(); SearchResult response = service.postSearch(searchOptions).execute() .getResult(); System.out.println(response);
This example requires the
activeUsers
Cloudant Search index to exist. To create the design document with this index, see Create or modify a design document.
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.postSearch({ db: 'users', ddoc: 'allusers', index: 'activeUsers', query: 'name:Jane* AND active:True' }).then(response => { console.log(response.result); });
This example requires the
activeUsers
Cloudant Search index to exist. To create the design document with this index, see Create or modify a design document.
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.post_search( db='users', ddoc='allusers', index='activeUsers', query='name:Jane* AND active:True' ).get_result() print(response)
This example requires the
activeUsers
Cloudant Search index to exist. To create the design document with this index, see Create or modify a design document.
Response
Response type for PostSearch
: SearchResult
Response type for PostSearchAsStream
: io.ReadCloser
Response type for postSearch
: SearchResult
Response type for postSearchAsStream
: InputStream
Response type for postSearch
: SearchResult
Response type for postSearchAsStream
: NodeJS.ReadableStream
Response type for post_search
: SearchResult
Response type for post_search_as_stream
: BinaryIO
Schema for the result of a query search operation.
Total number of rows in the index matching the search query. The limit may truncate the number of matches returned.
Possible values: 0 ≤ value ≤ 4294967295
Array of row objects.
Possible values: 0 ≤ number of items ≤ 200
Offset where the list started.
Possible values: 0 ≤ value ≤ 9007199254740992
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
^[A-Za-z0-9=_-]*$
Grouped search matches.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The counts facet syntax returns the number of query results for each unique value of each named field.
- counts
The count of query results for each unique value.
- any property
Possible values: 0 ≤ value ≤ 9007199254740992
The range facet syntax reuses the standard Lucene syntax for ranges to return counts of results that fit into each specified category.
- ranges
Search range result counts.
- any property
Counts of range results that fit into each specified category.
Possible values: 0 ≤ value ≤ 9007199254740992
Array of grouped search matches.
Possible values: 1 ≤ number of items ≤ 4294967295
Schema for the result of a query search operation.
Total number of rows in the index matching the search query. The limit may truncate the number of matches returned.
Possible values: 0 ≤ value ≤ 4294967295
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Grouped search matches.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The counts facet syntax returns the number of query results for each unique value of each named field.
The range facet syntax reuses the standard Lucene syntax for ranges to return counts of results that fit into each specified category.
Array of row objects.
Possible values: 0 ≤ number of items ≤ 200
- Rows
Schema for a document.
- Doc
Schema for a map of attachment name to attachment metadata.
- Attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- Revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- RevsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for the fields returned by a query search operation, a map of field name to value.
Returns the context in which a search term was mentioned so that you can display more emphasized results to a user.
Possible values: number of items ≥ 0
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Array of grouped search matches.
Possible values: number of items ≥ 1
- Groups
Total number of rows in the index matching the search query. The limit may truncate the number of matches returned.
Possible values: 0 ≤ value ≤ 4294967295
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Grouped search matches.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The counts facet syntax returns the number of query results for each unique value of each named field.
The range facet syntax reuses the standard Lucene syntax for ranges to return counts of results that fit into each specified category.
Array of row objects.
Possible values: 0 ≤ number of items ≤ 200
- Rows
Schema for a document.
- Doc
Schema for a map of attachment name to attachment metadata.
- Attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- Revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- RevsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for the fields returned by a query search operation, a map of field name to value.
Returns the context in which a search term was mentioned so that you can display more emphasized results to a user.
Possible values: number of items ≥ 0
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for the result of a query search operation.
Total number of rows in the index matching the search query. The limit may truncate the number of matches returned.
Possible values: 0 ≤ value ≤ 4294967295
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Grouped search matches.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The counts facet syntax returns the number of query results for each unique value of each named field.
The range facet syntax reuses the standard Lucene syntax for ranges to return counts of results that fit into each specified category.
Array of row objects.
Possible values: 0 ≤ number of items ≤ 200
- rows
Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- revsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for the fields returned by a query search operation, a map of field name to value.
Returns the context in which a search term was mentioned so that you can display more emphasized results to a user.
Possible values: number of items ≥ 0
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Array of grouped search matches.
Possible values: number of items ≥ 1
- groups
Total number of rows in the index matching the search query. The limit may truncate the number of matches returned.
Possible values: 0 ≤ value ≤ 4294967295
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Grouped search matches.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The counts facet syntax returns the number of query results for each unique value of each named field.
The range facet syntax reuses the standard Lucene syntax for ranges to return counts of results that fit into each specified category.
Array of row objects.
Possible values: 0 ≤ number of items ≤ 200
- rows
Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- revsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for the fields returned by a query search operation, a map of field name to value.
Returns the context in which a search term was mentioned so that you can display more emphasized results to a user.
Possible values: number of items ≥ 0
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for the result of a query search operation.
Total number of rows in the index matching the search query. The limit may truncate the number of matches returned.
Possible values: 0 ≤ value ≤ 4294967295
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Grouped search matches.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The counts facet syntax returns the number of query results for each unique value of each named field.
The range facet syntax reuses the standard Lucene syntax for ranges to return counts of results that fit into each specified category.
Array of row objects.
Possible values: 0 ≤ number of items ≤ 200
- rows
Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for the fields returned by a query search operation, a map of field name to value.
Returns the context in which a search term was mentioned so that you can display more emphasized results to a user.
Possible values: number of items ≥ 0
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Array of grouped search matches.
Possible values: number of items ≥ 1
- groups
Total number of rows in the index matching the search query. The limit may truncate the number of matches returned.
Possible values: 0 ≤ value ≤ 4294967295
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Grouped search matches.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The counts facet syntax returns the number of query results for each unique value of each named field.
The range facet syntax reuses the standard Lucene syntax for ranges to return counts of results that fit into each specified category.
Array of row objects.
Possible values: 0 ≤ number of items ≤ 200
- rows
Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for the fields returned by a query search operation, a map of field name to value.
Returns the context in which a search term was mentioned so that you can display more emphasized results to a user.
Possible values: number of items ≥ 0
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for the result of a query search operation.
Total number of rows in the index matching the search query. The limit may truncate the number of matches returned.
Possible values: 0 ≤ value ≤ 4294967295
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Grouped search matches.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The counts facet syntax returns the number of query results for each unique value of each named field.
The range facet syntax reuses the standard Lucene syntax for ranges to return counts of results that fit into each specified category.
Array of row objects.
Possible values: 0 ≤ number of items ≤ 200
- rows
Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for the fields returned by a query search operation, a map of field name to value.
Returns the context in which a search term was mentioned so that you can display more emphasized results to a user.
Possible values: number of items ≥ 0
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Array of grouped search matches.
Possible values: number of items ≥ 1
- groups
Total number of rows in the index matching the search query. The limit may truncate the number of matches returned.
Possible values: 0 ≤ value ≤ 4294967295
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Grouped search matches.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The counts facet syntax returns the number of query results for each unique value of each named field.
The range facet syntax reuses the standard Lucene syntax for ranges to return counts of results that fit into each specified category.
Array of row objects.
Possible values: 0 ≤ number of items ≤ 200
- rows
Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for the fields returned by a query search operation, a map of field name to value.
Returns the context in which a search term was mentioned so that you can display more emphasized results to a user.
Possible values: number of items ≥ 0
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Status Code
HTTP response for search operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example SearchResult response.
{ "bookmark": "g2wAAAEPeJzLYWBgYMlgTmGQT0lKzi9KdUhJMtFLykxPyilN1UvOyS9NScwr0ctLLckBKmRKZEiy____f1YGk5v9iztMQCGGRGZU3Wa4dSc5AMmkepgBlxdXgQ1gINr6PBaQhgYgBTRjP9iQDwxgkMhEtCsghhyAGAJxybeak2BDGLMAi8FWFQ", "rows": [ { "fields": {}, "id": "exampleid", "order": [ "0.8410536050796509", "1" ] } ], "total_rows": 1 }
Example SearchResult response.
{ "bookmark": "g2wAAAEPeJzLYWBgYMlgTmGQT0lKzi9KdUhJMtFLykxPyilN1UvOyS9NScwr0ctLLckBKmRKZEiy____f1YGk5v9iztMQCGGRGZU3Wa4dSc5AMmkepgBlxdXgQ1gINr6PBaQhgYgBTRjP9iQDwxgkMhEtCsghhyAGAJxybeak2BDGLMAi8FWFQ", "rows": [ { "fields": {}, "id": "exampleid", "order": [ "0.8410536050796509", "1" ] } ], "total_rows": 1 }
Example error response for a bad request with an unsupported option.
{ "error": "bad_request", "reason": "`partition` is not supported on this search index" }
Example error response for a bad request with an unsupported option.
{ "error": "bad_request", "reason": "`partition` is not supported on this search index" }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve information about the search index disk size
Retrieve size of the search index on disk.
Retrieve size of the search index on disk.
Retrieve size of the search index on disk.
Retrieve size of the search index on disk.
Retrieve size of the search index on disk.
GET /{db}/_design/{ddoc}/_search_disk_size/{index}
(cloudant *CloudantV1) GetSearchDiskSize(getSearchDiskSizeOptions *GetSearchDiskSizeOptions) (result *SearchDiskSizeInformation, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) GetSearchDiskSizeWithContext(ctx context.Context, getSearchDiskSizeOptions *GetSearchDiskSizeOptions) (result *SearchDiskSizeInformation, response *core.DetailedResponse, err error)
ServiceCall<SearchDiskSizeInformation> getSearchDiskSize(GetSearchDiskSizeOptions getSearchDiskSizeOptions)
getSearchDiskSize(params)
get_search_disk_size(
self,
db: str,
ddoc: str,
index: str,
**kwargs,
) -> DetailedResponse
Request
Instantiate the GetSearchDiskSizeOptions
struct and set the fields to provide parameter values for the GetSearchDiskSize
method.
Use the GetSearchDiskSizeOptions.Builder
to create a GetSearchDiskSizeOptions
object that contains the parameter values for the getSearchDiskSize
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Path parameter to specify the index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The GetSearchDiskSize options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The getSearchDiskSize options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Response
Schema for search index disk size.
The name of the search index prefixed by the design document ID where the index is stored.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Schema for search index disk size.
Schema for search index disk size.
The name of the search index prefixed by the design document ID where the index is stored.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for search index disk size.
- SearchIndex
The size of the search index on disk.
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for search index disk size.
The name of the search index prefixed by the design document ID where the index is stored.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for search index disk size.
- searchIndex
The size of the search index on disk.
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for search index disk size.
The name of the search index prefixed by the design document ID where the index is stored.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for search index disk size.
- searchIndex
The size of the search index on disk.
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for search index disk size.
The name of the search index prefixed by the design document ID where the index is stored.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for search index disk size.
- search_index
The size of the search index on disk.
Possible values: 0 ≤ value ≤ 9007199254740992
Status Code
HTTP response for search disk size operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example SearchDiskSizeInformation response.
{ "name": "_design/appliances/findByPrice", "search_index": { "disk_size": 2889 } }
Example SearchDiskSizeInformation response.
{ "name": "_design/appliances/findByPrice", "search_index": { "disk_size": 2889 } }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve HTTP headers for information about a search index disk size
Retrieves the HTTP headers for a search index disk size.
HEAD /{db}/_design/{ddoc}/_search_disk_size/{index}
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Path parameter to specify the index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for search disk size operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Retrieve information about a search index
Retrieve search index metadata information, such as the size of the index on disk.
Retrieve search index metadata information, such as the size of the index on disk.
Retrieve search index metadata information, such as the size of the index on disk.
Retrieve search index metadata information, such as the size of the index on disk.
Retrieve search index metadata information, such as the size of the index on disk.
GET /{db}/_design/{ddoc}/_search_info/{index}
(cloudant *CloudantV1) GetSearchInfo(getSearchInfoOptions *GetSearchInfoOptions) (result *SearchInfoResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) GetSearchInfoWithContext(ctx context.Context, getSearchInfoOptions *GetSearchInfoOptions) (result *SearchInfoResult, response *core.DetailedResponse, err error)
ServiceCall<SearchInfoResult> getSearchInfo(GetSearchInfoOptions getSearchInfoOptions)
getSearchInfo(params)
get_search_info(
self,
db: str,
ddoc: str,
index: str,
**kwargs,
) -> DetailedResponse
Request
Instantiate the GetSearchInfoOptions
struct and set the fields to provide parameter values for the GetSearchInfo
method.
Use the GetSearchInfoOptions.Builder
to create a GetSearchInfoOptions
object that contains the parameter values for the getSearchInfo
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Path parameter to specify the index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The GetSearchInfo options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The getSearchInfo options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/products/_design/appliances/_search_info/findByPrice"
This example requires the
findByPrice
Cloudant Search partitioned index to exist. To create the design document with this index, see Create or modify a design document.
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } getSearchInfoOptions := service.NewGetSearchInfoOptions( "events", "checkout", "findByDate", ) searchInfoResult, response, err := service.GetSearchInfo(getSearchInfoOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(searchInfoResult, "", " ") fmt.Println(string(b))
This example requires the
findByDate
Cloudant Search partitioned index to exist. To create the design document with this index, see Create or modify a design document.
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.GetSearchInfoOptions; import com.ibm.cloud.cloudant.v1.model.SearchInfoResult;
Cloudant service = Cloudant.newInstance(); GetSearchInfoOptions infoOptions = new GetSearchInfoOptions.Builder() .db("events") .ddoc("checkout") .index("findByDate") .build(); SearchInfoResult response = service.getSearchInfo(infoOptions).execute() .getResult(); System.out.println(response);
This example requires the
findByDate
Cloudant Search partitioned index to exist. To create the design document with this index, see Create or modify a design document.
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.getSearchInfo({ db: 'events', ddoc: 'checkout', index: 'findByDate' }).then(response => { console.log(response.result); });
This example requires the
findByDate
Cloudant Search partitioned index to exist. To create the design document with this index, see Create or modify a design document.
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.get_search_info( db='events', ddoc='checkout', index='findByDate' ).get_result() print(response)
This example requires the
findByDate
Cloudant Search partitioned index to exist. To create the design document with this index, see Create or modify a design document.
Response
Schema for search index information.
The name of the search index prefixed by the design document ID where the index is stored.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Schema for metadata information about a search index.
Schema for search index information.
The name of the search index prefixed by the design document ID where the index is stored.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for metadata information about a search index.
- SearchIndex
The committed sequence identifier.
Possible values: 0 ≤ value ≤ 9007199254740992
The size of the search index on disk.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of the number of indexed documents.
Possible values: 0 ≤ value ≤ 9007199254740992
The number of deleted documents.
Possible values: 0 ≤ value ≤ 9007199254740992
The pending sequence identifier.
Possible values: 0 ≤ value ≤ 9007199254740992
Unique signature of the search index.
Possible values: length = 32, Value must match regular expression
/^[\\da-f]{32}$/
Schema for search index information.
The name of the search index prefixed by the design document ID where the index is stored.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for metadata information about a search index.
- searchIndex
The committed sequence identifier.
Possible values: 0 ≤ value ≤ 9007199254740992
The size of the search index on disk.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of the number of indexed documents.
Possible values: 0 ≤ value ≤ 9007199254740992
The number of deleted documents.
Possible values: 0 ≤ value ≤ 9007199254740992
The pending sequence identifier.
Possible values: 0 ≤ value ≤ 9007199254740992
Unique signature of the search index.
Possible values: length = 32, Value must match regular expression
/^[\\da-f]{32}$/
Schema for search index information.
The name of the search index prefixed by the design document ID where the index is stored.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for metadata information about a search index.
- searchIndex
The committed sequence identifier.
Possible values: 0 ≤ value ≤ 9007199254740992
The size of the search index on disk.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of the number of indexed documents.
Possible values: 0 ≤ value ≤ 9007199254740992
The number of deleted documents.
Possible values: 0 ≤ value ≤ 9007199254740992
The pending sequence identifier.
Possible values: 0 ≤ value ≤ 9007199254740992
Unique signature of the search index.
Possible values: length = 32, Value must match regular expression
/^[\\da-f]{32}$/
Schema for search index information.
The name of the search index prefixed by the design document ID where the index is stored.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for metadata information about a search index.
- search_index
The committed sequence identifier.
Possible values: 0 ≤ value ≤ 9007199254740992
The size of the search index on disk.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of the number of indexed documents.
Possible values: 0 ≤ value ≤ 9007199254740992
The number of deleted documents.
Possible values: 0 ≤ value ≤ 9007199254740992
The pending sequence identifier.
Possible values: 0 ≤ value ≤ 9007199254740992
Unique signature of the search index.
Possible values: length = 32, Value must match regular expression
/^[\\da-f]{32}$/
Status Code
HTTP response for search index info operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example SearchInfoResult response.
{ "name": "_design/appliances/findByPrice", "search_index": { "committed_seq": 47, "disk_size": 2889, "doc_count": 3, "doc_del_count": 0, "pending_seq": 47, "signature": "bedc44e56c2ba97902aeaac2b51ad77c" } }
Example SearchInfoResult response.
{ "name": "_design/appliances/findByPrice", "search_index": { "committed_seq": 47, "disk_size": 2889, "doc_count": 3, "doc_del_count": 0, "pending_seq": 47, "signature": "bedc44e56c2ba97902aeaac2b51ad77c" } }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve HTTP headers for information about a search index
Retrieves the HTTP headers for a search index.
HEAD /{db}/_design/{ddoc}/_search_info/{index}
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Path parameter to specify the index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for search index info operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Query a database partition search index (GET)
Partitioned Search indexes, which are defined in design documents, allow partition databases to be queried by using Lucene Query Parser Syntax. Search indexes are defined by an index function, similar to a map function in MapReduce views. The index function decides what data to index and store in the index.
GET /{db}/_partition/{partition_key}/_design/{ddoc}/_search/{index}
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_:][^:]*$
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Path parameter to specify the index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query Parameters
Query parameter to specify a Lucene search query. Alias of
q
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query parameter to specify a bookmark that was received from a previous request. This parameter enables paging through the results. If there are no more results after the bookmark, you get a response containing no further results and the same bookmark, confirming the end of the result list.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
^[A-Za-z0-9=_-]*$
Query parameter to specify which fields to highlight. If specified, the result object contains a highlights field with an entry for each specified field.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query parameter to specify a string that is inserted before the highlighted word in the highlights output.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^<.*>$
Default:
<em>
Query parameter to specify a string that is inserted after the highlighted word in the highlights output.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^$
Default:
</em>
Query parameter to specify the number of fragments that are returned in highlights. If the search term occurs less often than the number of fragments that are specified, longer fragments are returned.
Possible values: 1 ≤ value ≤ 1048521
Default:
1
Query parameter to specify the number of characters in each fragment for highlights.
Possible values: 1 ≤ value ≤ 1048521
Default:
100
Query parameter to specify whether to include the full content of the documents in the response.
Default:
false
Query parameter to specify a JSON array of field names to include in search results. Any fields that are included must be indexed with the
store:true
option. The default is all fields.Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify the sort order of the results. In a grouped search (when group_field is used), this parameter specifies the sort order within a group. The default sort order is relevance. A JSON string of the form "fieldname<type>" or -fieldname<type> for descending order, where fieldname is the name of a string or number field, and type is either a number, a string, or a JSON array of strings. The type part is optional, and defaults to number. Some examples are "foo", "-foo", "bar<string>", "-foo<number>" and ["-foo<number>", "bar<string>"]. String fields that are used for sorting must not be analyzed fields. Fields that are used for sorting must be indexed by the same indexer that is used for the search query.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^-?[^<>]+(<(?:string|number)>)?$
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/products/_partition/small-appliances/_design/appliances/_search/findByPrice?query=price:[14%20TO%2020]"
This example requires the
findByPrice
Cloudant Search partitioned index to exist. To create the design document with this index, see Create or modify a design document.
Response
Schema for the result of a query search operation.
Total number of rows in the index matching the search query. The limit may truncate the number of matches returned.
Possible values: 0 ≤ value ≤ 4294967295
Array of row objects.
Possible values: 0 ≤ number of items ≤ 200
Offset where the list started.
Possible values: 0 ≤ value ≤ 9007199254740992
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
^[A-Za-z0-9=_-]*$
Grouped search matches.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The counts facet syntax returns the number of query results for each unique value of each named field.
- counts
The count of query results for each unique value.
- any property
Possible values: 0 ≤ value ≤ 9007199254740992
The range facet syntax reuses the standard Lucene syntax for ranges to return counts of results that fit into each specified category.
- ranges
Search range result counts.
- any property
Counts of range results that fit into each specified category.
Possible values: 0 ≤ value ≤ 9007199254740992
Array of grouped search matches.
Possible values: 1 ≤ number of items ≤ 4294967295
Status Code
HTTP response for search operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example SearchResult response for a database partition.
{ "bookmark": "g1AAAAEPeJzLYWBgYMlgTmGQT0lKzi9KdUhJMtFLykxPyilN1UvOyS9NScwr0ctLLckBKmRKZEiy____f1YGk5v9iztMQCGGRGZU3Wa4dSc5AMmkepgBlxdXgQ1gINr6PBaQhgYgBTRjP9iQDwxgkMhEtCsghhyAGAJxybeak2BDGLMAi8FWFQ", "rows": [ { "fields": {}, "id": "small-appliances:1000042", "order": [ "1.2277607917785645", "0" ] } ], "total_rows": 1 }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve HTTP headers for a database partition search index (GET)
Retrieves the HTTP headers for a database partition search index (GET).
HEAD /{db}/_partition/{partition_key}/_design/{ddoc}/_search/{index}
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_:][^:]*$
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Path parameter to specify the index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for search operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Retrieve information about a database partition
Given a partition key, return the database name, sizes, partition, doc count, and doc delete count.
Given a partition key, return the database name, sizes, partition, doc count, and doc delete count.
Given a partition key, return the database name, sizes, partition, doc count, and doc delete count.
Given a partition key, return the database name, sizes, partition, doc count, and doc delete count.
Given a partition key, return the database name, sizes, partition, doc count, and doc delete count.
GET /{db}/_partition/{partition_key}
(cloudant *CloudantV1) GetPartitionInformation(getPartitionInformationOptions *GetPartitionInformationOptions) (result *PartitionInformation, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) GetPartitionInformationWithContext(ctx context.Context, getPartitionInformationOptions *GetPartitionInformationOptions) (result *PartitionInformation, response *core.DetailedResponse, err error)
ServiceCall<PartitionInformation> getPartitionInformation(GetPartitionInformationOptions getPartitionInformationOptions)
getPartitionInformation(params)
get_partition_information(
self,
db: str,
partition_key: str,
**kwargs,
) -> DetailedResponse
Request
Instantiate the GetPartitionInformationOptions
struct and set the fields to provide parameter values for the GetPartitionInformation
method.
Use the GetPartitionInformationOptions.Builder
to create a GetPartitionInformationOptions
object that contains the parameter values for the getPartitionInformation
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_:][^:]*$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The GetPartitionInformation options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
The getPartitionInformation options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/products/_partition/small-appliances" -H "Content-Type: application/json"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } getPartitionInformationOptions := service.NewGetPartitionInformationOptions( "events", "ns1HJS13AMkK", ) partitionInformation, response, err := service.GetPartitionInformation(getPartitionInformationOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(partitionInformation, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.GetPartitionInformationOptions; import com.ibm.cloud.cloudant.v1.model.PartitionInformation;
Cloudant service = Cloudant.newInstance(); GetPartitionInformationOptions informationOptions = new GetPartitionInformationOptions.Builder() .db("events") .partitionKey("ns1HJS13AMkK") .build(); PartitionInformation response = service.getPartitionInformation(informationOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.getPartitionInformation({ db: 'events', partitionKey: 'ns1HJS13AMkK' }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.get_partition_information( db='events', partition_key='ns1HJS13AMkK' ).get_result() print(response)
Response
Schema for information about a database partition.
Schema for a database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
A count of the documents in the specified database partition.
Possible values: 0 ≤ value ≤ 195225786
Number of deleted documents.
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_:][^:]*$
The size of active and external data, in bytes.
Schema for information about the partition index count and limit in a database.
Schema for information about a database partition.
Schema for a database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
A count of the documents in the specified database partition.
Possible values: 0 ≤ value ≤ 195225786
Number of deleted documents.
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
Schema for information about the partition index count and limit in a database.
- PartitionedIndexes
Total count of the partitioned indexes.
Possible values: 0 ≤ value ≤ 10
The count breakdown of partitioned indexes.
- Indexes
Number of partitioned search indexes.
Possible values: 0 ≤ value ≤ 10
Number of partitioned view indexes.
Possible values: 0 ≤ value ≤ 10
The partitioned index limit.
Possible values: 0 ≤ value ≤ 10
The size of active and external data, in bytes.
- Sizes
The size of live data inside the database, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740992
The uncompressed size of database contents in bytes.
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for information about a database partition.
Schema for a database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
A count of the documents in the specified database partition.
Possible values: 0 ≤ value ≤ 195225786
Number of deleted documents.
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
Schema for information about the partition index count and limit in a database.
- partitionedIndexes
Total count of the partitioned indexes.
Possible values: 0 ≤ value ≤ 10
The count breakdown of partitioned indexes.
- indexes
Number of partitioned search indexes.
Possible values: 0 ≤ value ≤ 10
Number of partitioned view indexes.
Possible values: 0 ≤ value ≤ 10
The partitioned index limit.
Possible values: 0 ≤ value ≤ 10
The size of active and external data, in bytes.
- sizes
The size of live data inside the database, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740992
The uncompressed size of database contents in bytes.
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for information about a database partition.
Schema for a database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
A count of the documents in the specified database partition.
Possible values: 0 ≤ value ≤ 195225786
Number of deleted documents.
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
Schema for information about the partition index count and limit in a database.
- partitionedIndexes
Total count of the partitioned indexes.
Possible values: 0 ≤ value ≤ 10
The count breakdown of partitioned indexes.
- indexes
Number of partitioned search indexes.
Possible values: 0 ≤ value ≤ 10
Number of partitioned view indexes.
Possible values: 0 ≤ value ≤ 10
The partitioned index limit.
Possible values: 0 ≤ value ≤ 10
The size of active and external data, in bytes.
- sizes
The size of live data inside the database, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740992
The uncompressed size of database contents in bytes.
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for information about a database partition.
Schema for a database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
A count of the documents in the specified database partition.
Possible values: 0 ≤ value ≤ 195225786
Number of deleted documents.
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
Schema for information about the partition index count and limit in a database.
- partitioned_indexes
Total count of the partitioned indexes.
Possible values: 0 ≤ value ≤ 10
The count breakdown of partitioned indexes.
- indexes
Number of partitioned search indexes.
Possible values: 0 ≤ value ≤ 10
Number of partitioned view indexes.
Possible values: 0 ≤ value ≤ 10
The partitioned index limit.
Possible values: 0 ≤ value ≤ 10
The size of active and external data, in bytes.
- sizes
The size of live data inside the database, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740992
The uncompressed size of database contents in bytes.
Possible values: 0 ≤ value ≤ 9007199254740992
Status Code
HTTP response for
/{db}/_partition/{partition_key}
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example PartitionInformation response.
{ "db_name": "products", "doc_count": 3, "doc_del_count": 1, "partition": "small-appliances", "partitioned_indexes": { "count": 1, "indexes": { "search": 0, "view": 1 }, "limit": 10 }, "sizes": { "active": 1539, "external": 1286 } }
Example PartitionInformation response.
{ "db_name": "products", "doc_count": 3, "doc_del_count": 1, "partition": "small-appliances", "partitioned_indexes": { "count": 1, "indexes": { "search": 0, "view": 1 }, "limit": 10 }, "sizes": { "active": 1539, "external": 1286 } }
Example error response for a bad request with an invalid partition name.
{ "error": "bad_request", "reason": "invalid_partition_req" }
Example error response for a bad request with an invalid partition name.
{ "error": "bad_request", "reason": "invalid_partition_req" }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve HTTP headers for information about a database partition
Retrieves the HTTP headers for information about a database partition.
HEAD /{db}/_partition/{partition_key}
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_:][^:]*$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for
/{db}/_partition/{partition_key}
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Query a list of all documents in a database partition (GET)
Queries the primary index (all document IDs). The results that match the query parameters are returned in a JSON object, including a list of matching documents with basic contents, such as the ID and revision. When no query parameters are specified, results for all documents in the database partition are returned. Optionally, document content or additional metadata can be included in the response.
GET /{db}/_partition/{partition_key}/_all_docs
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_:][^:]*$
Query Parameters
Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Query parameter to specify whether to return the documents in descending by key order.
Default:
false
Query parameter to specify to stop returning records when the specified key is reached. String representation of any JSON type that matches the key type emitted by the view function.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query parameter to specify to stop returning records when the specified document ID is reached.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].*$
Query parameter to specify whether to include the full content of the documents in the response.
Default:
false
Query parameter to specify whether the specified end key should be included in the result.
Default:
true
Query parameter to specify to return only documents that match the specified key. String representation of any JSON type that matches the key type emitted by the view function.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query parameter to specify returning only documents that match any of the specified keys. String representation of a JSON array of keys that match the key type emitted by the view function. Must be URL encoded.
Possible values: 2 ≤ length ≤ 7168, Value must match regular expression
^\[(".*")*\]$
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Query parameter to specify to start returning records from the specified key. String representation of any JSON type that matches the key type emitted by the view function.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query parameter to specify to start returning records from the specified document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].*$
Query parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/products/_partition/small-appliances/_all_docs?include_docs=true"
Response
Schema for the result of an all documents operation.
Offset where the list started.
Possible values: 0 ≤ value ≤ 9007199254740992
Total number of document results.
Possible values: 0 ≤ value ≤ 4294967295
List of doc results.
Possible values: 0 ≤ number of items ≤ 4294967295
Current update sequence for the database
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Status Code
HTTP response for getPartitionAllDocs and postPartitionAllDocs.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example AllDocsResult response for a database partition.
{ "offset": 0, "rows": [ { "id": "small-appliances:1000042", "key": "small-appliances:1000042", "value": { "rev": "1-5005d65514fe9e90f8eccf174af5dd64" } }, { "id": "small-appliances:1000043", "key": "small-appliances:1000043", "value": { "rev": "1-2d7810b054babeda4812b3924428d6d6" } } ], "total_rows": 2 }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve HTTP headers for a list of all documents in a database partition (GET)
Retrieves the HTTP headers for a list of all documents in a database partition (GET).
HEAD /{db}/_partition/{partition_key}/_all_docs
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_:][^:]*$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for
/_all_docs
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Query a list of all documents in a database partition
Queries the primary index (all document IDs). The results that match the query parameters are returned in a JSON object, including a list of matching documents with basic contents, such as the ID and revision. When no query parameters are specified, results for all documents in the database partition are returned. Optionally, document content or additional metadata can be included in the response.
Queries the primary index (all document IDs). The results that match the query parameters are returned in a JSON object, including a list of matching documents with basic contents, such as the ID and revision. When no query parameters are specified, results for all documents in the database partition are returned. Optionally, document content or additional metadata can be included in the response.
Queries the primary index (all document IDs). The results that match the query parameters are returned in a JSON object, including a list of matching documents with basic contents, such as the ID and revision. When no query parameters are specified, results for all documents in the database partition are returned. Optionally, document content or additional metadata can be included in the response.
Queries the primary index (all document IDs). The results that match the query parameters are returned in a JSON object, including a list of matching documents with basic contents, such as the ID and revision. When no query parameters are specified, results for all documents in the database partition are returned. Optionally, document content or additional metadata can be included in the response.
Queries the primary index (all document IDs). The results that match the query parameters are returned in a JSON object, including a list of matching documents with basic contents, such as the ID and revision. When no query parameters are specified, results for all documents in the database partition are returned. Optionally, document content or additional metadata can be included in the response.
POST /{db}/_partition/{partition_key}/_all_docs
(cloudant *CloudantV1) PostPartitionAllDocs(postPartitionAllDocsOptions *PostPartitionAllDocsOptions) (result *AllDocsResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostPartitionAllDocsWithContext(ctx context.Context, postPartitionAllDocsOptions *PostPartitionAllDocsOptions) (result *AllDocsResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostPartitionAllDocsAsStream(postPartitionAllDocsOptions *PostPartitionAllDocsOptions) (result io.ReadCloser, response *core.DetailedResponse, err error)
ServiceCall<AllDocsResult> postPartitionAllDocs(PostPartitionAllDocsOptions postPartitionAllDocsOptions)
ServiceCall<InputStream> postPartitionAllDocsAsStream(PostPartitionAllDocsOptions postPartitionAllDocsOptions)
postPartitionAllDocs(params)
postPartitionAllDocsAsStream(params)
post_partition_all_docs(
self,
db: str,
partition_key: str,
*,
att_encoding_info: Optional[bool] = None,
attachments: Optional[bool] = None,
conflicts: Optional[bool] = None,
descending: Optional[bool] = None,
include_docs: Optional[bool] = None,
inclusive_end: Optional[bool] = None,
limit: Optional[int] = None,
skip: Optional[int] = None,
update_seq: Optional[bool] = None,
end_key: Optional[str] = None,
key: Optional[str] = None,
keys: Optional[List[str]] = None,
start_key: Optional[str] = None,
**kwargs,
) -> DetailedResponse
post_partition_all_docs_as_stream(
self,
db: str,
partition_key: str,
*,
att_encoding_info: Optional[bool] = None,
attachments: Optional[bool] = None,
conflicts: Optional[bool] = None,
descending: Optional[bool] = None,
include_docs: Optional[bool] = None,
inclusive_end: Optional[bool] = None,
limit: Optional[int] = None,
skip: Optional[int] = None,
update_seq: Optional[bool] = None,
end_key: Optional[str] = None,
key: Optional[str] = None,
keys: Optional[List[str]] = None,
start_key: Optional[str] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the PostPartitionAllDocsOptions
struct and set the fields to provide parameter values for the PostPartitionAllDocs
method.
Use the PostPartitionAllDocsOptions.Builder
to create a PostPartitionAllDocsOptions
object that contains the parameter values for the postPartitionAllDocs
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_:][^:]*$
HTTP request body for postAllDocs and postPartitionAllDocs.
Example AllDocs request.
{
"limit": 10,
"start_key": "0007741142412418284"
}
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Query parameter to specify whether to sort the returned rows. Setting this to false offers a performance boost. The total_rows and offset fields are not available when this is set to false.
Default:
true
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The PostPartitionAllDocs options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Examples:10
Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Examples:0007741142412418284
The postPartitionAllDocs options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Examples:10
Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Examples:0007741142412418284
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Examples:Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Examples:
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Examples:Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Examples:
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X POST "$SERVICE_URL/products/_partition/small-appliances/_all_docs" -H "Content-Type: application/json" --data '{ "include_docs": true }'
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } postPartitionAllDocsOptions := service.NewPostPartitionAllDocsOptions( "events", "ns1HJS13AMkK", ) postPartitionAllDocsOptions.SetIncludeDocs(true) allDocsResult, response, err := service.PostPartitionAllDocs(postPartitionAllDocsOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(allDocsResult, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.AllDocsResult; import com.ibm.cloud.cloudant.v1.model.PostPartitionAllDocsOptions;
Cloudant service = Cloudant.newInstance(); PostPartitionAllDocsOptions allDocsOptions = new PostPartitionAllDocsOptions.Builder() .db("events") .partitionKey("ns1HJS13AMkK") .includeDocs(true) .build(); AllDocsResult response = service.postPartitionAllDocs(allDocsOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.postPartitionAllDocs({ db: 'events', partitionKey: 'ns1HJS13AMkK', includeDocs: true }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.post_partition_all_docs( db='events', partition_key='ns1HJS13AMkK', include_docs=True ).get_result() print(response)
Response
Response type for PostPartitionAllDocs
: AllDocsResult
Response type for PostPartitionAllDocsAsStream
: io.ReadCloser
Response type for postPartitionAllDocs
: AllDocsResult
Response type for postPartitionAllDocsAsStream
: InputStream
Response type for postPartitionAllDocs
: AllDocsResult
Response type for postPartitionAllDocsAsStream
: NodeJS.ReadableStream
Response type for post_partition_all_docs
: AllDocsResult
Response type for post_partition_all_docs_as_stream
: BinaryIO
Schema for the result of an all documents operation.
Offset where the list started.
Possible values: 0 ≤ value ≤ 9007199254740992
Total number of document results.
Possible values: 0 ≤ value ≤ 4294967295
List of doc results.
Possible values: 0 ≤ number of items ≤ 4294967295
Current update sequence for the database
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Schema for the result of an all documents operation.
Total number of document results.
Possible values: 0 ≤ value ≤ 4294967295
List of doc results.
Possible values: number of items ≥ 0
- Rows
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a document.
- Doc
Schema for a map of attachment name to attachment metadata.
- Attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- Revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- RevsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Value of built-in
/_all_docs
style view.- Value
If
true
then the document is deleted. Not present for undeleted documents.Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for the result of an all documents operation.
Total number of document results.
Possible values: 0 ≤ value ≤ 4294967295
List of doc results.
Possible values: number of items ≥ 0
- rows
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- revsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Value of built-in
/_all_docs
style view.- value
If
true
then the document is deleted. Not present for undeleted documents.Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for the result of an all documents operation.
Total number of document results.
Possible values: 0 ≤ value ≤ 4294967295
List of doc results.
Possible values: number of items ≥ 0
- rows
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Value of built-in
/_all_docs
style view.- value
If
true
then the document is deleted. Not present for undeleted documents.Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for the result of an all documents operation.
Total number of document results.
Possible values: 0 ≤ value ≤ 4294967295
List of doc results.
Possible values: number of items ≥ 0
- rows
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Value of built-in
/_all_docs
style view.- value
If
true
then the document is deleted. Not present for undeleted documents.Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Status Code
HTTP response for getPartitionAllDocs and postPartitionAllDocs.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example AllDocsResult response for a database partition.
{ "offset": 0, "rows": [ { "id": "small-appliances:1000042", "key": "small-appliances:1000042", "value": { "rev": "1-5005d65514fe9e90f8eccf174af5dd64" } }, { "id": "small-appliances:1000043", "key": "small-appliances:1000043", "value": { "rev": "1-2d7810b054babeda4812b3924428d6d6" } } ], "total_rows": 2 }
Example AllDocsResult response for a database partition.
{ "offset": 0, "rows": [ { "id": "small-appliances:1000042", "key": "small-appliances:1000042", "value": { "rev": "1-5005d65514fe9e90f8eccf174af5dd64" } }, { "id": "small-appliances:1000043", "key": "small-appliances:1000043", "value": { "rev": "1-2d7810b054babeda4812b3924428d6d6" } } ], "total_rows": 2 }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Query a database partition search index (GET)
Partitioned Search indexes, which are defined in design documents, allow partition databases to be queried by using Lucene Query Parser Syntax. Search indexes are defined by an index function, similar to a map function in MapReduce views. The index function decides what data to index and store in the index.
GET /{db}/_partition/{partition_key}/_design/{ddoc}/_search/{index}
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_:][^:]*$
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Path parameter to specify the index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query Parameters
Query parameter to specify a Lucene search query. Alias of
q
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query parameter to specify a bookmark that was received from a previous request. This parameter enables paging through the results. If there are no more results after the bookmark, you get a response containing no further results and the same bookmark, confirming the end of the result list.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
^[A-Za-z0-9=_-]*$
Query parameter to specify which fields to highlight. If specified, the result object contains a highlights field with an entry for each specified field.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query parameter to specify a string that is inserted before the highlighted word in the highlights output.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^<.*>$
Default:
<em>
Query parameter to specify a string that is inserted after the highlighted word in the highlights output.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^$
Default:
</em>
Query parameter to specify the number of fragments that are returned in highlights. If the search term occurs less often than the number of fragments that are specified, longer fragments are returned.
Possible values: 1 ≤ value ≤ 1048521
Default:
1
Query parameter to specify the number of characters in each fragment for highlights.
Possible values: 1 ≤ value ≤ 1048521
Default:
100
Query parameter to specify whether to include the full content of the documents in the response.
Default:
false
Query parameter to specify a JSON array of field names to include in search results. Any fields that are included must be indexed with the
store:true
option. The default is all fields.Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify the sort order of the results. In a grouped search (when group_field is used), this parameter specifies the sort order within a group. The default sort order is relevance. A JSON string of the form "fieldname<type>" or -fieldname<type> for descending order, where fieldname is the name of a string or number field, and type is either a number, a string, or a JSON array of strings. The type part is optional, and defaults to number. Some examples are "foo", "-foo", "bar<string>", "-foo<number>" and ["-foo<number>", "bar<string>"]. String fields that are used for sorting must not be analyzed fields. Fields that are used for sorting must be indexed by the same indexer that is used for the search query.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^-?[^<>]+(<(?:string|number)>)?$
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/products/_partition/small-appliances/_design/appliances/_search/findByPrice?query=price:[14%20TO%2020]"
This example requires the
findByPrice
Cloudant Search partitioned index to exist. To create the design document with this index, see Create or modify a design document.
Response
Schema for the result of a query search operation.
Total number of rows in the index matching the search query. The limit may truncate the number of matches returned.
Possible values: 0 ≤ value ≤ 4294967295
Array of row objects.
Possible values: 0 ≤ number of items ≤ 200
Offset where the list started.
Possible values: 0 ≤ value ≤ 9007199254740992
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
^[A-Za-z0-9=_-]*$
Grouped search matches.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The counts facet syntax returns the number of query results for each unique value of each named field.
- counts
The count of query results for each unique value.
- any property
Possible values: 0 ≤ value ≤ 9007199254740992
The range facet syntax reuses the standard Lucene syntax for ranges to return counts of results that fit into each specified category.
- ranges
Search range result counts.
- any property
Counts of range results that fit into each specified category.
Possible values: 0 ≤ value ≤ 9007199254740992
Array of grouped search matches.
Possible values: 1 ≤ number of items ≤ 4294967295
Status Code
HTTP response for search operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example SearchResult response for a database partition.
{ "bookmark": "g1AAAAEPeJzLYWBgYMlgTmGQT0lKzi9KdUhJMtFLykxPyilN1UvOyS9NScwr0ctLLckBKmRKZEiy____f1YGk5v9iztMQCGGRGZU3Wa4dSc5AMmkepgBlxdXgQ1gINr6PBaQhgYgBTRjP9iQDwxgkMhEtCsghhyAGAJxybeak2BDGLMAi8FWFQ", "rows": [ { "fields": {}, "id": "small-appliances:1000042", "order": [ "1.2277607917785645", "0" ] } ], "total_rows": 1 }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve HTTP headers for a database partition search index (GET)
Retrieves the HTTP headers for a database partition search index (GET).
HEAD /{db}/_partition/{partition_key}/_design/{ddoc}/_search/{index}
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_:][^:]*$
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Path parameter to specify the index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for search operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Query a database partition search index
Partitioned Search indexes, which are defined in design documents, allow partition databases to be queried by using Lucene Query Parser Syntax. Search indexes are defined by an index function, similar to a map function in MapReduce views. The index function decides what data to index and store in the index.
Before using read the FAQs to understand the limitations and appropriate use cases.
Partitioned Search indexes, which are defined in design documents, allow partition databases to be queried by using Lucene Query Parser Syntax. Search indexes are defined by an index function, similar to a map function in MapReduce views. The index function decides what data to index and store in the index.
Before using read the FAQs to understand the limitations and appropriate use cases.
Partitioned Search indexes, which are defined in design documents, allow partition databases to be queried by using Lucene Query Parser Syntax. Search indexes are defined by an index function, similar to a map function in MapReduce views. The index function decides what data to index and store in the index.
Before using read the FAQs to understand the limitations and appropriate use cases.
Partitioned Search indexes, which are defined in design documents, allow partition databases to be queried by using Lucene Query Parser Syntax. Search indexes are defined by an index function, similar to a map function in MapReduce views. The index function decides what data to index and store in the index.
Before using read the FAQs to understand the limitations and appropriate use cases.
Partitioned Search indexes, which are defined in design documents, allow partition databases to be queried by using Lucene Query Parser Syntax. Search indexes are defined by an index function, similar to a map function in MapReduce views. The index function decides what data to index and store in the index.
Before using read the FAQs to understand the limitations and appropriate use cases.
POST /{db}/_partition/{partition_key}/_design/{ddoc}/_search/{index}
(cloudant *CloudantV1) PostPartitionSearch(postPartitionSearchOptions *PostPartitionSearchOptions) (result *SearchResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostPartitionSearchWithContext(ctx context.Context, postPartitionSearchOptions *PostPartitionSearchOptions) (result *SearchResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostPartitionSearchAsStream(postPartitionSearchOptions *PostPartitionSearchOptions) (result io.ReadCloser, response *core.DetailedResponse, err error)
ServiceCall<SearchResult> postPartitionSearch(PostPartitionSearchOptions postPartitionSearchOptions)
ServiceCall<InputStream> postPartitionSearchAsStream(PostPartitionSearchOptions postPartitionSearchOptions)
postPartitionSearch(params)
postPartitionSearchAsStream(params)
post_partition_search(
self,
db: str,
partition_key: str,
ddoc: str,
index: str,
query: str,
*,
bookmark: Optional[str] = None,
highlight_fields: Optional[List[str]] = None,
highlight_number: Optional[int] = None,
highlight_post_tag: Optional[str] = None,
highlight_pre_tag: Optional[str] = None,
highlight_size: Optional[int] = None,
include_docs: Optional[bool] = None,
include_fields: Optional[List[str]] = None,
limit: Optional[int] = None,
sort: Optional[List[str]] = None,
stale: Optional[str] = None,
**kwargs,
) -> DetailedResponse
post_partition_search_as_stream(
self,
db: str,
partition_key: str,
ddoc: str,
index: str,
query: str,
*,
bookmark: Optional[str] = None,
highlight_fields: Optional[List[str]] = None,
highlight_number: Optional[int] = None,
highlight_post_tag: Optional[str] = None,
highlight_pre_tag: Optional[str] = None,
highlight_size: Optional[int] = None,
include_docs: Optional[bool] = None,
include_fields: Optional[List[str]] = None,
limit: Optional[int] = None,
sort: Optional[List[str]] = None,
stale: Optional[str] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the PostPartitionSearchOptions
struct and set the fields to provide parameter values for the PostPartitionSearch
method.
Use the PostPartitionSearchOptions.Builder
to create a PostPartitionSearchOptions
object that contains the parameter values for the postPartitionSearch
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_:][^:]*$
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Path parameter to specify the index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
HTTP request body for postPartitionSearch.
Example SearchQuery request.
{
"limit": 3,
"query": "name:Jane* AND active:True"
}
The Lucene query to execute.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
^[A-Za-z0-9=_-]*$
Specifies which fields to highlight. If specified, the result object contains a highlights field with an entry for each specified field.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Number of fragments that are returned in highlights. If the search term occurs less often than the number of fragments that are specified, longer fragments are returned.
Possible values: 1 ≤ value ≤ 1048521
Default:
1
A string that is inserted after the highlighted word in the highlights output.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^$
Default:
</em>
A string that is inserted before the highlighted word in the highlights output.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^<.*>$
Default:
<em>
Number of characters in each fragment for highlights.
Possible values: 1 ≤ value ≤ 1048521
Default:
100
Include the full content of the documents in the return.
Default:
false
A JSON array of field names to include in search results. Any fields that are included must be indexed with the store:true option. The default is all fields.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Limit the number of the returned documents to the specified number.
Possible values: 0 ≤ value ≤ 200
Specifies the sort order of the results. In a grouped search (when group_field is used), this parameter specifies the sort order within a group. The default sort order is relevance. A JSON string of the form "fieldname<type>" or "-fieldname<type>" for descending order, where fieldname is the name of a string or number field, and type is either a number, a string, or a JSON array of strings. The type part is optional, and defaults to number. Some examples are "foo", "-foo", "bar<string>", "-foo<number>" and ["-foo<number>", "bar<string>"]. String fields that are used for sorting must not be analyzed fields. Fields that are used for sorting must be indexed by the same indexer that is used for the search query.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^-?[^<>]+(<(?:string|number)>)?$
Do not wait for the index to finish building to return results.
Allowable values: [
ok
]
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The PostPartitionSearch options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The Lucene query to execute.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Examples:name:Jane* AND active:True
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Specifies which fields to highlight. If specified, the result object contains a highlights field with an entry for each specified field.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Number of fragments that are returned in highlights. If the search term occurs less often than the number of fragments that are specified, longer fragments are returned.
Possible values: 1 ≤ value ≤ 1048521
Default:
1
A string that is inserted after the highlighted word in the highlights output.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^<\/.*>$/
Default:
</em>
A string that is inserted before the highlighted word in the highlights output.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^<.*>$/
Default:
<em>
Number of characters in each fragment for highlights.
Possible values: 1 ≤ value ≤ 1048521
Default:
100
Include the full content of the documents in the return.
Default:
false
A JSON array of field names to include in search results. Any fields that are included must be indexed with the store:true option. The default is all fields.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Limit the number of the returned documents to the specified number.
Possible values: 0 ≤ value ≤ 200
Examples:3
Specifies the sort order of the results. In a grouped search (when group_field is used), this parameter specifies the sort order within a group. The default sort order is relevance. A JSON string of the form "fieldname<type>" or "-fieldname<type>" for descending order, where fieldname is the name of a string or number field, and type is either a number, a string, or a JSON array of strings. The type part is optional, and defaults to number. Some examples are "foo", "-foo", "bar<string>", "-foo<number>" and ["-foo<number>", "bar<string>"]. String fields that are used for sorting must not be analyzed fields. Fields that are used for sorting must be indexed by the same indexer that is used for the search query.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^-?[^<>]+(<(?:string|number)>)?$/
Do not wait for the index to finish building to return results.
Allowable values: [
ok
]
The postPartitionSearch options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The Lucene query to execute.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Examples:name:Jane* AND active:True
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Specifies which fields to highlight. If specified, the result object contains a highlights field with an entry for each specified field.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Number of fragments that are returned in highlights. If the search term occurs less often than the number of fragments that are specified, longer fragments are returned.
Possible values: 1 ≤ value ≤ 1048521
Default:
1
A string that is inserted after the highlighted word in the highlights output.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^<\/.*>$/
Default:
</em>
A string that is inserted before the highlighted word in the highlights output.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^<.*>$/
Default:
<em>
Number of characters in each fragment for highlights.
Possible values: 1 ≤ value ≤ 1048521
Default:
100
Include the full content of the documents in the return.
Default:
false
A JSON array of field names to include in search results. Any fields that are included must be indexed with the store:true option. The default is all fields.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Limit the number of the returned documents to the specified number.
Possible values: 0 ≤ value ≤ 200
Examples:3
Specifies the sort order of the results. In a grouped search (when group_field is used), this parameter specifies the sort order within a group. The default sort order is relevance. A JSON string of the form "fieldname<type>" or "-fieldname<type>" for descending order, where fieldname is the name of a string or number field, and type is either a number, a string, or a JSON array of strings. The type part is optional, and defaults to number. Some examples are "foo", "-foo", "bar<string>", "-foo<number>" and ["-foo<number>", "bar<string>"]. String fields that are used for sorting must not be analyzed fields. Fields that are used for sorting must be indexed by the same indexer that is used for the search query.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^-?[^<>]+(<(?:string|number)>)?$/
Do not wait for the index to finish building to return results.
Allowable values: [
ok
]
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The Lucene query to execute.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Examples:Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Specifies which fields to highlight. If specified, the result object contains a highlights field with an entry for each specified field.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Number of fragments that are returned in highlights. If the search term occurs less often than the number of fragments that are specified, longer fragments are returned.
Possible values: 1 ≤ value ≤ 1048521
Default:
1
A string that is inserted after the highlighted word in the highlights output.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^<\/.*>$/
Default:
</em>
A string that is inserted before the highlighted word in the highlights output.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^<.*>$/
Default:
<em>
Number of characters in each fragment for highlights.
Possible values: 1 ≤ value ≤ 1048521
Default:
100
Include the full content of the documents in the return.
Default:
false
A JSON array of field names to include in search results. Any fields that are included must be indexed with the store:true option. The default is all fields.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Limit the number of the returned documents to the specified number.
Possible values: 0 ≤ value ≤ 200
Examples:Specifies the sort order of the results. In a grouped search (when group_field is used), this parameter specifies the sort order within a group. The default sort order is relevance. A JSON string of the form "fieldname<type>" or "-fieldname<type>" for descending order, where fieldname is the name of a string or number field, and type is either a number, a string, or a JSON array of strings. The type part is optional, and defaults to number. Some examples are "foo", "-foo", "bar<string>", "-foo<number>" and ["-foo<number>", "bar<string>"]. String fields that are used for sorting must not be analyzed fields. Fields that are used for sorting must be indexed by the same indexer that is used for the search query.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^-?[^<>]+(<(?:string|number)>)?$/
Do not wait for the index to finish building to return results.
Allowable values: [
ok
]
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The Lucene query to execute.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Examples:Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Specifies which fields to highlight. If specified, the result object contains a highlights field with an entry for each specified field.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Number of fragments that are returned in highlights. If the search term occurs less often than the number of fragments that are specified, longer fragments are returned.
Possible values: 1 ≤ value ≤ 1048521
Default:
1
A string that is inserted after the highlighted word in the highlights output.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^<\/.*>$/
Default:
</em>
A string that is inserted before the highlighted word in the highlights output.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^<.*>$/
Default:
<em>
Number of characters in each fragment for highlights.
Possible values: 1 ≤ value ≤ 1048521
Default:
100
Include the full content of the documents in the return.
Default:
false
A JSON array of field names to include in search results. Any fields that are included must be indexed with the store:true option. The default is all fields.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Limit the number of the returned documents to the specified number.
Possible values: 0 ≤ value ≤ 200
Examples:Specifies the sort order of the results. In a grouped search (when group_field is used), this parameter specifies the sort order within a group. The default sort order is relevance. A JSON string of the form "fieldname<type>" or "-fieldname<type>" for descending order, where fieldname is the name of a string or number field, and type is either a number, a string, or a JSON array of strings. The type part is optional, and defaults to number. Some examples are "foo", "-foo", "bar<string>", "-foo<number>" and ["-foo<number>", "bar<string>"]. String fields that are used for sorting must not be analyzed fields. Fields that are used for sorting must be indexed by the same indexer that is used for the search query.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^-?[^<>]+(<(?:string|number)>)?$/
Do not wait for the index to finish building to return results.
Allowable values: [
ok
]
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X POST "$SERVICE_URL/products/_partition/small-appliances/_design/appliances/_search/findByPrice" -H "Content-Type: application/json" --data '{ "query": "price:[14 TO 20]" }'
This example requires the
findByPrice
Cloudant Search partitioned index to exist. To create the design document with this index, see Create or modify a design document.
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } postPartitionSearchOptions := service.NewPostPartitionSearchOptions( "events", "ns1HJS13AMkK", "checkout", "findByDate", "date:[2019-01-01T12:00:00.000Z TO 2019-01-31T12:00:00.000Z]", ) searchResult, response, err := service.PostPartitionSearch(postPartitionSearchOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(searchResult, "", " ") fmt.Println(string(b))
This example requires the
findByDate
Cloudant Search partitioned index to exist. To create the design document with this index, see Create or modify a design document.
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.PostPartitionSearchOptions; import com.ibm.cloud.cloudant.v1.model.SearchResult;
Cloudant service = Cloudant.newInstance(); PostPartitionSearchOptions searchOptions = new PostPartitionSearchOptions.Builder() .db("events") .partitionKey("ns1HJS13AMkK") .ddoc("checkout") .index("findByDate") .query("date:[2019-01-01T12:00:00.000Z TO 2019-01-31T12:00:00.000Z]") .build(); SearchResult response = service.postPartitionSearch(searchOptions).execute() .getResult(); System.out.println(response);
This example requires the
findByDate
Cloudant Search partitioned index to exist. To create the design document with this index, see Create or modify a design document.
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.postPartitionSearch({ db: 'events', partitionKey: 'ns1HJS13AMkK', ddoc: 'checkout', index: 'findByDate', query: 'date:[2019-01-01T12:00:00.000Z TO 2019-01-31T12:00:00.000Z]' }).then(response => { console.log(response.result); });
This example requires the
findByDate
Cloudant Search partitioned index to exist. To create the design document with this index, see Create or modify a design document.
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.post_partition_search( db='events', partition_key='ns1HJS13AMkK', ddoc='checkout', index='findByDate', query='date:[2019-01-01T12:00:00.000Z TO 2019-01-31T12:00:00.000Z]' ).get_result() print(response)
This example requires the
findByDate
Cloudant Search partitioned index to exist. To create the design document with this index, see Create or modify a design document.
Response
Response type for PostPartitionSearch
: SearchResult
Response type for PostPartitionSearchAsStream
: io.ReadCloser
Response type for postPartitionSearch
: SearchResult
Response type for postPartitionSearchAsStream
: InputStream
Response type for postPartitionSearch
: SearchResult
Response type for postPartitionSearchAsStream
: NodeJS.ReadableStream
Response type for post_partition_search
: SearchResult
Response type for post_partition_search_as_stream
: BinaryIO
Schema for the result of a query search operation.
Total number of rows in the index matching the search query. The limit may truncate the number of matches returned.
Possible values: 0 ≤ value ≤ 4294967295
Array of row objects.
Possible values: 0 ≤ number of items ≤ 200
Offset where the list started.
Possible values: 0 ≤ value ≤ 9007199254740992
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
^[A-Za-z0-9=_-]*$
Grouped search matches.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The counts facet syntax returns the number of query results for each unique value of each named field.
- counts
The count of query results for each unique value.
- any property
Possible values: 0 ≤ value ≤ 9007199254740992
The range facet syntax reuses the standard Lucene syntax for ranges to return counts of results that fit into each specified category.
- ranges
Search range result counts.
- any property
Counts of range results that fit into each specified category.
Possible values: 0 ≤ value ≤ 9007199254740992
Array of grouped search matches.
Possible values: 1 ≤ number of items ≤ 4294967295
Schema for the result of a query search operation.
Total number of rows in the index matching the search query. The limit may truncate the number of matches returned.
Possible values: 0 ≤ value ≤ 4294967295
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Grouped search matches.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The counts facet syntax returns the number of query results for each unique value of each named field.
The range facet syntax reuses the standard Lucene syntax for ranges to return counts of results that fit into each specified category.
Array of row objects.
Possible values: 0 ≤ number of items ≤ 200
- Rows
Schema for a document.
- Doc
Schema for a map of attachment name to attachment metadata.
- Attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- Revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- RevsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for the fields returned by a query search operation, a map of field name to value.
Returns the context in which a search term was mentioned so that you can display more emphasized results to a user.
Possible values: number of items ≥ 0
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Array of grouped search matches.
Possible values: number of items ≥ 1
- Groups
Total number of rows in the index matching the search query. The limit may truncate the number of matches returned.
Possible values: 0 ≤ value ≤ 4294967295
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Grouped search matches.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The counts facet syntax returns the number of query results for each unique value of each named field.
The range facet syntax reuses the standard Lucene syntax for ranges to return counts of results that fit into each specified category.
Array of row objects.
Possible values: 0 ≤ number of items ≤ 200
- Rows
Schema for a document.
- Doc
Schema for a map of attachment name to attachment metadata.
- Attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- Revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- RevsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for the fields returned by a query search operation, a map of field name to value.
Returns the context in which a search term was mentioned so that you can display more emphasized results to a user.
Possible values: number of items ≥ 0
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for the result of a query search operation.
Total number of rows in the index matching the search query. The limit may truncate the number of matches returned.
Possible values: 0 ≤ value ≤ 4294967295
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Grouped search matches.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The counts facet syntax returns the number of query results for each unique value of each named field.
The range facet syntax reuses the standard Lucene syntax for ranges to return counts of results that fit into each specified category.
Array of row objects.
Possible values: 0 ≤ number of items ≤ 200
- rows
Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- revsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for the fields returned by a query search operation, a map of field name to value.
Returns the context in which a search term was mentioned so that you can display more emphasized results to a user.
Possible values: number of items ≥ 0
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Array of grouped search matches.
Possible values: number of items ≥ 1
- groups
Total number of rows in the index matching the search query. The limit may truncate the number of matches returned.
Possible values: 0 ≤ value ≤ 4294967295
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Grouped search matches.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The counts facet syntax returns the number of query results for each unique value of each named field.
The range facet syntax reuses the standard Lucene syntax for ranges to return counts of results that fit into each specified category.
Array of row objects.
Possible values: 0 ≤ number of items ≤ 200
- rows
Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- revsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for the fields returned by a query search operation, a map of field name to value.
Returns the context in which a search term was mentioned so that you can display more emphasized results to a user.
Possible values: number of items ≥ 0
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for the result of a query search operation.
Total number of rows in the index matching the search query. The limit may truncate the number of matches returned.
Possible values: 0 ≤ value ≤ 4294967295
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Grouped search matches.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The counts facet syntax returns the number of query results for each unique value of each named field.
The range facet syntax reuses the standard Lucene syntax for ranges to return counts of results that fit into each specified category.
Array of row objects.
Possible values: 0 ≤ number of items ≤ 200
- rows
Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for the fields returned by a query search operation, a map of field name to value.
Returns the context in which a search term was mentioned so that you can display more emphasized results to a user.
Possible values: number of items ≥ 0
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Array of grouped search matches.
Possible values: number of items ≥ 1
- groups
Total number of rows in the index matching the search query. The limit may truncate the number of matches returned.
Possible values: 0 ≤ value ≤ 4294967295
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Grouped search matches.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The counts facet syntax returns the number of query results for each unique value of each named field.
The range facet syntax reuses the standard Lucene syntax for ranges to return counts of results that fit into each specified category.
Array of row objects.
Possible values: 0 ≤ number of items ≤ 200
- rows
Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for the fields returned by a query search operation, a map of field name to value.
Returns the context in which a search term was mentioned so that you can display more emphasized results to a user.
Possible values: number of items ≥ 0
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for the result of a query search operation.
Total number of rows in the index matching the search query. The limit may truncate the number of matches returned.
Possible values: 0 ≤ value ≤ 4294967295
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Grouped search matches.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The counts facet syntax returns the number of query results for each unique value of each named field.
The range facet syntax reuses the standard Lucene syntax for ranges to return counts of results that fit into each specified category.
Array of row objects.
Possible values: 0 ≤ number of items ≤ 200
- rows
Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for the fields returned by a query search operation, a map of field name to value.
Returns the context in which a search term was mentioned so that you can display more emphasized results to a user.
Possible values: number of items ≥ 0
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Array of grouped search matches.
Possible values: number of items ≥ 1
- groups
Total number of rows in the index matching the search query. The limit may truncate the number of matches returned.
Possible values: 0 ≤ value ≤ 4294967295
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Grouped search matches.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The counts facet syntax returns the number of query results for each unique value of each named field.
The range facet syntax reuses the standard Lucene syntax for ranges to return counts of results that fit into each specified category.
Array of row objects.
Possible values: 0 ≤ number of items ≤ 200
- rows
Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for the fields returned by a query search operation, a map of field name to value.
Returns the context in which a search term was mentioned so that you can display more emphasized results to a user.
Possible values: number of items ≥ 0
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Status Code
HTTP response for search operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example SearchResult response for a database partition.
{ "bookmark": "g1AAAAEPeJzLYWBgYMlgTmGQT0lKzi9KdUhJMtFLykxPyilN1UvOyS9NScwr0ctLLckBKmRKZEiy____f1YGk5v9iztMQCGGRGZU3Wa4dSc5AMmkepgBlxdXgQ1gINr6PBaQhgYgBTRjP9iQDwxgkMhEtCsghhyAGAJxybeak2BDGLMAi8FWFQ", "rows": [ { "fields": {}, "id": "small-appliances:1000042", "order": [ "1.2277607917785645", "0" ] } ], "total_rows": 1 }
Example SearchResult response for a database partition.
{ "bookmark": "g1AAAAEPeJzLYWBgYMlgTmGQT0lKzi9KdUhJMtFLykxPyilN1UvOyS9NScwr0ctLLckBKmRKZEiy____f1YGk5v9iztMQCGGRGZU3Wa4dSc5AMmkepgBlxdXgQ1gINr6PBaQhgYgBTRjP9iQDwxgkMhEtCsghhyAGAJxybeak2BDGLMAi8FWFQ", "rows": [ { "fields": {}, "id": "small-appliances:1000042", "order": [ "1.2277607917785645", "0" ] } ], "total_rows": 1 }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Query a database partition MapReduce view function (GET)
This operation queries the specified MapReduce view of the specified design document. By default, the map and reduce functions of the view are run to update the view before returning the response.
GET /{db}/_partition/{partition_key}/_design/{ddoc}/_view/{view}
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_:][^:]*$
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Path parameter to specify the map reduce view function name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[a-z][a-z0-9_$()+/-]*$
Query Parameters
Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Query parameter to specify whether to return the documents in descending by key order.
Default:
false
Query parameter to specify to stop returning records when the specified key is reached. String representation of any JSON type that matches the key type emitted by the view function.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query parameter to specify to stop returning records when the specified document ID is reached.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].*$
Query parameter to specify whether to group reduced results by key. Valid only if a reduce function is defined in the view. If the view emits keys in JSON array format, then it is possible to reduce groups further based on the number of array elements with the
group_level
parameter.Default:
false
Query parameter to specify a group level to be used. Only applicable if the view uses keys that are JSON arrays. Implies group is
true
. Group level groups the reduced results by the specified number of array elements. If unset, results are grouped by the entire array key, returning a reduced value for each complete key.Possible values: 1 ≤ value ≤ 4294967295
Query parameter to specify whether to include the full content of the documents in the response.
Default:
false
Query parameter to specify whether the specified end key should be included in the result.
Default:
true
Query parameter to specify to return only documents that match the specified key. String representation of any JSON type that matches the key type emitted by the view function.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query parameter to specify returning only documents that match any of the specified keys. String representation of a JSON array of keys that match the key type emitted by the view function. Must be URL encoded.
Possible values: 2 ≤ length ≤ 7168, Value must match regular expression
^\[(".*")*\]$
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined.
Default:
true
Query parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Query parameter to specify whether to sort the returned rows. Setting this to false offers a performance boost. The total_rows and offset fields are not available when this is set to false.
Default:
true
Query parameter to specify to start returning records from the specified key. String representation of any JSON type that matches the key type emitted by the view function.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query parameter to specify to start returning records from the specified document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].*$
Query parameter to specify whether or not the view in question should be updated prior to responding to the user.
true
- Return results after the view is updated.false
- Return results without updating the view.lazy
- Return the view results without waiting for an update, but update them immediately after the request.
Allowable values: [
true
,false
,lazy
]Default:
true
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/products/_partition/small-appliances/_design/appliances/_view/byApplianceProdId?include_docs=true&limit=10"
This example requires the
byApplianceProdId
partitioned view to exist. To create the view, see Create or modify a design document.
Response
Schema for the result of a query view operation.
rows
Possible values: 0 ≤ number of items ≤ 4294967295
Offset where the list started.
Possible values: 0 ≤ value ≤ 9007199254740992
Total number of rows in the view index. Note that if the request query narrows the view this is not the number of matching rows. The number of matching rows, up to the specified
limit
, is the size of therows
array.Possible values: 0 ≤ value ≤ 4294967295
Current update sequence for the database
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Status Code
HTTP response for view operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example ViewResult response for a database partition.
{ "offset": 0, "rows": [ { "id": "small-appliances:1000042", "key": "1000042", "value": [ "Foo", "Digital Kitchen Scales", "Slim Colourful Design Electronic Cooking Appliance for Home / Kitchen, Weigh up to 5kg + Aquatronic for Liquids ml + fl. oz. 15Yr Guarantee - Green" ] }, { "id": "small-appliances:1000043", "key": "1000043", "value": [ "Bar", "1100", "A professional, high powered innovative tool with a sleek design and outstanding performance" ] }, { "id": "small-appliances:1000044", "key": "1000044", "value": [ "Holstein", "Housewares Omelet Maker", "Easily make delicious and fluffy omelets without flipping - Innovative design - Cooking and cleaning is easy" ] } ], "total_rows": 3 }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve HTTP headers for a database partition MapReduce view function (GET)
Retrieves the HTTP headers for a database partition MapReduce view function (GET).
HEAD /{db}/_partition/{partition_key}/_design/{ddoc}/_view/{view}
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_:][^:]*$
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Path parameter to specify the map reduce view function name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[a-z][a-z0-9_$()+/-]*$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for view operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Query a database partition MapReduce view function
Runs the specified view function from the specified design document.
Unlike GET /{db}/_design/{ddoc}/_view/{view}
for accessing views, the POST method supports the specification of explicit keys to be retrieved from the view results. The remainder of the POST view functionality is identical to the GET /{db}/_design/{ddoc}/_view/{view}
API.
Before using read the FAQs to understand the limitations and appropriate use cases.
Runs the specified view function from the specified design document. Unlike GET /{db}/_design/{ddoc}/_view/{view}
for accessing views, the POST method supports the specification of explicit keys to be retrieved from the view results. The remainder of the POST view functionality is identical to the GET /{db}/_design/{ddoc}/_view/{view}
API.
Before using read the FAQs to understand the limitations and appropriate use cases.
Runs the specified view function from the specified design document. Unlike GET /{db}/_design/{ddoc}/_view/{view}
for accessing views, the POST method supports the specification of explicit keys to be retrieved from the view results. The remainder of the POST view functionality is identical to the GET /{db}/_design/{ddoc}/_view/{view}
API.
Before using read the FAQs to understand the limitations and appropriate use cases.
Runs the specified view function from the specified design document. Unlike GET /{db}/_design/{ddoc}/_view/{view}
for accessing views, the POST method supports the specification of explicit keys to be retrieved from the view results. The remainder of the POST view functionality is identical to the GET /{db}/_design/{ddoc}/_view/{view}
API.
Before using read the FAQs to understand the limitations and appropriate use cases.
Runs the specified view function from the specified design document. Unlike GET /{db}/_design/{ddoc}/_view/{view}
for accessing views, the POST method supports the specification of explicit keys to be retrieved from the view results. The remainder of the POST view functionality is identical to the GET /{db}/_design/{ddoc}/_view/{view}
API.
Before using read the FAQs to understand the limitations and appropriate use cases.
POST /{db}/_partition/{partition_key}/_design/{ddoc}/_view/{view}
(cloudant *CloudantV1) PostPartitionView(postPartitionViewOptions *PostPartitionViewOptions) (result *ViewResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostPartitionViewWithContext(ctx context.Context, postPartitionViewOptions *PostPartitionViewOptions) (result *ViewResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostPartitionViewAsStream(postPartitionViewOptions *PostPartitionViewOptions) (result io.ReadCloser, response *core.DetailedResponse, err error)
ServiceCall<ViewResult> postPartitionView(PostPartitionViewOptions postPartitionViewOptions)
ServiceCall<InputStream> postPartitionViewAsStream(PostPartitionViewOptions postPartitionViewOptions)
postPartitionView(params)
postPartitionViewAsStream(params)
post_partition_view(
self,
db: str,
partition_key: str,
ddoc: str,
view: str,
*,
att_encoding_info: Optional[bool] = None,
attachments: Optional[bool] = None,
conflicts: Optional[bool] = None,
descending: Optional[bool] = None,
include_docs: Optional[bool] = None,
inclusive_end: Optional[bool] = None,
limit: Optional[int] = None,
skip: Optional[int] = None,
update_seq: Optional[bool] = None,
end_key: Optional[object] = None,
end_key_doc_id: Optional[str] = None,
group: Optional[bool] = None,
group_level: Optional[int] = None,
key: Optional[object] = None,
keys: Optional[List[object]] = None,
reduce: Optional[bool] = None,
start_key: Optional[object] = None,
start_key_doc_id: Optional[str] = None,
update: Optional[str] = None,
**kwargs,
) -> DetailedResponse
post_partition_view_as_stream(
self,
db: str,
partition_key: str,
ddoc: str,
view: str,
*,
att_encoding_info: Optional[bool] = None,
attachments: Optional[bool] = None,
conflicts: Optional[bool] = None,
descending: Optional[bool] = None,
include_docs: Optional[bool] = None,
inclusive_end: Optional[bool] = None,
limit: Optional[int] = None,
skip: Optional[int] = None,
update_seq: Optional[bool] = None,
end_key: Optional[object] = None,
end_key_doc_id: Optional[str] = None,
group: Optional[bool] = None,
group_level: Optional[int] = None,
key: Optional[object] = None,
keys: Optional[List[object]] = None,
reduce: Optional[bool] = None,
start_key: Optional[object] = None,
start_key_doc_id: Optional[str] = None,
update: Optional[str] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the PostPartitionViewOptions
struct and set the fields to provide parameter values for the PostPartitionView
method.
Use the PostPartitionViewOptions.Builder
to create a PostPartitionViewOptions
object that contains the parameter values for the postPartitionView
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_:][^:]*$
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Path parameter to specify the map reduce view function name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[a-z][a-z0-9_$()+/-]*$
HTTP request body for postPartitionView.
Example ViewQuery request.
{
"include_docs": true,
"keys": [
"examplekey"
],
"limit": 10
}
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Query parameter to specify whether to sort the returned rows. Setting this to false offers a performance boost. The total_rows and offset fields are not available when this is set to false.
Default:
true
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for any JSON type
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Parameter to specify whether to group reduced results by key. Valid only if a reduce function defined in the view. If the view emits key in JSON array format, then it is possible to reduce groups further based on the number of array elements with the
group_level
parameter.Default:
false
Parameter to specify a group level to be used. Only applicable if the view uses keys that are JSON arrays. Implies group is
true
. Group level groups the reduced results by the specified number of array elements. If unset, results are grouped by the entire array key, returning a reduced value for each complete key.Possible values: 1 ≤ value ≤ 4294967295
Schema for any JSON type
Parameter to specify returning only documents that match any of the specified keys. A JSON array of keys that match the key type emitted by the view function.
Possible values: 0 ≤ number of items ≤ 65535
Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined.
A default
reduce
view type can be disabled to behave like amap
by settingreduce=false
explicitly.Be aware that
include_docs=true
can only be used withmap
views.Default:
true
Schema for any JSON type
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Parameter to specify whether or not the view in question should be updated prior to responding to the user.
true
- Return results after the view is updated.false
- Return results without updating the view.lazy
- Return the view results without waiting for an update, but update them immediately after the request.
Allowable values: [
true
,false
,lazy
]Default:
true
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The PostPartitionView options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the map reduce view function name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[a-z][a-z0-9_$()+\/-]*$/
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Examples:true
Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Examples:10
Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for any JSON type.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Parameter to specify whether to group reduced results by key. Valid only if a reduce function defined in the view. If the view emits key in JSON array format, then it is possible to reduce groups further based on the number of array elements with the
group_level
parameter.Default:
false
Parameter to specify a group level to be used. Only applicable if the view uses keys that are JSON arrays. Implies group is
true
. Group level groups the reduced results by the specified number of array elements. If unset, results are grouped by the entire array key, returning a reduced value for each complete key.Possible values: 1 ≤ value ≤ 4294967295
Schema for any JSON type.
Parameter to specify returning only documents that match any of the specified keys. A JSON array of keys that match the key type emitted by the view function.
Possible values: 0 ≤ number of items ≤ 65535
Examples:[ "examplekey" ]
Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined.
A default
reduce
view type can be disabled to behave like amap
by settingreduce=false
explicitly.Be aware that
include_docs=true
can only be used withmap
views.Default:
true
Schema for any JSON type.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Parameter to specify whether or not the view in question should be updated prior to responding to the user.
true
- Return results after the view is updated.false
- Return results without updating the view.lazy
- Return the view results without waiting for an update, but update them immediately after the request.
Allowable values: [
true
,false
,lazy
]Default:
true
The postPartitionView options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the map reduce view function name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[a-z][a-z0-9_$()+\/-]*$/
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Examples:true
Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Examples:10
Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for any JSON type.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Parameter to specify whether to group reduced results by key. Valid only if a reduce function defined in the view. If the view emits key in JSON array format, then it is possible to reduce groups further based on the number of array elements with the
group_level
parameter.Default:
false
Parameter to specify a group level to be used. Only applicable if the view uses keys that are JSON arrays. Implies group is
true
. Group level groups the reduced results by the specified number of array elements. If unset, results are grouped by the entire array key, returning a reduced value for each complete key.Possible values: 1 ≤ value ≤ 4294967295
Schema for any JSON type.
Parameter to specify returning only documents that match any of the specified keys. A JSON array of keys that match the key type emitted by the view function.
Possible values: 0 ≤ number of items ≤ 65535
Examples:[ "examplekey" ]
Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined.
A default
reduce
view type can be disabled to behave like amap
by settingreduce=false
explicitly.Be aware that
include_docs=true
can only be used withmap
views.Default:
true
Schema for any JSON type.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Parameter to specify whether or not the view in question should be updated prior to responding to the user.
true
- Return results after the view is updated.false
- Return results without updating the view.lazy
- Return the view results without waiting for an update, but update them immediately after the request.
Allowable values: [
true
,false
,lazy
]Default:
true
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the map reduce view function name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[a-z][a-z0-9_$()+\/-]*$/
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Examples:Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Examples:Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for any JSON type.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Parameter to specify whether to group reduced results by key. Valid only if a reduce function defined in the view. If the view emits key in JSON array format, then it is possible to reduce groups further based on the number of array elements with the
group_level
parameter.Default:
false
Parameter to specify a group level to be used. Only applicable if the view uses keys that are JSON arrays. Implies group is
true
. Group level groups the reduced results by the specified number of array elements. If unset, results are grouped by the entire array key, returning a reduced value for each complete key.Possible values: 1 ≤ value ≤ 4294967295
Schema for any JSON type.
Parameter to specify returning only documents that match any of the specified keys. A JSON array of keys that match the key type emitted by the view function.
Possible values: 0 ≤ number of items ≤ 65535
Examples:Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined.
A default
reduce
view type can be disabled to behave like amap
by settingreduce=false
explicitly.Be aware that
include_docs=true
can only be used withmap
views.Default:
true
Schema for any JSON type.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Parameter to specify whether or not the view in question should be updated prior to responding to the user.
true
- Return results after the view is updated.false
- Return results without updating the view.lazy
- Return the view results without waiting for an update, but update them immediately after the request.
Allowable values: [
true
,false
,lazy
]Default:
true
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the map reduce view function name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[a-z][a-z0-9_$()+\/-]*$/
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Examples:Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Examples:Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for any JSON type.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Parameter to specify whether to group reduced results by key. Valid only if a reduce function defined in the view. If the view emits key in JSON array format, then it is possible to reduce groups further based on the number of array elements with the
group_level
parameter.Default:
false
Parameter to specify a group level to be used. Only applicable if the view uses keys that are JSON arrays. Implies group is
true
. Group level groups the reduced results by the specified number of array elements. If unset, results are grouped by the entire array key, returning a reduced value for each complete key.Possible values: 1 ≤ value ≤ 4294967295
Schema for any JSON type.
Parameter to specify returning only documents that match any of the specified keys. A JSON array of keys that match the key type emitted by the view function.
Possible values: 0 ≤ number of items ≤ 65535
Examples:Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined.
A default
reduce
view type can be disabled to behave like amap
by settingreduce=false
explicitly.Be aware that
include_docs=true
can only be used withmap
views.Default:
true
Schema for any JSON type.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Parameter to specify whether or not the view in question should be updated prior to responding to the user.
true
- Return results after the view is updated.false
- Return results without updating the view.lazy
- Return the view results without waiting for an update, but update them immediately after the request.
Allowable values: [
true
,false
,lazy
]Default:
true
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X POST "$SERVICE_URL/products/_partition/small-appliances/_design/appliances/_view/byApplianceProdId" -H "Content-Type: application/json" --data '{ "include_docs": true, "limit": 10 }'
This example requires the
byApplianceProdId
partitioned view to exist. To create the view, see Create or modify a design document.
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } postPartitionViewOptions := service.NewPostPartitionViewOptions( "events", "ns1HJS13AMkK", "checkout", "byProductId", ) postPartitionViewOptions.SetIncludeDocs(true) postPartitionViewOptions.SetLimit(10) viewResult, response, err := service.PostPartitionView(postPartitionViewOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(viewResult, "", " ") fmt.Println(string(b))
This example requires the
byProductId
partitioned view to exist. To create the view, see Create or modify a design document.
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.PostPartitionViewOptions; import com.ibm.cloud.cloudant.v1.model.ViewResult;
Cloudant service = Cloudant.newInstance(); PostPartitionViewOptions viewOptions = new PostPartitionViewOptions.Builder() .db("events") .ddoc("checkout") .includeDocs(true) .limit(10) .partitionKey("ns1HJS13AMkK") .view("byProductId") .build(); ViewResult response = service.postPartitionView(viewOptions).execute() .getResult(); System.out.println(response);
This example requires the
byProductId
partitioned view to exist. To create the design document with this view, see Create or modify a design document.
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.postPartitionView({ db: 'events', ddoc: 'checkout', includeDocs: true, limit: 10, partitionKey: 'ns1HJS13AMkK', view: 'byProductId' }).then(response => { console.log(response.result); });
This example requires the
byProductId
partitioned view to exist. To create the design document with this view, see Create or modify a design document.
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.post_partition_view( db='events', ddoc='checkout', include_docs=True, limit=10, partition_key='ns1HJS13AMkK', view='byProductId' ).get_result() print(response)
This example requires the
byProductId
partitioned view to exist. To create the design document with this view, see Create or modify a design document.
Response
Response type for PostPartitionView
: ViewResult
Response type for PostPartitionViewAsStream
: io.ReadCloser
Response type for postPartitionView
: ViewResult
Response type for postPartitionViewAsStream
: InputStream
Response type for postPartitionView
: ViewResult
Response type for postPartitionViewAsStream
: NodeJS.ReadableStream
Response type for post_partition_view
: ViewResult
Response type for post_partition_view_as_stream
: BinaryIO
Schema for the result of a query view operation.
rows
Possible values: 0 ≤ number of items ≤ 4294967295
Offset where the list started.
Possible values: 0 ≤ value ≤ 9007199254740992
Total number of rows in the view index. Note that if the request query narrows the view this is not the number of matching rows. The number of matching rows, up to the specified
limit
, is the size of therows
array.Possible values: 0 ≤ value ≤ 4294967295
Current update sequence for the database
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Schema for the result of a query view operation.
Total number of rows in the view index. Note that if the request query narrows the view this is not the number of matching rows. The number of matching rows, up to the specified
limit
, is the size of therows
array.Possible values: 0 ≤ value ≤ 4294967295
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
rows.
Possible values: number of items ≥ 0
- Rows
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a document.
- Doc
Schema for a map of attachment name to attachment metadata.
- Attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- Revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- RevsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for any JSON type.
Schema for any JSON type.
Schema for the result of a query view operation.
Total number of rows in the view index. Note that if the request query narrows the view this is not the number of matching rows. The number of matching rows, up to the specified
limit
, is the size of therows
array.Possible values: 0 ≤ value ≤ 4294967295
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
rows.
Possible values: number of items ≥ 0
- rows
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- revsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for any JSON type.
Schema for any JSON type.
Schema for the result of a query view operation.
Total number of rows in the view index. Note that if the request query narrows the view this is not the number of matching rows. The number of matching rows, up to the specified
limit
, is the size of therows
array.Possible values: 0 ≤ value ≤ 4294967295
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
rows.
Possible values: number of items ≥ 0
- rows
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for any JSON type.
Schema for any JSON type.
Schema for the result of a query view operation.
Total number of rows in the view index. Note that if the request query narrows the view this is not the number of matching rows. The number of matching rows, up to the specified
limit
, is the size of therows
array.Possible values: 0 ≤ value ≤ 4294967295
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
rows.
Possible values: number of items ≥ 0
- rows
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for any JSON type.
Schema for any JSON type.
Status Code
HTTP response for view operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example ViewResult response for a database partition.
{ "offset": 0, "rows": [ { "id": "small-appliances:1000042", "key": "1000042", "value": [ "Foo", "Digital Kitchen Scales", "Slim Colourful Design Electronic Cooking Appliance for Home / Kitchen, Weigh up to 5kg + Aquatronic for Liquids ml + fl. oz. 15Yr Guarantee - Green" ] }, { "id": "small-appliances:1000043", "key": "1000043", "value": [ "Bar", "1100", "A professional, high powered innovative tool with a sleek design and outstanding performance" ] }, { "id": "small-appliances:1000044", "key": "1000044", "value": [ "Holstein", "Housewares Omelet Maker", "Easily make delicious and fluffy omelets without flipping - Innovative design - Cooking and cleaning is easy" ] } ], "total_rows": 3 }
Example ViewResult response for a database partition.
{ "offset": 0, "rows": [ { "id": "small-appliances:1000042", "key": "1000042", "value": [ "Foo", "Digital Kitchen Scales", "Slim Colourful Design Electronic Cooking Appliance for Home / Kitchen, Weigh up to 5kg + Aquatronic for Liquids ml + fl. oz. 15Yr Guarantee - Green" ] }, { "id": "small-appliances:1000043", "key": "1000043", "value": [ "Bar", "1100", "A professional, high powered innovative tool with a sleek design and outstanding performance" ] }, { "id": "small-appliances:1000044", "key": "1000044", "value": [ "Holstein", "Housewares Omelet Maker", "Easily make delicious and fluffy omelets without flipping - Innovative design - Cooking and cleaning is easy" ] } ], "total_rows": 3 }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve information about which partition index is used for a query
Shows which index is being used by the query. Parameters
are the same as the
/{db}/_partition/{partition_key}/_find
endpoint.
Shows which index is being used by the query. Parameters are the same as the
/{db}/_partition/{partition_key}/_find
endpoint.
Shows which index is being used by the query. Parameters are the same as the
/{db}/_partition/{partition_key}/_find
endpoint.
Shows which index is being used by the query. Parameters are the same as the
/{db}/_partition/{partition_key}/_find
endpoint.
Shows which index is being used by the query. Parameters are the same as the
/{db}/_partition/{partition_key}/_find
endpoint.
POST /{db}/_partition/{partition_key}/_explain
(cloudant *CloudantV1) PostPartitionExplain(postPartitionExplainOptions *PostPartitionExplainOptions) (result *ExplainResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostPartitionExplainWithContext(ctx context.Context, postPartitionExplainOptions *PostPartitionExplainOptions) (result *ExplainResult, response *core.DetailedResponse, err error)
ServiceCall<ExplainResult> postPartitionExplain(PostPartitionExplainOptions postPartitionExplainOptions)
postPartitionExplain(params)
post_partition_explain(
self,
db: str,
partition_key: str,
selector: dict,
*,
allow_fallback: Optional[bool] = None,
bookmark: Optional[str] = None,
conflicts: Optional[bool] = None,
execution_stats: Optional[bool] = None,
fields: Optional[List[str]] = None,
limit: Optional[int] = None,
skip: Optional[int] = None,
sort: Optional[List[dict]] = None,
stable: Optional[bool] = None,
update: Optional[str] = None,
use_index: Optional[List[str]] = None,
**kwargs,
) -> DetailedResponse
Auditing
Calling this method generates the following auditing event.
cloudantnosqldb.any-document.read
Rate limit
This operation consumes 0.01 read
requests per row read from the index (rounded up) and one further read for each document read. Additional document reads occur if the selector includes unindexed fields or if the projected values cannot be read from the index row. If no rows are read, the minimum cost is 1 read
.
Request
Instantiate the PostPartitionExplainOptions
struct and set the fields to provide parameter values for the PostPartitionExplain
method.
Use the PostPartitionExplainOptions.Builder
to create a PostPartitionExplainOptions
object that contains the parameter values for the postPartitionExplain
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_:][^:]*$
HTTP request body for postPartitionFind.
Example PartitionFindQuery request.
{
"fields": [
"productid",
"name",
"description"
],
"selector": {
"type": {
"$eq": "product"
}
}
}
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate
the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax
- selector
Whether to allow fallback to other indexes. Default is true.
Default:
true
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
^[A-Za-z0-9=_-]*$
A boolean value that indicates whether or not to include information about existing conflicts in the document.
Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when
include_docs=true
is used), and total quorum document lookups (when each document replica is fetched).JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Maximum number of results returned. The
type: text
indexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25
Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740992
The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields.
For example in JSON:
[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]
When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields must use the same sort direction, either all ascending or all descending.
Possible values: 0 ≤ number of items ≤ 65535
- sort
Schema for sort direction.
Allowable values: [
asc
,desc
]Default:
asc
Whether or not the view results should be returned from a "stable" set of shards.
Whether to update the index prior to returning the result.
Allowable values: [
false
,true
,lazy
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Default:
true
Use this option to identify a specific index to answer the query, rather than letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id followed by index name, for example
["my_design_doc", "my_index"]
.It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later.
If the specified index doesn't exist or can't answer the query then the server ignores the value and answers using another index or a full scan of all documents. To change this behavior set
allow_fallback
tofalse
and the server responds instead with a400
status code if the requested index is unsuitable to answer the query.Possible values: number of items = 2, 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The PostPartitionExplain options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Examples:{ "type": { "$eq": "product" } }
Whether to allow fallback to other indexes. Default is true.
Default:
true
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
A boolean value that indicates whether or not to include information about existing conflicts in the document.
Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when
include_docs=true
is used), and total quorum document lookups (when each document replica is fetched).JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Examples:[ "productid", "name", "description" ]
Maximum number of results returned. The
type: text
indexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25
Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740992
The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields.
For example in JSON:
[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]
When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields must use the same sort direction, either all ascending or all descending.
Allowable values: [
asc
,desc
]Possible values: 0 ≤ number of items ≤ 65535
Whether or not the view results should be returned from a "stable" set of shards.
Whether to update the index prior to returning the result.
Allowable values: [
false
,true
,lazy
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Default:
true
Use this option to identify a specific index to answer the query, rather than letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id followed by index name, for example
["my_design_doc", "my_index"]
.It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later.
If the specified index doesn't exist or can't answer the query then the server ignores the value and answers using another index or a full scan of all documents. To change this behavior set
allow_fallback
tofalse
and the server responds instead with a400
status code if the requested index is unsuitable to answer the query.Possible values: number of items = 2, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The postPartitionExplain options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Examples:{ "type": { "$eq": "product" } }
Whether to allow fallback to other indexes. Default is true.
Default:
true
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
A boolean value that indicates whether or not to include information about existing conflicts in the document.
Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when
include_docs=true
is used), and total quorum document lookups (when each document replica is fetched).JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Examples:[ "productid", "name", "description" ]
Maximum number of results returned. The
type: text
indexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25
Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740992
The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields.
For example in JSON:
[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]
When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields must use the same sort direction, either all ascending or all descending.
Allowable values: [
asc
,desc
]Possible values: 0 ≤ number of items ≤ 65535
Whether or not the view results should be returned from a "stable" set of shards.
Whether to update the index prior to returning the result.
Allowable values: [
false
,true
,lazy
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Default:
true
Use this option to identify a specific index to answer the query, rather than letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id followed by index name, for example
["my_design_doc", "my_index"]
.It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later.
If the specified index doesn't exist or can't answer the query then the server ignores the value and answers using another index or a full scan of all documents. To change this behavior set
allow_fallback
tofalse
and the server responds instead with a400
status code if the requested index is unsuitable to answer the query.Possible values: number of items = 2, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Examples:Whether to allow fallback to other indexes. Default is true.
Default:
true
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
A boolean value that indicates whether or not to include information about existing conflicts in the document.
Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when
include_docs=true
is used), and total quorum document lookups (when each document replica is fetched).JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Examples:Maximum number of results returned. The
type: text
indexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25
Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740992
The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields.
For example in JSON:
[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]
When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields must use the same sort direction, either all ascending or all descending.
Allowable values: [
asc
,desc
]Possible values: 0 ≤ number of items ≤ 65535
Whether or not the view results should be returned from a "stable" set of shards.
Whether to update the index prior to returning the result.
Allowable values: [
false
,true
,lazy
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Default:
true
Use this option to identify a specific index to answer the query, rather than letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id followed by index name, for example
["my_design_doc", "my_index"]
.It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later.
If the specified index doesn't exist or can't answer the query then the server ignores the value and answers using another index or a full scan of all documents. To change this behavior set
allow_fallback
tofalse
and the server responds instead with a400
status code if the requested index is unsuitable to answer the query.Possible values: number of items = 2, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Examples:Whether to allow fallback to other indexes. Default is true.
Default:
true
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
A boolean value that indicates whether or not to include information about existing conflicts in the document.
Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when
include_docs=true
is used), and total quorum document lookups (when each document replica is fetched).JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Examples:Maximum number of results returned. The
type: text
indexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25
Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740992
The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields.
For example in JSON:
[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]
When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields must use the same sort direction, either all ascending or all descending.
Allowable values: [
asc
,desc
]Possible values: 0 ≤ number of items ≤ 65535
Whether or not the view results should be returned from a "stable" set of shards.
Whether to update the index prior to returning the result.
Allowable values: [
false
,true
,lazy
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Default:
true
Use this option to identify a specific index to answer the query, rather than letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id followed by index name, for example
["my_design_doc", "my_index"]
.It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later.
If the specified index doesn't exist or can't answer the query then the server ignores the value and answers using another index or a full scan of all documents. To change this behavior set
allow_fallback
tofalse
and the server responds instead with a400
status code if the requested index is unsuitable to answer the query.Possible values: number of items = 2, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } selector := map[string]interface{}{ "userId": map[string]string{ "$eq": "abc123", }, } postPartitionExplainOptions := service.NewPostPartitionExplainOptions( "events", "ns1HJS13AMkK", selector, ) postExplainOptions.SetExecutionStats(true) postExplainOptions.SetLimit(10) explainResult, response, err := service.PostPartitionExplain(postPartitionExplainOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(explainResult, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.ExplainResult; import com.ibm.cloud.cloudant.v1.model.PostPartitionExplainOptions; import java.util.Collections; import java.util.Map;
Cloudant service = Cloudant.newInstance(); Map<String, Object> selector = Collections.singletonMap( "userId", Collections.singletonMap("$eq", "abc123")); PostPartitionExplainOptions explainOptions = new PostPartitionExplainOptions.Builder() .db("events") .executionStats(true) .limit(10) .partitionKey("ns1HJS13AMkK") .selector(selector) .build(); ExplainResult response = service.postPartitionExplain(explainOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); const selector: CloudantV1.Selector = { userId: {'$eq': 'abc123'} } service.postPartitionExplain({ db: 'events', executionStats: true, limit: 10, partitionKey: 'ns1HJS13AMkK', selector: selector }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.post_partition_explain( db='events', execution_stats=True, limit=10, partition_key='ns1HJS13AMkK', selector={'userId': {'$eq': 'abc123'}} ).get_result() print(response)
Response
Schema for information about the index used for a find query.
When
true
, the query is answered using the index only and no documents are fetched.Schema for a database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Fields that were requested to be projected from the document. If no fields were requested to be projected this will be empty and all fields will be returned.
Possible values: 0 ≤ number of items ≤ 4294967295, 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Schema for information about an index.
Schema for the list of all the other indexes that were not chosen for serving the query.
Possible values: 0 ≤ number of items ≤ 4294967295
The used maximum number of results returned.
Possible values: 0 ≤ value ≤ 4294967295
Options used for the request.
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate
the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax
- selector
Schema for a list of objects with extra information on the selector to provide insights about its usability.
Possible values: 1 ≤ number of items ≤ 3
Skip parameter used.
Possible values: 0 ≤ value ≤ 9007199254740992
Arguments passed to the underlying view.
Schema for any JSON type
Schema for information about the index used for a find query.
When
true
, the query is answered using the index only and no documents are fetched.Schema for a database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Fields that were requested to be projected from the document. If no fields were requested to be projected this will be empty and all fields will be returned.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for information about an index.
- Index
Schema for a nullable design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Schema for a
json
ortext
query index definition. Indexes of typetext
have additional configuration properties that do not apply tojson
indexes, these are:default_analyzer
- the default text analyzer to use *default_field
- whether to index the text in all document fields and what analyzer to use for that purpose.
- Def
Schema for a full text search analyzer.
- DefaultAnalyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the
$text
operator.- DefaultField
Schema for a full text search analyzer.
- Analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Whether or not the default_field is enabled.
List of field objects to index. Nested fields are also allowed, e.g.
person.name
.For "json" type indexes each object is a mapping of field name to sort direction (asc or desc).
For "text" type indexes each object has a
name
property of the field name and atype
property of the field type (string, number, or boolean).Possible values: 1 ≤ number of items ≤ 65535
- Fields
Name of the field.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The type of the named field.
Possible values: [
boolean
,number
,string
]
Whether to scan every document for arrays and store the length for each array found. Set the index_array_lengths field to false if:
- You do not need to know the length of an array. * You do not use the
$size
operator. * The documents in your database are complex, or not completely under your control. As a result, it is difficult to estimate the impact of the extra processing that is needed to determine and store the arrays lengths.
- You do not need to know the length of an array. * You do not use the
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$|^_all_docs$/
Indicates if index is partitioned.
Schema for the type of an index.
Possible values: [
json
,special
,text
]
Schema for the list of all the other indexes that were not chosen for serving the query.
Possible values: number of items ≥ 0
- IndexCandidates
Schema for detailed explanation of why the specific index was excluded by the query planner.
- Analysis
When
true
, the query is answered using the index only and no documents are fetched.A position of the unused index based on its potential relevance to the query.
Possible values: 1 ≤ value ≤ 4294967295
A list of reasons explaining why index was not chosen for the query.
Possible values: number of items ≥ 1
- Reasons
A reason code for index's exclusion.
The full list of possible reason codes is following:
- alphabetically_comes_after: json There is another suitable index whose name comes before that of this index.
- empty_selector: text "text" indexes do not support queries with empty selectors.
- excluded_by_user: any use_index was used to manually specify the index.
- field_mismatch: any Fields in "selector" of the query do match with the fields available in the index.
- is_partial: json, text Partial indexes can be selected only manually.
- less_overlap: json There is a better match of fields available within the indexes for the query.
- needs_text_search: json The use of the $text operator requires a "text" index.
- scope_mismatch: json The scope of the query and the index is not the same.
- sort_order_mismatch: json, special Fields in "sort" of the query do not match with the fields available in the index.
- too_many_fields: json The index has more fields than the chosen one.
- unfavored_type: any The type of the index is not preferred.
Possible values: [
alphabetically_comes_after
,empty_selector
,excluded_by_user
,field_mismatch
,is_partial
,less_overlap
,needs_text_search
,scope_mismatch
,sort_order_mismatch
,too_many_fields
,unfavored_type
]
Indicates whether an index can still be used for the query.
Schema for information about an index.
- Index
Schema for a nullable design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Schema for a
json
ortext
query index definition. Indexes of typetext
have additional configuration properties that do not apply tojson
indexes, these are:default_analyzer
- the default text analyzer to use *default_field
- whether to index the text in all document fields and what analyzer to use for that purpose.
- Def
Schema for a full text search analyzer.
- DefaultAnalyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the
$text
operator.- DefaultField
Schema for a full text search analyzer.
- Analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Whether or not the default_field is enabled.
List of field objects to index. Nested fields are also allowed, e.g.
person.name
.For "json" type indexes each object is a mapping of field name to sort direction (asc or desc).
For "text" type indexes each object has a
name
property of the field name and atype
property of the field type (string, number, or boolean).Possible values: 1 ≤ number of items ≤ 65535
- Fields
Name of the field.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The type of the named field.
Possible values: [
boolean
,number
,string
]
Whether to scan every document for arrays and store the length for each array found. Set the index_array_lengths field to false if:
- You do not need to know the length of an array. * You do not use the
$size
operator. * The documents in your database are complex, or not completely under your control. As a result, it is difficult to estimate the impact of the extra processing that is needed to determine and store the arrays lengths.
- You do not need to know the length of an array. * You do not use the
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$|^_all_docs$/
Indicates if index is partitioned.
Schema for the type of an index.
Possible values: [
json
,special
,text
]
The used maximum number of results returned.
Possible values: 0 ≤ value ≤ 4294967295
Arguments passed to the underlying view.
- Mrargs
Schema for any JSON type.
Direction parameter passed to the underlying view.
Possible values: [
fwd
,rev
]Schema for any JSON type.
A parameter that specifies whether to include the full content of the documents in the response in the underlying view.
Partition parameter passed to the underlying view.
Possible values: 0 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
A parameter that specifies returning only documents that match any of the specified keys in the underlying view.
A parameter that specifies whether the view results should be returned form a "stable" set of shards passed to the underlying view.
Schema for any JSON type.
Schema for any JSON type.
The type of the underlying view.
Possible values: [
map
,reduce
]
Options used for the request.
- Opts
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Conflicts used in the request query.
Execution statistics used in the request query.
JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Limit used in the request query.
Possible values: 0 ≤ value ≤ 4294967295
On which database partition the request was used. If it was not used on a database partition, it returns with
""
.Possible values: 0 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
The read quorum that is needed for the result.
Possible values: 1 ≤ value ≤ 3
Skip used in the request query.
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for any JSON type.
Stable used in the request query.
Stale used in the request query.
Update used in the request query.
Use index used in the request query.
Possible values: 0 ≤ number of items ≤ 2, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for any JSON type.
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Schema for a list of objects with extra information on the selector to provide insights about its usability.
Possible values: 1 ≤ number of items ≤ 3
- SelectorHints
A list of fields in the given selector that can be used to restrict the query.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
A type of the index.
Possible values: [
json
,text
]A list of fields in the given selector that can't be used to restrict the query.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Skip parameter used.
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for information about the index used for a find query.
When
true
, the query is answered using the index only and no documents are fetched.Schema for a database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Fields that were requested to be projected from the document. If no fields were requested to be projected this will be empty and all fields will be returned.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for information about an index.
- index
Schema for a nullable design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Schema for a
json
ortext
query index definition. Indexes of typetext
have additional configuration properties that do not apply tojson
indexes, these are:default_analyzer
- the default text analyzer to use *default_field
- whether to index the text in all document fields and what analyzer to use for that purpose.
- def
Schema for a full text search analyzer.
- defaultAnalyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the
$text
operator.- defaultField
Schema for a full text search analyzer.
- analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Whether or not the default_field is enabled.
List of field objects to index. Nested fields are also allowed, e.g.
person.name
.For "json" type indexes each object is a mapping of field name to sort direction (asc or desc).
For "text" type indexes each object has a
name
property of the field name and atype
property of the field type (string, number, or boolean).Possible values: 1 ≤ number of items ≤ 65535
- fields
Name of the field.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The type of the named field.
Possible values: [
boolean
,number
,string
]
Whether to scan every document for arrays and store the length for each array found. Set the index_array_lengths field to false if:
- You do not need to know the length of an array. * You do not use the
$size
operator. * The documents in your database are complex, or not completely under your control. As a result, it is difficult to estimate the impact of the extra processing that is needed to determine and store the arrays lengths.
- You do not need to know the length of an array. * You do not use the
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$|^_all_docs$/
Indicates if index is partitioned.
Schema for the type of an index.
Possible values: [
json
,special
,text
]
Schema for the list of all the other indexes that were not chosen for serving the query.
Possible values: number of items ≥ 0
- indexCandidates
Schema for detailed explanation of why the specific index was excluded by the query planner.
- analysis
When
true
, the query is answered using the index only and no documents are fetched.A position of the unused index based on its potential relevance to the query.
Possible values: 1 ≤ value ≤ 4294967295
A list of reasons explaining why index was not chosen for the query.
Possible values: number of items ≥ 1
- reasons
A reason code for index's exclusion.
The full list of possible reason codes is following:
- alphabetically_comes_after: json There is another suitable index whose name comes before that of this index.
- empty_selector: text "text" indexes do not support queries with empty selectors.
- excluded_by_user: any use_index was used to manually specify the index.
- field_mismatch: any Fields in "selector" of the query do match with the fields available in the index.
- is_partial: json, text Partial indexes can be selected only manually.
- less_overlap: json There is a better match of fields available within the indexes for the query.
- needs_text_search: json The use of the $text operator requires a "text" index.
- scope_mismatch: json The scope of the query and the index is not the same.
- sort_order_mismatch: json, special Fields in "sort" of the query do not match with the fields available in the index.
- too_many_fields: json The index has more fields than the chosen one.
- unfavored_type: any The type of the index is not preferred.
Possible values: [
alphabetically_comes_after
,empty_selector
,excluded_by_user
,field_mismatch
,is_partial
,less_overlap
,needs_text_search
,scope_mismatch
,sort_order_mismatch
,too_many_fields
,unfavored_type
]
Indicates whether an index can still be used for the query.
Schema for information about an index.
- index
Schema for a nullable design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Schema for a
json
ortext
query index definition. Indexes of typetext
have additional configuration properties that do not apply tojson
indexes, these are:default_analyzer
- the default text analyzer to use *default_field
- whether to index the text in all document fields and what analyzer to use for that purpose.
- def
Schema for a full text search analyzer.
- defaultAnalyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the
$text
operator.- defaultField
Schema for a full text search analyzer.
- analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Whether or not the default_field is enabled.
List of field objects to index. Nested fields are also allowed, e.g.
person.name
.For "json" type indexes each object is a mapping of field name to sort direction (asc or desc).
For "text" type indexes each object has a
name
property of the field name and atype
property of the field type (string, number, or boolean).Possible values: 1 ≤ number of items ≤ 65535
- fields
Name of the field.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The type of the named field.
Possible values: [
boolean
,number
,string
]
Whether to scan every document for arrays and store the length for each array found. Set the index_array_lengths field to false if:
- You do not need to know the length of an array. * You do not use the
$size
operator. * The documents in your database are complex, or not completely under your control. As a result, it is difficult to estimate the impact of the extra processing that is needed to determine and store the arrays lengths.
- You do not need to know the length of an array. * You do not use the
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$|^_all_docs$/
Indicates if index is partitioned.
Schema for the type of an index.
Possible values: [
json
,special
,text
]
The used maximum number of results returned.
Possible values: 0 ≤ value ≤ 4294967295
Arguments passed to the underlying view.
- mrargs
Schema for any JSON type.
Direction parameter passed to the underlying view.
Possible values: [
fwd
,rev
]Schema for any JSON type.
A parameter that specifies whether to include the full content of the documents in the response in the underlying view.
Partition parameter passed to the underlying view.
Possible values: 0 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
A parameter that specifies returning only documents that match any of the specified keys in the underlying view.
A parameter that specifies whether the view results should be returned form a "stable" set of shards passed to the underlying view.
Schema for any JSON type.
Schema for any JSON type.
The type of the underlying view.
Possible values: [
map
,reduce
]
Options used for the request.
- opts
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Conflicts used in the request query.
Execution statistics used in the request query.
JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Limit used in the request query.
Possible values: 0 ≤ value ≤ 4294967295
On which database partition the request was used. If it was not used on a database partition, it returns with
""
.Possible values: 0 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
The read quorum that is needed for the result.
Possible values: 1 ≤ value ≤ 3
Skip used in the request query.
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for any JSON type.
Stable used in the request query.
Stale used in the request query.
Update used in the request query.
Use index used in the request query.
Possible values: 0 ≤ number of items ≤ 2, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for any JSON type.
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Schema for a list of objects with extra information on the selector to provide insights about its usability.
Possible values: 1 ≤ number of items ≤ 3
- selectorHints
A list of fields in the given selector that can be used to restrict the query.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
A type of the index.
Possible values: [
json
,text
]A list of fields in the given selector that can't be used to restrict the query.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Skip parameter used.
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for information about the index used for a find query.
When
true
, the query is answered using the index only and no documents are fetched.Schema for a database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Fields that were requested to be projected from the document. If no fields were requested to be projected this will be empty and all fields will be returned.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for information about an index.
- index
Schema for a nullable design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Schema for a
json
ortext
query index definition. Indexes of typetext
have additional configuration properties that do not apply tojson
indexes, these are:default_analyzer
- the default text analyzer to use *default_field
- whether to index the text in all document fields and what analyzer to use for that purpose.
- def
Schema for a full text search analyzer.
- defaultAnalyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the
$text
operator.- defaultField
Schema for a full text search analyzer.
- analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Whether or not the default_field is enabled.
List of field objects to index. Nested fields are also allowed, e.g.
person.name
.For "json" type indexes each object is a mapping of field name to sort direction (asc or desc).
For "text" type indexes each object has a
name
property of the field name and atype
property of the field type (string, number, or boolean).Possible values: 1 ≤ number of items ≤ 65535
- fields
Name of the field.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The type of the named field.
Possible values: [
boolean
,number
,string
]
Whether to scan every document for arrays and store the length for each array found. Set the index_array_lengths field to false if:
- You do not need to know the length of an array. * You do not use the
$size
operator. * The documents in your database are complex, or not completely under your control. As a result, it is difficult to estimate the impact of the extra processing that is needed to determine and store the arrays lengths.
- You do not need to know the length of an array. * You do not use the
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$|^_all_docs$/
Indicates if index is partitioned.
Schema for the type of an index.
Possible values: [
json
,special
,text
]
Schema for the list of all the other indexes that were not chosen for serving the query.
Possible values: number of items ≥ 0
- indexCandidates
Schema for detailed explanation of why the specific index was excluded by the query planner.
- analysis
When
true
, the query is answered using the index only and no documents are fetched.A position of the unused index based on its potential relevance to the query.
Possible values: 1 ≤ value ≤ 4294967295
A list of reasons explaining why index was not chosen for the query.
Possible values: number of items ≥ 1
- reasons
A reason code for index's exclusion.
The full list of possible reason codes is following:
- alphabetically_comes_after: json There is another suitable index whose name comes before that of this index.
- empty_selector: text "text" indexes do not support queries with empty selectors.
- excluded_by_user: any use_index was used to manually specify the index.
- field_mismatch: any Fields in "selector" of the query do match with the fields available in the index.
- is_partial: json, text Partial indexes can be selected only manually.
- less_overlap: json There is a better match of fields available within the indexes for the query.
- needs_text_search: json The use of the $text operator requires a "text" index.
- scope_mismatch: json The scope of the query and the index is not the same.
- sort_order_mismatch: json, special Fields in "sort" of the query do not match with the fields available in the index.
- too_many_fields: json The index has more fields than the chosen one.
- unfavored_type: any The type of the index is not preferred.
Possible values: [
alphabetically_comes_after
,empty_selector
,excluded_by_user
,field_mismatch
,is_partial
,less_overlap
,needs_text_search
,scope_mismatch
,sort_order_mismatch
,too_many_fields
,unfavored_type
]
Indicates whether an index can still be used for the query.
Schema for information about an index.
- index
Schema for a nullable design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Schema for a
json
ortext
query index definition. Indexes of typetext
have additional configuration properties that do not apply tojson
indexes, these are:default_analyzer
- the default text analyzer to use *default_field
- whether to index the text in all document fields and what analyzer to use for that purpose.
- def
Schema for a full text search analyzer.
- defaultAnalyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the
$text
operator.- defaultField
Schema for a full text search analyzer.
- analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Whether or not the default_field is enabled.
List of field objects to index. Nested fields are also allowed, e.g.
person.name
.For "json" type indexes each object is a mapping of field name to sort direction (asc or desc).
For "text" type indexes each object has a
name
property of the field name and atype
property of the field type (string, number, or boolean).Possible values: 1 ≤ number of items ≤ 65535
- fields
Name of the field.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The type of the named field.
Possible values: [
boolean
,number
,string
]
Whether to scan every document for arrays and store the length for each array found. Set the index_array_lengths field to false if:
- You do not need to know the length of an array. * You do not use the
$size
operator. * The documents in your database are complex, or not completely under your control. As a result, it is difficult to estimate the impact of the extra processing that is needed to determine and store the arrays lengths.
- You do not need to know the length of an array. * You do not use the
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$|^_all_docs$/
Indicates if index is partitioned.
Schema for the type of an index.
Possible values: [
json
,special
,text
]
The used maximum number of results returned.
Possible values: 0 ≤ value ≤ 4294967295
Arguments passed to the underlying view.
- mrargs
Schema for any JSON type.
Direction parameter passed to the underlying view.
Possible values: [
fwd
,rev
]Schema for any JSON type.
A parameter that specifies whether to include the full content of the documents in the response in the underlying view.
Partition parameter passed to the underlying view.
Possible values: 0 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
A parameter that specifies returning only documents that match any of the specified keys in the underlying view.
A parameter that specifies whether the view results should be returned form a "stable" set of shards passed to the underlying view.
Schema for any JSON type.
Schema for any JSON type.
The type of the underlying view.
Possible values: [
map
,reduce
]
Options used for the request.
- opts
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Conflicts used in the request query.
Execution statistics used in the request query.
JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Limit used in the request query.
Possible values: 0 ≤ value ≤ 4294967295
On which database partition the request was used. If it was not used on a database partition, it returns with
""
.Possible values: 0 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
The read quorum that is needed for the result.
Possible values: 1 ≤ value ≤ 3
Skip used in the request query.
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for any JSON type.
Stable used in the request query.
Stale used in the request query.
Update used in the request query.
Use index used in the request query.
Possible values: 0 ≤ number of items ≤ 2, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for any JSON type.
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Schema for a list of objects with extra information on the selector to provide insights about its usability.
Possible values: 1 ≤ number of items ≤ 3
- selectorHints
A list of fields in the given selector that can be used to restrict the query.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
A type of the index.
Possible values: [
json
,text
]A list of fields in the given selector that can't be used to restrict the query.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Skip parameter used.
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for information about the index used for a find query.
When
true
, the query is answered using the index only and no documents are fetched.Schema for a database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Fields that were requested to be projected from the document. If no fields were requested to be projected this will be empty and all fields will be returned.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for information about an index.
- index
Schema for a nullable design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Schema for a
json
ortext
query index definition. Indexes of typetext
have additional configuration properties that do not apply tojson
indexes, these are:default_analyzer
- the default text analyzer to use *default_field
- whether to index the text in all document fields and what analyzer to use for that purpose.
- def_
Schema for a full text search analyzer.
- default_analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the
$text
operator.- default_field
Schema for a full text search analyzer.
- analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Whether or not the default_field is enabled.
List of field objects to index. Nested fields are also allowed, e.g.
person.name
.For "json" type indexes each object is a mapping of field name to sort direction (asc or desc).
For "text" type indexes each object has a
name
property of the field name and atype
property of the field type (string, number, or boolean).Possible values: 1 ≤ number of items ≤ 65535
- fields
Name of the field.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The type of the named field.
Possible values: [
boolean
,number
,string
]
Whether to scan every document for arrays and store the length for each array found. Set the index_array_lengths field to false if:
- You do not need to know the length of an array. * You do not use the
$size
operator. * The documents in your database are complex, or not completely under your control. As a result, it is difficult to estimate the impact of the extra processing that is needed to determine and store the arrays lengths.
- You do not need to know the length of an array. * You do not use the
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$|^_all_docs$/
Indicates if index is partitioned.
Schema for the type of an index.
Possible values: [
json
,special
,text
]
Schema for the list of all the other indexes that were not chosen for serving the query.
Possible values: number of items ≥ 0
- index_candidates
Schema for detailed explanation of why the specific index was excluded by the query planner.
- analysis
When
true
, the query is answered using the index only and no documents are fetched.A position of the unused index based on its potential relevance to the query.
Possible values: 1 ≤ value ≤ 4294967295
A list of reasons explaining why index was not chosen for the query.
Possible values: number of items ≥ 1
- reasons
A reason code for index's exclusion.
The full list of possible reason codes is following:
- alphabetically_comes_after: json There is another suitable index whose name comes before that of this index.
- empty_selector: text "text" indexes do not support queries with empty selectors.
- excluded_by_user: any use_index was used to manually specify the index.
- field_mismatch: any Fields in "selector" of the query do match with the fields available in the index.
- is_partial: json, text Partial indexes can be selected only manually.
- less_overlap: json There is a better match of fields available within the indexes for the query.
- needs_text_search: json The use of the $text operator requires a "text" index.
- scope_mismatch: json The scope of the query and the index is not the same.
- sort_order_mismatch: json, special Fields in "sort" of the query do not match with the fields available in the index.
- too_many_fields: json The index has more fields than the chosen one.
- unfavored_type: any The type of the index is not preferred.
Possible values: [
alphabetically_comes_after
,empty_selector
,excluded_by_user
,field_mismatch
,is_partial
,less_overlap
,needs_text_search
,scope_mismatch
,sort_order_mismatch
,too_many_fields
,unfavored_type
]
Indicates whether an index can still be used for the query.
Schema for information about an index.
- index
Schema for a nullable design document ID including a
_design/
prefix.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
/^_design\/.+$/
Schema for a
json
ortext
query index definition. Indexes of typetext
have additional configuration properties that do not apply tojson
indexes, these are:default_analyzer
- the default text analyzer to use *default_field
- whether to index the text in all document fields and what analyzer to use for that purpose.
- def_
Schema for a full text search analyzer.
- default_analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the
$text
operator.- default_field
Schema for a full text search analyzer.
- analyzer
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage:
- For search indexes the default is
standard
* For query text indexes the default iskeyword
* For a query text index default_field the default isstandard
.
Possible values: [
classic
,email
,keyword
,perfield
,simple
,simple_asciifolding
,standard
,whitespace
,arabic
,armenian
,basque
,brazilian
,bulgarian
,catalan
,chinese
,cjk
,czech
,danish
,dutch
,english
,finnish
,french
,galician
,german
,greek
,hindi
,hungarian
,indonesian
,irish
,italian
,japanese
,latvian
,norwegian
,persian
,polish
,portuguese
,romanian
,russian
,spanish
,swedish
,thai
,turkish
]- For search indexes the default is
Custom stopwords to use with the named analyzer.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Whether or not the default_field is enabled.
List of field objects to index. Nested fields are also allowed, e.g.
person.name
.For "json" type indexes each object is a mapping of field name to sort direction (asc or desc).
For "text" type indexes each object has a
name
property of the field name and atype
property of the field type (string, number, or boolean).Possible values: 1 ≤ number of items ≤ 65535
- fields
Name of the field.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The type of the named field.
Possible values: [
boolean
,number
,string
]
Whether to scan every document for arrays and store the length for each array found. Set the index_array_lengths field to false if:
- You do not need to know the length of an array. * You do not use the
$size
operator. * The documents in your database are complex, or not completely under your control. As a result, it is difficult to estimate the impact of the extra processing that is needed to determine and store the arrays lengths.
- You do not need to know the length of an array. * You do not use the
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Index name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$|^_all_docs$/
Indicates if index is partitioned.
Schema for the type of an index.
Possible values: [
json
,special
,text
]
The used maximum number of results returned.
Possible values: 0 ≤ value ≤ 4294967295
Arguments passed to the underlying view.
- mrargs
Schema for any JSON type.
Direction parameter passed to the underlying view.
Possible values: [
fwd
,rev
]Schema for any JSON type.
A parameter that specifies whether to include the full content of the documents in the response in the underlying view.
Partition parameter passed to the underlying view.
Possible values: 0 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
A parameter that specifies returning only documents that match any of the specified keys in the underlying view.
A parameter that specifies whether the view results should be returned form a "stable" set of shards passed to the underlying view.
Schema for any JSON type.
Schema for any JSON type.
The type of the underlying view.
Possible values: [
map
,reduce
]
Options used for the request.
- opts
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Conflicts used in the request query.
Execution statistics used in the request query.
JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Limit used in the request query.
Possible values: 0 ≤ value ≤ 4294967295
On which database partition the request was used. If it was not used on a database partition, it returns with
""
.Possible values: 0 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
The read quorum that is needed for the result.
Possible values: 1 ≤ value ≤ 3
Skip used in the request query.
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for any JSON type.
Stable used in the request query.
Stale used in the request query.
Update used in the request query.
Use index used in the request query.
Possible values: 0 ≤ number of items ≤ 2, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for any JSON type.
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Schema for a list of objects with extra information on the selector to provide insights about its usability.
Possible values: 1 ≤ number of items ≤ 3
- selector_hints
A list of fields in the given selector that can be used to restrict the query.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
A type of the index.
Possible values: [
json
,text
]A list of fields in the given selector that can't be used to restrict the query.
Possible values: number of items ≥ 0, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Skip parameter used.
Possible values: 0 ≤ value ≤ 9007199254740992
Status Code
HTTP response for postExplain.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example ExplainResult response.
{ "covering": false, "dbname": "users", "fields": [ "surname", "email" ], "index": { "ddoc": "_design/id-index", "def": { "fields": [ { "_id": "asc" } ] }, "name": "d479bdddf50865e520a0193704c8b93a3bd48f77", "type": "json" }, "index_candidates": [ { "analysis": { "covering": null, "ranking": 1, "reasons": [ { "name": "unfavored_type" } ], "usable": false }, "index": { "ddoc": null, "def": { "fields": [ { "_id": "asc" } ] }, "name": "_all_docs", "type": "special" } }, { "analysis": { "covering": false, "ranking": 2, "reasons": [ { "name": "field_mismatch" } ], "usable": false }, "index": { "ddoc": "_design/json-index", "def": { "fields": [ { "name": "asc" } ] }, "name": "getUserByName", "partitioned": false, "type": "json" } } ], "limit": 10, "mrargs": { "conflicts": "undefined", "direction": "fwd", "end_key": [ "<MAX>" ], "include_docs": true, "partition": null, "reduce": false, "stable": false, "start_key": [], "update": true, "view_type": "map" }, "opts": { "bookmark": "nil", "conflicts": false, "execution_stats": true, "fields": [], "limit": 10, "partition": "", "r": 1, "skip": 0, "sort": {}, "stable": false, "stale": false, "update": false, "use_index": [] }, "partitioned": true, "selector": { "type": { "$eq": "user" } }, "selector_hints": [ { "indexable_fields": [ "email" ], "type": "json", "unindexable_fields": [ "surname" ] } ], "skip": 0 }
Example ExplainResult response.
{ "covering": false, "dbname": "users", "fields": [ "surname", "email" ], "index": { "ddoc": "_design/id-index", "def": { "fields": [ { "_id": "asc" } ] }, "name": "d479bdddf50865e520a0193704c8b93a3bd48f77", "type": "json" }, "index_candidates": [ { "analysis": { "covering": null, "ranking": 1, "reasons": [ { "name": "unfavored_type" } ], "usable": false }, "index": { "ddoc": null, "def": { "fields": [ { "_id": "asc" } ] }, "name": "_all_docs", "type": "special" } }, { "analysis": { "covering": false, "ranking": 2, "reasons": [ { "name": "field_mismatch" } ], "usable": false }, "index": { "ddoc": "_design/json-index", "def": { "fields": [ { "name": "asc" } ] }, "name": "getUserByName", "partitioned": false, "type": "json" } } ], "limit": 10, "mrargs": { "conflicts": "undefined", "direction": "fwd", "end_key": [ "<MAX>" ], "include_docs": true, "partition": null, "reduce": false, "stable": false, "start_key": [], "update": true, "view_type": "map" }, "opts": { "bookmark": "nil", "conflicts": false, "execution_stats": true, "fields": [], "limit": 10, "partition": "", "r": 1, "skip": 0, "sort": {}, "stable": false, "stale": false, "update": false, "use_index": [] }, "partitioned": true, "selector": { "type": { "$eq": "user" } }, "selector_hints": [ { "indexable_fields": [ "email" ], "type": "json", "unindexable_fields": [ "surname" ] } ], "skip": 0 }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Query a database partition index by using selector syntax
Query documents by using a
declarative JSON querying syntax.
It's best practice to create an appropriate index
for all fields in selector by using the _index
endpoint.
Queries without an appropriate backing index by default
fallback to using the built-in _all_docs
index.
This isn't recommended because it has a significant
performance impact causing a full scan of the partition
with each request.
In this case the response body includes a warning field
recommending the creation of an index.
To avoid the fallback behavior set the allow_fallback
option
to false
and the server responds with a 400
status code
if no suitable index exists.
If you want to use only a specific index for your query set
allow_fallback
to false
and set the use_index
option.
Before using read the FAQs to understand the limitations and appropriate use cases.
Query documents by using a declarative JSON querying syntax. It's best practice to create an appropriate index for all fields in selector by using the _index
endpoint.
Queries without an appropriate backing index by default fallback to using the built-in _all_docs
index. This isn't recommended because it has a significant performance impact causing a full scan of the partition with each request. In this case the response body includes a warning field recommending the creation of an index.
To avoid the fallback behavior set the allow_fallback
option to false
and the server responds with a 400
status code if no suitable index exists. If you want to use only a specific index for your query set
allow_fallback
to false
and set the use_index
option.
Before using read the FAQs to understand the limitations and appropriate use cases.
Query documents by using a declarative JSON querying syntax. It's best practice to create an appropriate index for all fields in selector by using the _index
endpoint.
Queries without an appropriate backing index by default fallback to using the built-in _all_docs
index. This isn't recommended because it has a significant performance impact causing a full scan of the partition with each request. In this case the response body includes a warning field recommending the creation of an index.
To avoid the fallback behavior set the allow_fallback
option to false
and the server responds with a 400
status code if no suitable index exists. If you want to use only a specific index for your query set
allow_fallback
to false
and set the use_index
option.
Before using read the FAQs to understand the limitations and appropriate use cases.
Query documents by using a declarative JSON querying syntax. It's best practice to create an appropriate index for all fields in selector by using the _index
endpoint.
Queries without an appropriate backing index by default fallback to using the built-in _all_docs
index. This isn't recommended because it has a significant performance impact causing a full scan of the partition with each request. In this case the response body includes a warning field recommending the creation of an index.
To avoid the fallback behavior set the allow_fallback
option to false
and the server responds with a 400
status code if no suitable index exists. If you want to use only a specific index for your query set
allow_fallback
to false
and set the use_index
option.
Before using read the FAQs to understand the limitations and appropriate use cases.
Query documents by using a declarative JSON querying syntax. It's best practice to create an appropriate index for all fields in selector by using the _index
endpoint.
Queries without an appropriate backing index by default fallback to using the built-in _all_docs
index. This isn't recommended because it has a significant performance impact causing a full scan of the partition with each request. In this case the response body includes a warning field recommending the creation of an index.
To avoid the fallback behavior set the allow_fallback
option to false
and the server responds with a 400
status code if no suitable index exists. If you want to use only a specific index for your query set
allow_fallback
to false
and set the use_index
option.
Before using read the FAQs to understand the limitations and appropriate use cases.
POST /{db}/_partition/{partition_key}/_find
(cloudant *CloudantV1) PostPartitionFind(postPartitionFindOptions *PostPartitionFindOptions) (result *FindResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostPartitionFindWithContext(ctx context.Context, postPartitionFindOptions *PostPartitionFindOptions) (result *FindResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostPartitionFindAsStream(postPartitionFindOptions *PostPartitionFindOptions) (result io.ReadCloser, response *core.DetailedResponse, err error)
ServiceCall<FindResult> postPartitionFind(PostPartitionFindOptions postPartitionFindOptions)
ServiceCall<InputStream> postPartitionFindAsStream(PostPartitionFindOptions postPartitionFindOptions)
postPartitionFind(params)
postPartitionFindAsStream(params)
post_partition_find(
self,
db: str,
partition_key: str,
selector: dict,
*,
allow_fallback: Optional[bool] = None,
bookmark: Optional[str] = None,
conflicts: Optional[bool] = None,
execution_stats: Optional[bool] = None,
fields: Optional[List[str]] = None,
limit: Optional[int] = None,
skip: Optional[int] = None,
sort: Optional[List[dict]] = None,
stable: Optional[bool] = None,
update: Optional[str] = None,
use_index: Optional[List[str]] = None,
**kwargs,
) -> DetailedResponse
post_partition_find_as_stream(
self,
db: str,
partition_key: str,
selector: dict,
*,
allow_fallback: Optional[bool] = None,
bookmark: Optional[str] = None,
conflicts: Optional[bool] = None,
execution_stats: Optional[bool] = None,
fields: Optional[List[str]] = None,
limit: Optional[int] = None,
skip: Optional[int] = None,
sort: Optional[List[dict]] = None,
stable: Optional[bool] = None,
update: Optional[str] = None,
use_index: Optional[List[str]] = None,
**kwargs,
) -> DetailedResponse
Auditing
Calling this method generates the following auditing event.
cloudantnosqldb.any-document.read
Rate limit
This operation consumes 0.01 read
requests per row read from the index (rounded up) and one further read for each document read. Additional document reads occur if the selector includes unindexed fields or if the projected values cannot be read from the index row. If no rows are read, the minimum cost is 1 read
.
Request
Instantiate the PostPartitionFindOptions
struct and set the fields to provide parameter values for the PostPartitionFind
method.
Use the PostPartitionFindOptions.Builder
to create a PostPartitionFindOptions
object that contains the parameter values for the postPartitionFind
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_:][^:]*$
HTTP request body for postPartitionFind.
Example PartitionFindQuery request.
{
"fields": [
"productid",
"name",
"description"
],
"selector": {
"type": {
"$eq": "product"
}
}
}
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate
the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax
- selector
Whether to allow fallback to other indexes. Default is true.
Default:
true
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
^[A-Za-z0-9=_-]*$
A boolean value that indicates whether or not to include information about existing conflicts in the document.
Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when
include_docs=true
is used), and total quorum document lookups (when each document replica is fetched).JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Maximum number of results returned. The
type: text
indexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25
Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740992
The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields.
For example in JSON:
[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]
When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields must use the same sort direction, either all ascending or all descending.
Possible values: 0 ≤ number of items ≤ 65535
- sort
Schema for sort direction.
Allowable values: [
asc
,desc
]Default:
asc
Whether or not the view results should be returned from a "stable" set of shards.
Whether to update the index prior to returning the result.
Allowable values: [
false
,true
,lazy
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Default:
true
Use this option to identify a specific index to answer the query, rather than letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id followed by index name, for example
["my_design_doc", "my_index"]
.It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later.
If the specified index doesn't exist or can't answer the query then the server ignores the value and answers using another index or a full scan of all documents. To change this behavior set
allow_fallback
tofalse
and the server responds instead with a400
status code if the requested index is unsuitable to answer the query.Possible values: number of items = 2, 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The PostPartitionFind options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Examples:{ "type": { "$eq": "product" } }
Whether to allow fallback to other indexes. Default is true.
Default:
true
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
A boolean value that indicates whether or not to include information about existing conflicts in the document.
Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when
include_docs=true
is used), and total quorum document lookups (when each document replica is fetched).JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Examples:[ "productid", "name", "description" ]
Maximum number of results returned. The
type: text
indexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25
Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740992
The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields.
For example in JSON:
[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]
When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields must use the same sort direction, either all ascending or all descending.
Allowable values: [
asc
,desc
]Possible values: 0 ≤ number of items ≤ 65535
Whether or not the view results should be returned from a "stable" set of shards.
Whether to update the index prior to returning the result.
Allowable values: [
false
,true
,lazy
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Default:
true
Use this option to identify a specific index to answer the query, rather than letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id followed by index name, for example
["my_design_doc", "my_index"]
.It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later.
If the specified index doesn't exist or can't answer the query then the server ignores the value and answers using another index or a full scan of all documents. To change this behavior set
allow_fallback
tofalse
and the server responds instead with a400
status code if the requested index is unsuitable to answer the query.Possible values: number of items = 2, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The postPartitionFind options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Examples:{ "type": { "$eq": "product" } }
Whether to allow fallback to other indexes. Default is true.
Default:
true
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
A boolean value that indicates whether or not to include information about existing conflicts in the document.
Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when
include_docs=true
is used), and total quorum document lookups (when each document replica is fetched).JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Examples:[ "productid", "name", "description" ]
Maximum number of results returned. The
type: text
indexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25
Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740992
The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields.
For example in JSON:
[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]
When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields must use the same sort direction, either all ascending or all descending.
Allowable values: [
asc
,desc
]Possible values: 0 ≤ number of items ≤ 65535
Whether or not the view results should be returned from a "stable" set of shards.
Whether to update the index prior to returning the result.
Allowable values: [
false
,true
,lazy
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Default:
true
Use this option to identify a specific index to answer the query, rather than letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id followed by index name, for example
["my_design_doc", "my_index"]
.It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later.
If the specified index doesn't exist or can't answer the query then the server ignores the value and answers using another index or a full scan of all documents. To change this behavior set
allow_fallback
tofalse
and the server responds instead with a400
status code if the requested index is unsuitable to answer the query.Possible values: number of items = 2, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Examples:Whether to allow fallback to other indexes. Default is true.
Default:
true
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
A boolean value that indicates whether or not to include information about existing conflicts in the document.
Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when
include_docs=true
is used), and total quorum document lookups (when each document replica is fetched).JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Examples:Maximum number of results returned. The
type: text
indexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25
Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740992
The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields.
For example in JSON:
[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]
When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields must use the same sort direction, either all ascending or all descending.
Allowable values: [
asc
,desc
]Possible values: 0 ≤ number of items ≤ 65535
Whether or not the view results should be returned from a "stable" set of shards.
Whether to update the index prior to returning the result.
Allowable values: [
false
,true
,lazy
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Default:
true
Use this option to identify a specific index to answer the query, rather than letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id followed by index name, for example
["my_design_doc", "my_index"]
.It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later.
If the specified index doesn't exist or can't answer the query then the server ignores the value and answers using another index or a full scan of all documents. To change this behavior set
allow_fallback
tofalse
and the server responds instead with a400
status code if the requested index is unsuitable to answer the query.Possible values: number of items = 2, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the database partition key.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_:][^:]*$/
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Examples:Whether to allow fallback to other indexes. Default is true.
Default:
true
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
A boolean value that indicates whether or not to include information about existing conflicts in the document.
Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when
include_docs=true
is used), and total quorum document lookups (when each document replica is fetched).JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Examples:Maximum number of results returned. The
type: text
indexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25
Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740992
The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields.
For example in JSON:
[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]
When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields must use the same sort direction, either all ascending or all descending.
Allowable values: [
asc
,desc
]Possible values: 0 ≤ number of items ≤ 65535
Whether or not the view results should be returned from a "stable" set of shards.
Whether to update the index prior to returning the result.
Allowable values: [
false
,true
,lazy
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Default:
true
Use this option to identify a specific index to answer the query, rather than letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id followed by index name, for example
["my_design_doc", "my_index"]
.It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later.
If the specified index doesn't exist or can't answer the query then the server ignores the value and answers using another index or a full scan of all documents. To change this behavior set
allow_fallback
tofalse
and the server responds instead with a400
status code if the requested index is unsuitable to answer the query.Possible values: number of items = 2, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X POST "$SERVICE_URL/products/_partition/small-appliances/_find" -H "Content-Type: application/json" --data '{ "fields": [ "productid", "name", "description" ], "selector": { "type": { "$eq": "product" } } }'
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } selector := map[string]interface{}{ "userId": map[string]string{ "$eq": "abc123", }, } postPartitionFindOptions := service.NewPostPartitionFindOptions( "events", "ns1HJS13AMkK", selector, ) postPartitionFindOptions.SetFields([]string{ "productId", "eventType", "date", }) findResult, response, err := service.PostPartitionFind(postPartitionFindOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(findResult, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.FindResult; import com.ibm.cloud.cloudant.v1.model.PostPartitionFindOptions; import java.util.Arrays; import java.util.HashMap; import java.util.Map;
Cloudant service = Cloudant.newInstance(); Map<String, String> typeEqualsProduct = new HashMap<>(); typeEqualsProduct.put("$eq", "abc123"); Map<String, Object> selector = new HashMap<>(); selector.put("userId", typeEqualsProduct); PostPartitionFindOptions findOptions = new PostPartitionFindOptions.Builder() .db("events") .partitionKey("ns1HJS13AMkK") .fields(Arrays.asList("productId", "eventType", "date")) .selector(selector) .build(); FindResult response = service.postPartitionFind(findOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); const selector: CloudantV1.Selector = { userId: {'$eq': 'abc123'} } service.postPartitionFind({ db: 'events', partitionKey: 'ns1HJS13AMkK', fields: ['productId', 'eventType', 'date'], selector: selector }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.post_partition_find( db='events', partition_key='ns1HJS13AMkK', fields=['productId', 'eventType', 'date'], selector={'userId': {'$eq': 'abc123'}} ).get_result() print(response)
Response
Response type for PostPartitionFind
: FindResult
Response type for PostPartitionFindAsStream
: io.ReadCloser
Response type for postPartitionFind
: FindResult
Response type for postPartitionFindAsStream
: InputStream
Response type for postPartitionFind
: FindResult
Response type for postPartitionFindAsStream
: NodeJS.ReadableStream
Response type for post_partition_find
: FindResult
Response type for post_partition_find_as_stream
: BinaryIO
Schema for the result of a query find operation.
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
^[A-Za-z0-9=_-]*$
Documents matching the selector.
Possible values: 0 ≤ number of items ≤ 4294967295
- docs
Schema for find query execution statistics.
warning
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Schema for the result of a query find operation.
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Documents matching the selector.
Possible values: number of items ≥ 0
- Docs
Schema for a map of attachment name to attachment metadata.
- Attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- Revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- RevsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for find query execution statistics.
- ExecutionStats
Time to execute the query.
Number of results returned.
Possible values: 0 ≤ value ≤ 4294967295
Number of documents fetched from the index.
Possible values: 0 ≤ value ≤ 9007199254740992
Number of rows scanned in the index.
Possible values: 0 ≤ value ≤ 9007199254740992
Number of documents fetched from the primary index with the specified read quorum.
Possible values: 0 ≤ value ≤ 9007199254740992
warning.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the result of a query find operation.
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Documents matching the selector.
Possible values: number of items ≥ 0
- docs
Schema for a map of attachment name to attachment metadata.
- attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- revsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for find query execution statistics.
- executionStats
Time to execute the query.
Number of results returned.
Possible values: 0 ≤ value ≤ 4294967295
Number of documents fetched from the index.
Possible values: 0 ≤ value ≤ 9007199254740992
Number of rows scanned in the index.
Possible values: 0 ≤ value ≤ 9007199254740992
Number of documents fetched from the primary index with the specified read quorum.
Possible values: 0 ≤ value ≤ 9007199254740992
warning.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the result of a query find operation.
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Documents matching the selector.
Possible values: number of items ≥ 0
- docs
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for find query execution statistics.
- executionStats
Time to execute the query.
Number of results returned.
Possible values: 0 ≤ value ≤ 4294967295
Number of documents fetched from the index.
Possible values: 0 ≤ value ≤ 9007199254740992
Number of rows scanned in the index.
Possible values: 0 ≤ value ≤ 9007199254740992
Number of documents fetched from the primary index with the specified read quorum.
Possible values: 0 ≤ value ≤ 9007199254740992
warning.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the result of a query find operation.
Opaque bookmark token used when paginating results.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
/^[A-Za-z0-9=_-]*$/
Documents matching the selector.
Possible values: number of items ≥ 0
- docs
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for find query execution statistics.
- execution_stats
Time to execute the query.
Number of results returned.
Possible values: 0 ≤ value ≤ 4294967295
Number of documents fetched from the index.
Possible values: 0 ≤ value ≤ 9007199254740992
Number of rows scanned in the index.
Possible values: 0 ≤ value ≤ 9007199254740992
Number of documents fetched from the primary index with the specified read quorum.
Possible values: 0 ≤ value ≤ 9007199254740992
warning.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Status Code
HTTP response for postPartitionFind.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example FindResult response for a database partition.
{ "bookmark": "g1AAAABgeJzLYWBgYMpgSmHgKy5JLCrJTq2MT8lPzkzJBYpLFOcm5uToJhYU5GQm5iWnFlsZGgCBiQlIPQdMPV6VWQBXehzX", "docs": [ { "description": "Slim Colourful Design Electronic Cooking...", "name": "Digital Kitchen Scales", "productid": "1000042" }, { "description": "Easily make delicious and fluffy omelets...", "name": "Housewares Omelet Maker", "productid": "1000044" } ], "warning": "No matching index found, create an index to optimize query time." }
Example FindResult response for a database partition.
{ "bookmark": "g1AAAABgeJzLYWBgYMpgSmHgKy5JLCrJTq2MT8lPzkzJBYpLFOcm5uToJhYU5GQm5iWnFlsZGgCBiQlIPQdMPV6VWQBXehzX", "docs": [ { "description": "Slim Colourful Design Electronic Cooking...", "name": "Digital Kitchen Scales", "productid": "1000042" }, { "description": "Easily make delicious and fluffy omelets...", "name": "Housewares Omelet Maker", "productid": "1000044" } ], "warning": "No matching index found, create an index to optimize query time." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve change events for all databases
This endpoint is not available in IBM Cloudant.
Lists changes to databases, like a global changes feed. Types of changes include updating the database and creating or deleting a database. Like the changes feed, the feed is not guaranteed to return changes in the correct order and might repeat changes. Polling modes for this method work like polling modes for the changes feed.
This endpoint is not available in IBM Cloudant.
Lists changes to databases, like a global changes feed. Types of changes include updating the database and creating or deleting a database. Like the changes feed, the feed is not guaranteed to return changes in the correct order and might repeat changes. Polling modes for this method work like polling modes for the changes feed.
This endpoint is not available in IBM Cloudant.
Lists changes to databases, like a global changes feed. Types of changes include updating the database and creating or deleting a database. Like the changes feed, the feed is not guaranteed to return changes in the correct order and might repeat changes. Polling modes for this method work like polling modes for the changes feed.
This endpoint is not available in IBM Cloudant.
Lists changes to databases, like a global changes feed. Types of changes include updating the database and creating or deleting a database. Like the changes feed, the feed is not guaranteed to return changes in the correct order and might repeat changes. Polling modes for this method work like polling modes for the changes feed.
This endpoint is not available in IBM Cloudant.
Lists changes to databases, like a global changes feed. Types of changes include updating the database and creating or deleting a database. Like the changes feed, the feed is not guaranteed to return changes in the correct order and might repeat changes. Polling modes for this method work like polling modes for the changes feed.
GET /_db_updates
(cloudant *CloudantV1) GetDbUpdates(getDbUpdatesOptions *GetDbUpdatesOptions) (result *DbUpdates, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) GetDbUpdatesWithContext(ctx context.Context, getDbUpdatesOptions *GetDbUpdatesOptions) (result *DbUpdates, response *core.DetailedResponse, err error)
ServiceCall<DbUpdates> getDbUpdates(GetDbUpdatesOptions getDbUpdatesOptions)
getDbUpdates(params)
get_db_updates(
self,
*,
descending: Optional[bool] = None,
feed: Optional[str] = None,
heartbeat: Optional[int] = None,
limit: Optional[int] = None,
timeout: Optional[int] = None,
since: Optional[str] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the GetDbUpdatesOptions
struct and set the fields to provide parameter values for the GetDbUpdates
method.
Use the GetDbUpdatesOptions.Builder
to create a GetDbUpdatesOptions
object that contains the parameter values for the getDbUpdates
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Query Parameters
Query parameter to specify whether to return the documents in descending by key order.
Default:
false
Query parameter to specify the changes feed type.
Allowable values: [
continuous
,eventsource
,longpoll
,normal
]Default:
normal
Query parameter to specify the period in milliseconds after which an empty line is sent in the results. Off by default and only applicable for
continuous
andeventsource
feeds. Overrides any timeout to keep the feed alive indefinitely. May also betrue
to use a value of60000
.Note: Delivery of heartbeats cannot be relied on at specific intervals. If your application runs in an environment where idle network connections may break,
heartbeat
is not suitable as a keepalive mechanism. Instead, consider one of the following options:- Use the
timeout
parameter with a value that is compatible with your network environment. - Switch to scheduled usage of one of the non-continuous changes feed types
(
normal
orlongpoll
). - Use TCP keepalive.
Possible values: 1 ≤ value ≤ 60000
- Use the
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify the maximum period in milliseconds to wait for a change before the response is sent, even if there are no results. Only applicable for
longpoll
orcontinuous
feeds. Default value is specified byhttpd/changes_timeout
configuration option. Note that60000
value is also the default maximum timeout to prevent undetected dead connections.Possible values: 0 ≤ value ≤ 60000
Default:
60000
Query parameter to specify to start the results from the change immediately after the given update sequence. Can be a valid update sequence or
now
value. Default is0
i.e. all changes.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Example:
0
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The GetDbUpdates options.
Query parameter to specify whether to return the documents in descending by key order.
Default:
false
Query parameter to specify the changes feed type.
Allowable values: [
continuous
,eventsource
,longpoll
,normal
]Default:
normal
Query parameter to specify the period in milliseconds after which an empty line is sent in the results. Off by default and only applicable for
continuous
andeventsource
feeds. Overrides any timeout to keep the feed alive indefinitely. May also betrue
to use a value of60000
.Note: Delivery of heartbeats cannot be relied on at specific intervals. If your application runs in an environment where idle network connections may break,
heartbeat
is not suitable as a keepalive mechanism. Instead, consider one of the following options:- Use the
timeout
parameter with a value that is compatible with your network environment. - Switch to scheduled usage of one of the non-continuous changes feed types
(
normal
orlongpoll
). - Use TCP keepalive.
Possible values: 1 ≤ value ≤ 60000
- Use the
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify the maximum period in milliseconds to wait for a change before the response is sent, even if there are no results. Only applicable for
longpoll
orcontinuous
feeds. Default value is specified byhttpd/changes_timeout
configuration option. Note that60000
value is also the default maximum timeout to prevent undetected dead connections.Possible values: 0 ≤ value ≤ 60000
Default:
60000
Query parameter to specify to start the results from the change immediately after the given update sequence. Can be a valid update sequence or
now
value. Default is0
i.e. all changes.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Examples:0
The getDbUpdates options.
Query parameter to specify whether to return the documents in descending by key order.
Default:
false
Query parameter to specify the changes feed type.
Allowable values: [
continuous
,eventsource
,longpoll
,normal
]Default:
normal
Query parameter to specify the period in milliseconds after which an empty line is sent in the results. Off by default and only applicable for
continuous
andeventsource
feeds. Overrides any timeout to keep the feed alive indefinitely. May also betrue
to use a value of60000
.Note: Delivery of heartbeats cannot be relied on at specific intervals. If your application runs in an environment where idle network connections may break,
heartbeat
is not suitable as a keepalive mechanism. Instead, consider one of the following options:- Use the
timeout
parameter with a value that is compatible with your network environment. - Switch to scheduled usage of one of the non-continuous changes feed types
(
normal
orlongpoll
). - Use TCP keepalive.
Possible values: 1 ≤ value ≤ 60000
- Use the
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify the maximum period in milliseconds to wait for a change before the response is sent, even if there are no results. Only applicable for
longpoll
orcontinuous
feeds. Default value is specified byhttpd/changes_timeout
configuration option. Note that60000
value is also the default maximum timeout to prevent undetected dead connections.Possible values: 0 ≤ value ≤ 60000
Default:
60000
Query parameter to specify to start the results from the change immediately after the given update sequence. Can be a valid update sequence or
now
value. Default is0
i.e. all changes.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Examples:0
parameters
Query parameter to specify whether to return the documents in descending by key order.
Default:
false
Query parameter to specify the changes feed type.
Allowable values: [
continuous
,eventsource
,longpoll
,normal
]Default:
normal
Query parameter to specify the period in milliseconds after which an empty line is sent in the results. Off by default and only applicable for
continuous
andeventsource
feeds. Overrides any timeout to keep the feed alive indefinitely. May also betrue
to use a value of60000
.Note: Delivery of heartbeats cannot be relied on at specific intervals. If your application runs in an environment where idle network connections may break,
heartbeat
is not suitable as a keepalive mechanism. Instead, consider one of the following options:- Use the
timeout
parameter with a value that is compatible with your network environment. - Switch to scheduled usage of one of the non-continuous changes feed types
(
normal
orlongpoll
). - Use TCP keepalive.
Possible values: 1 ≤ value ≤ 60000
- Use the
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify the maximum period in milliseconds to wait for a change before the response is sent, even if there are no results. Only applicable for
longpoll
orcontinuous
feeds. Default value is specified byhttpd/changes_timeout
configuration option. Note that60000
value is also the default maximum timeout to prevent undetected dead connections.Possible values: 0 ≤ value ≤ 60000
Default:
60000
Query parameter to specify to start the results from the change immediately after the given update sequence. Can be a valid update sequence or
now
value. Default is0
i.e. all changes.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Examples:
parameters
Query parameter to specify whether to return the documents in descending by key order.
Default:
false
Query parameter to specify the changes feed type.
Allowable values: [
continuous
,eventsource
,longpoll
,normal
]Default:
normal
Query parameter to specify the period in milliseconds after which an empty line is sent in the results. Off by default and only applicable for
continuous
andeventsource
feeds. Overrides any timeout to keep the feed alive indefinitely. May also betrue
to use a value of60000
.Note: Delivery of heartbeats cannot be relied on at specific intervals. If your application runs in an environment where idle network connections may break,
heartbeat
is not suitable as a keepalive mechanism. Instead, consider one of the following options:- Use the
timeout
parameter with a value that is compatible with your network environment. - Switch to scheduled usage of one of the non-continuous changes feed types
(
normal
orlongpoll
). - Use TCP keepalive.
Possible values: 1 ≤ value ≤ 60000
- Use the
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify the maximum period in milliseconds to wait for a change before the response is sent, even if there are no results. Only applicable for
longpoll
orcontinuous
feeds. Default value is specified byhttpd/changes_timeout
configuration option. Note that60000
value is also the default maximum timeout to prevent undetected dead connections.Possible values: 0 ≤ value ≤ 60000
Default:
60000
Query parameter to specify to start the results from the change immediately after the given update sequence. Can be a valid update sequence or
now
value. Default is0
i.e. all changes.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Examples:
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/_db_updates?feed=normal&heartbeat=10000&since=now"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } getDbUpdatesOptions := service.NewGetDbUpdatesOptions() getDbUpdatesOptions.SetFeed("normal") getDbUpdatesOptions.SetHeartbeat(10000) getDbUpdatesOptions.SetSince("now") dbUpdates, response, err := service.GetDbUpdates(getDbUpdatesOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(dbUpdates, "", " ") fmt.Println(string(b))
This request requires
server_admin
access.
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.DbUpdates; import com.ibm.cloud.cloudant.v1.model.GetDbUpdatesOptions;
Cloudant service = Cloudant.newInstance(); GetDbUpdatesOptions dbUpdatesOptions = new GetDbUpdatesOptions.Builder() .feed("normal") .heartbeat(10000) .since("now") .build(); DbUpdates response = service.getDbUpdates(dbUpdatesOptions).execute() .getResult(); System.out.println(response);
This request requires
server_admin
access.
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.getDbUpdates({ feed: 'normal', heartbeat: 10000, since: 'now' }).then(response => { console.log(response.result); });
This request requires
server_admin
access.
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.get_db_updates( feed='normal', heartbeat=10000, since='now' ).get_result() print(response)
This request requires
server_admin
access.
Response
Schema for database updates.
Last sequence number.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
results
Possible values: 0 ≤ number of items ≤ 4294967295
Schema for database updates.
Last sequence number.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
results.
Possible values: number of items ≥ 0
- Results
Schema for a database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Sequence number.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
A database event.
Possible values: [
created
,deleted
,updated
]
Schema for database updates.
Last sequence number.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
results.
Possible values: number of items ≥ 0
- results
Schema for a database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Sequence number.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
A database event.
Possible values: [
created
,deleted
,updated
]
Schema for database updates.
Last sequence number.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
results.
Possible values: number of items ≥ 0
- results
Schema for a database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Sequence number.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
A database event.
Possible values: [
created
,deleted
,updated
]
Schema for database updates.
Last sequence number.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
results.
Possible values: number of items ≥ 0
- results
Schema for a database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Sequence number.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
A database event.
Possible values: [
created
,deleted
,updated
]
Status Code
HTTP response for
/_db_updates
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example DbUpdates response.
{ "last_seq": "1-g1AAAAMFeJydkcENgjAUhquYePHqBN48EEBj4klXUOgAbSExDUJi8OwUrqDQJZyCJZhBqD8XE0Iiwulvmvf1e68vJITMToZPFj4X8SXY-3xjijC--ixKLMv-ns0oSEIUjxnhc0o9yUgTW_3GaojypVKZPBlsdMbdVFhbW6yd_15p2pwOG0SK77SuevcJSHP06rbILicgj0ul0t5OQBm_aV22yI5l1FAVTciR0ntfKzAXGOKJz-prBpYCQ7y1fg1wl8AQB0rzAW4MnCMeShUD3Bi4QGDTGrT8AMkPBk0", "results": [ { "db_name": "events", "seq": "1-g1AAAAMFeJydkcENgjAUhquYePHqBN48EEBj4klXUOgAbSExDUJi8OwUrqDQJZyCJZhBqD8XE0Iiwulvmvf1e68vJITMToZPFj4X8SXY-3xjijC--ixKLMv-ns0oSEIUjxnhc0o9yUgTW_3GaojypVKZPBlsdMbdVFhbW6yd_15p2pwOG0SK77SuevcJSHP06rbILicgj0ul0t5OQBm_aV22yI5l1FAVTciR0ntfKzAXGOKJz-prBpYCQ7y1fg1wl8AQB0rzAW4MnCMeShUD3Bi4QGDTGrT8AMkPBk0", "type": "created" } ] }
Example DbUpdates response.
{ "last_seq": "1-g1AAAAMFeJydkcENgjAUhquYePHqBN48EEBj4klXUOgAbSExDUJi8OwUrqDQJZyCJZhBqD8XE0Iiwulvmvf1e68vJITMToZPFj4X8SXY-3xjijC--ixKLMv-ns0oSEIUjxnhc0o9yUgTW_3GaojypVKZPBlsdMbdVFhbW6yd_15p2pwOG0SK77SuevcJSHP06rbILicgj0ul0t5OQBm_aV22yI5l1FAVTciR0ntfKzAXGOKJz-prBpYCQ7y1fg1wl8AQB0rzAW4MnCMeShUD3Bi4QGDTGrT8AMkPBk0", "results": [ { "db_name": "events", "seq": "1-g1AAAAMFeJydkcENgjAUhquYePHqBN48EEBj4klXUOgAbSExDUJi8OwUrqDQJZyCJZhBqD8XE0Iiwulvmvf1e68vJITMToZPFj4X8SXY-3xjijC--ixKLMv-ns0oSEIUjxnhc0o9yUgTW_3GaojypVKZPBlsdMbdVFhbW6yd_15p2pwOG0SK77SuevcJSHP06rbILicgj0ul0t5OQBm_aV22yI5l1FAVTciR0ntfKzAXGOKJz-prBpYCQ7y1fg1wl8AQB0rzAW4MnCMeShUD3Bi4QGDTGrT8AMkPBk0", "type": "created" } ] }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve the HTTP headers for change events for all databases
Retrieves the HTTP headers for change events of all databases.
HEAD /_db_updates
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the ETag for a resource.
Examples:Double quoted base64 encoded attachment digest.
"MEHlNHhicVt9efOzyvsz0Q=="
Double quoted document revision identifier.
"2-240fc93fad07083c338c7e0ea55791b3"
Double quoted local document tag.
"6APCCGX4B76OFFD5972MSBFHD"
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for
/_db_updates
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Query the database document changes feed (GET)
Returns a sorted list of changes made to documents in the database, in time order of application. Only the most recent change for a specific document is included in the list. For example, if you add fields to a document and then delete them, an API client that checks for changes might not know about the intermediate state of added documents. These checks listen for updates to the database for post processing or synchronization, and for practical purposes, a continuously connected _changes
feed is a reasonable approach for generating a real-time log for most applications.
Note
Before using the changes feed read the FAQs to understand the limitations and appropriate use cases.
To use some filter types you must use the
POST
version of this request.
GET /{db}/_changes
Request
Custom Headers
Header parameter to specify the ID of the last events received by the server on a previous connection. Overrides
since
query parameter.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Query Parameters
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Query parameter to specify whether to return the documents in descending by key order.
Default:
false
Query parameter to specify a JSON array list of document IDs to restrict the changes feed to. Used with the
_doc_ids
filter. Since length of URL is limited, it is better to use POST/{db}/_changes
instead.Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].*$
Query parameter to specify the changes feed type.
Allowable values: [
continuous
,eventsource
,longpoll
,normal
]Default:
normal
Query parameter to specify a filter to emit only specific events from the changes stream.
The built-in filter types are:
_design
- Returns only changes to design documents._doc_ids
- Returns changes for documents with an ID matching one specified indoc_ids
request body parameter. (POST
only)_selector
- Returns changes for documents that match theselector
request body parameter. The selector syntax is the same as used for_find
. (POST
only)_view
- Returns changes for documents that match an existing map function in the view specified by the query parameterview
.
Additionally, the value can be the name of a JS filter function from a design document. For example:
design_doc/filtername
.Note: For better performance use the built-in
_selector
,_design
or_doc_ids
filters rather than JS based_view
or design document filters. If you need to pass values to change the filtered content use the_selector
filter type.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^_design|_docs_ids|_selector|_view|.*\/.*$
Query parameter to specify the period in milliseconds after which an empty line is sent in the results. Off by default and only applicable for
continuous
andeventsource
feeds. Overrides any timeout to keep the feed alive indefinitely. May also betrue
to use a value of60000
.Note: Delivery of heartbeats cannot be relied on at specific intervals. If your application runs in an environment where idle network connections may break,
heartbeat
is not suitable as a keepalive mechanism. Instead, consider one of the following options:- Use the
timeout
parameter with a value that is compatible with your network environment. - Switch to scheduled usage of one of the non-continuous changes feed types
(
normal
orlongpoll
). - Use TCP keepalive.
Possible values: 1 ≤ value ≤ 60000
- Use the
Query parameter to specify whether to include the full content of the documents in the response.
Default:
false
Query parameter to specify the ID of the last events received by the server on a previous connection. Alias of
Last-Event-ID
header.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify that the update seq should only be calculated with every Nth result returned. When fetching changes in a batch, setting
seq_interval=<batch size>
, where <batch size> is the number of results requested per batch, load can be reduced on the source database as computing the seq value across many shards (especially in highly-sharded databases) is expensive.Possible values: 1 ≤ value ≤ 4294967295
Query parameter to specify to start the results from the change immediately after the given update sequence. Can be a valid update sequence or
now
value. Default is0
i.e. all changes.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Example:
0
Query parameter to specify how many revisions are returned in the changes array. The default,
main_only
, will only return the current "winning" revision; all_docs will return all leaf revisions (including conflicts and deleted former conflicts).Allowable values: [
main_only
,all_docs
]Default:
main_only
Query parameter to specify the maximum period in milliseconds to wait for a change before the response is sent, even if there are no results. Only applicable for
longpoll
orcontinuous
feeds. Default value is specified byhttpd/changes_timeout
configuration option. Note that60000
value is also the default maximum timeout to prevent undetected dead connections.Possible values: 0 ≤ value ≤ 60000
Default:
60000
Query parameter to specify a view function as a filter. Documents pass the filter if the view's map function emits at least one record for them.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].*$
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/orders/_changes?limit=1"
Response
Schema for normal changes feed result.
last_seq
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
pending
Possible values: 0 ≤ value ≤ 9007199254740992
results
Possible values: 0 ≤ number of items ≤ 4294967295
Status Code
HTTP response for
/{db}/_changes
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example ChangesResult response.
{ "last_seq": "7-g1AAAAPveJy1kk9OAjEYxSuYGBO3nsCdC9LOP5yVXkGhB-jXdoKTsSQG1p7CKyj0Ep6CS3AGob5hwYSNMJOwek3T971fXr-KMXYz6Rt2Z0hP3-2ToWygq-ncKDfjXOzPA2dnFR73FKNbKcelYoe2-H9bbZJ07_2ynPTVxRvurjTPhU6i06YcpkVH0hDk6TGEbWtOmAKBddRwUpw-iKE4ByeCxlR6v2jNCdOSPkLY1JxsxykyLlKuDLueO2OLV2dNq6-tx23dJXuR8rMtD2wj2CDfqL5m6u2Ycp1HQ5N26e4ILaIWiIL8hvDTgXcDG-RZylXDm8V5IbLkPLwodgX58n7dgRfFriHYz9DsZpqQtQWdNqn8A1TdTOE", "pending": 3, "results": [ { "changes": [ { "rev": "7-7a5191bfeb2f6eed6b3b6fa83f4810f5" } ], "deleted": true, "id": "0007741142412418284", "seq": "1-g1AAAAMFeJydkcENgjAUhquYePHqBN48EEBj4klXUOgAbSExDUJi8OwUrqDQJZyCJZhBqD8XE0Iiwulvmvf1e68vJITMToZPFj4X8SXY-3xjijC--ixKLMv-ns0oSEIUjxnhc0o9yUgTW_3GaojypVKZPBlsdMbdVFhbW6yd_15p2pwOG0SK77SuevcJSHP06rbILicgj0ul0t5OQBm_aV22yI5l1FAVTciR0ntfKzAXGOKJz-prBpYCQ7y1fg1wl8AQB0rzAW4MnCMeShUD3Bi4QGDTGrT8AMkPBk0" } ] }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve HTTP headers for the database document changes feed (GET)
Retrieves the HTTP headers for the database document changes feed (GET).
HEAD /{db}/_changes
Request
Custom Headers
Header parameter to specify the ID of the last events received by the server on a previous connection. Overrides
since
query parameter.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the ETag for a resource.
Examples:Double quoted base64 encoded attachment digest.
"MEHlNHhicVt9efOzyvsz0Q=="
Double quoted document revision identifier.
"2-240fc93fad07083c338c7e0ea55791b3"
Double quoted local document tag.
"6APCCGX4B76OFFD5972MSBFHD"
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for
/{db}/_changes
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Query the database document changes feed
Requests the database changes feed in the same way as GET /{db}/_changes
does. It is widely used with the filter
query parameter because it allows one to pass more information to the filter.
Note
Before using the changes feed read the FAQs to understand the limitations and appropriate use cases.
If you need to pass parameters to dynamically change the filtered
content use the _selector
filter type for better performance and
compatibility. The SDKs have full support for change requests using
selector filters, but don't support passing parameters to design
document filters.
Requests the database changes feed in the same way as GET /{db}/_changes
does. It is widely used with the filter
query parameter because it allows one to pass more information to the filter.
Note
Before using the changes feed read the FAQs to understand the limitations and appropriate use cases.
If you need to pass parameters to dynamically change the filtered content use the _selector
filter type for better performance and compatibility. The SDKs have full support for change requests using selector filters, but don't support passing parameters to design document filters.
Requests the database changes feed in the same way as GET /{db}/_changes
does. It is widely used with the filter
query parameter because it allows one to pass more information to the filter.
Note
Before using the changes feed read the FAQs to understand the limitations and appropriate use cases.
If you need to pass parameters to dynamically change the filtered content use the _selector
filter type for better performance and compatibility. The SDKs have full support for change requests using selector filters, but don't support passing parameters to design document filters.
Requests the database changes feed in the same way as GET /{db}/_changes
does. It is widely used with the filter
query parameter because it allows one to pass more information to the filter.
Note
Before using the changes feed read the FAQs to understand the limitations and appropriate use cases.
If you need to pass parameters to dynamically change the filtered content use the _selector
filter type for better performance and compatibility. The SDKs have full support for change requests using selector filters, but don't support passing parameters to design document filters.
Requests the database changes feed in the same way as GET /{db}/_changes
does. It is widely used with the filter
query parameter because it allows one to pass more information to the filter.
Note
Before using the changes feed read the FAQs to understand the limitations and appropriate use cases.
If you need to pass parameters to dynamically change the filtered content use the _selector
filter type for better performance and compatibility. The SDKs have full support for change requests using selector filters, but don't support passing parameters to design document filters.
POST /{db}/_changes
(cloudant *CloudantV1) PostChanges(postChangesOptions *PostChangesOptions) (result *ChangesResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostChangesWithContext(ctx context.Context, postChangesOptions *PostChangesOptions) (result *ChangesResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostChangesAsStream(postChangesOptions *PostChangesOptions) (result io.ReadCloser, response *core.DetailedResponse, err error)
ServiceCall<ChangesResult> postChanges(PostChangesOptions postChangesOptions)
ServiceCall<InputStream> postChangesAsStream(PostChangesOptions postChangesOptions)
postChanges(params)
postChangesAsStream(params)
post_changes(
self,
db: str,
*,
doc_ids: Optional[List[str]] = None,
fields: Optional[List[str]] = None,
selector: Optional[dict] = None,
last_event_id: Optional[str] = None,
att_encoding_info: Optional[bool] = None,
attachments: Optional[bool] = None,
conflicts: Optional[bool] = None,
descending: Optional[bool] = None,
feed: Optional[str] = None,
filter: Optional[str] = None,
heartbeat: Optional[int] = None,
include_docs: Optional[bool] = None,
limit: Optional[int] = None,
seq_interval: Optional[int] = None,
since: Optional[str] = None,
style: Optional[str] = None,
timeout: Optional[int] = None,
view: Optional[str] = None,
**kwargs,
) -> DetailedResponse
post_changes_as_stream(
self,
db: str,
*,
doc_ids: Optional[List[str]] = None,
fields: Optional[List[str]] = None,
selector: Optional[dict] = None,
last_event_id: Optional[str] = None,
att_encoding_info: Optional[bool] = None,
attachments: Optional[bool] = None,
conflicts: Optional[bool] = None,
descending: Optional[bool] = None,
feed: Optional[str] = None,
filter: Optional[str] = None,
heartbeat: Optional[int] = None,
include_docs: Optional[bool] = None,
limit: Optional[int] = None,
seq_interval: Optional[int] = None,
since: Optional[str] = None,
style: Optional[str] = None,
timeout: Optional[int] = None,
view: Optional[str] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the PostChangesOptions
struct and set the fields to provide parameter values for the PostChanges
method.
Use the PostChangesOptions.Builder
to create a PostChangesOptions
object that contains the parameter values for the postChanges
method.
Custom Headers
Header parameter to specify the ID of the last events received by the server on a previous connection. Overrides
since
query parameter.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Query Parameters
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Query parameter to specify whether to return the documents in descending by key order.
Default:
false
Query parameter to specify the changes feed type.
Allowable values: [
continuous
,eventsource
,longpoll
,normal
]Default:
normal
Query parameter to specify a filter to emit only specific events from the changes stream.
The built-in filter types are:
_design
- Returns only changes to design documents._doc_ids
- Returns changes for documents with an ID matching one specified indoc_ids
request body parameter. (POST
only)_selector
- Returns changes for documents that match theselector
request body parameter. The selector syntax is the same as used for_find
. (POST
only)_view
- Returns changes for documents that match an existing map function in the view specified by the query parameterview
.
Additionally, the value can be the name of a JS filter function from a design document. For example:
design_doc/filtername
.Note: For better performance use the built-in
_selector
,_design
or_doc_ids
filters rather than JS based_view
or design document filters. If you need to pass values to change the filtered content use the_selector
filter type.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^_design|_docs_ids|_selector|_view|.*\/.*$
Query parameter to specify the period in milliseconds after which an empty line is sent in the results. Off by default and only applicable for
continuous
andeventsource
feeds. Overrides any timeout to keep the feed alive indefinitely. May also betrue
to use a value of60000
.Note: Delivery of heartbeats cannot be relied on at specific intervals. If your application runs in an environment where idle network connections may break,
heartbeat
is not suitable as a keepalive mechanism. Instead, consider one of the following options:- Use the
timeout
parameter with a value that is compatible with your network environment. - Switch to scheduled usage of one of the non-continuous changes feed types
(
normal
orlongpoll
). - Use TCP keepalive.
Possible values: 1 ≤ value ≤ 60000
- Use the
Query parameter to specify whether to include the full content of the documents in the response.
Default:
false
Query parameter to specify the ID of the last events received by the server on a previous connection. Alias of
Last-Event-ID
header.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify that the update seq should only be calculated with every Nth result returned. When fetching changes in a batch, setting
seq_interval=<batch size>
, where <batch size> is the number of results requested per batch, load can be reduced on the source database as computing the seq value across many shards (especially in highly-sharded databases) is expensive.Possible values: 1 ≤ value ≤ 4294967295
Query parameter to specify to start the results from the change immediately after the given update sequence. Can be a valid update sequence or
now
value. Default is0
i.e. all changes.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Example:
0
Query parameter to specify how many revisions are returned in the changes array. The default,
main_only
, will only return the current "winning" revision; all_docs will return all leaf revisions (including conflicts and deleted former conflicts).Allowable values: [
main_only
,all_docs
]Default:
main_only
Query parameter to specify the maximum period in milliseconds to wait for a change before the response is sent, even if there are no results. Only applicable for
longpoll
orcontinuous
feeds. Default value is specified byhttpd/changes_timeout
configuration option. Note that60000
value is also the default maximum timeout to prevent undetected dead connections.Possible values: 0 ≤ value ≤ 60000
Default:
60000
Query parameter to specify a view function as a filter. Documents pass the filter if the view's map function emits at least one record for them.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].*$
HTTP request body for postChanges.
Example ChangesQuery request if ?filter=_doc_ids
is used.
{
"doc_ids": [
"0007741142412418284"
]
}
Example ChangesQuery request if ?filter=_selector
is used.
{
"fields": [
"type",
"user"
],
"selector": {
"_id": {
"$regex": "^0+7741142412418284"
}
}
}
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate
the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax
- selector
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The PostChanges options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Examples:[ "0007741142412418284" ]
JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Header parameter to specify the ID of the last events received by the server on a previous connection. Overrides
since
query parameter.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Query parameter to specify whether to return the documents in descending by key order.
Default:
false
Query parameter to specify the changes feed type.
Allowable values: [
continuous
,eventsource
,longpoll
,normal
]Default:
normal
Query parameter to specify a filter to emit only specific events from the changes stream.
The built-in filter types are:
_design
- Returns only changes to design documents._doc_ids
- Returns changes for documents with an ID matching one specified indoc_ids
request body parameter. (POST
only)_selector
- Returns changes for documents that match theselector
request body parameter. The selector syntax is the same as used for_find
. (POST
only)_view
- Returns changes for documents that match an existing map function in the view specified by the query parameterview
.
Additionally, the value can be the name of a JS filter function from a design document. For example:
design_doc/filtername
.Note: For better performance use the built-in
_selector
,_design
or_doc_ids
filters rather than JS based_view
or design document filters. If you need to pass values to change the filtered content use the_selector
filter type.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^_design|_docs_ids|_selector|_view|.*\/.*$/
Query parameter to specify the period in milliseconds after which an empty line is sent in the results. Off by default and only applicable for
continuous
andeventsource
feeds. Overrides any timeout to keep the feed alive indefinitely. May also betrue
to use a value of60000
.Note: Delivery of heartbeats cannot be relied on at specific intervals. If your application runs in an environment where idle network connections may break,
heartbeat
is not suitable as a keepalive mechanism. Instead, consider one of the following options:- Use the
timeout
parameter with a value that is compatible with your network environment. - Switch to scheduled usage of one of the non-continuous changes feed types
(
normal
orlongpoll
). - Use TCP keepalive.
Possible values: 1 ≤ value ≤ 60000
- Use the
Query parameter to specify whether to include the full content of the documents in the response.
Default:
false
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify that the update seq should only be calculated with every Nth result returned. When fetching changes in a batch, setting
seq_interval=<batch size>
, where <batch size> is the number of results requested per batch, load can be reduced on the source database as computing the seq value across many shards (especially in highly-sharded databases) is expensive.Possible values: 1 ≤ value ≤ 4294967295
Query parameter to specify to start the results from the change immediately after the given update sequence. Can be a valid update sequence or
now
value. Default is0
i.e. all changes.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Examples:0
Query parameter to specify how many revisions are returned in the changes array. The default,
main_only
, will only return the current "winning" revision; all_docs will return all leaf revisions (including conflicts and deleted former conflicts).Allowable values: [
main_only
,all_docs
]Default:
main_only
Query parameter to specify the maximum period in milliseconds to wait for a change before the response is sent, even if there are no results. Only applicable for
longpoll
orcontinuous
feeds. Default value is specified byhttpd/changes_timeout
configuration option. Note that60000
value is also the default maximum timeout to prevent undetected dead connections.Possible values: 0 ≤ value ≤ 60000
Default:
60000
Query parameter to specify a view function as a filter. Documents pass the filter if the view's map function emits at least one record for them.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
The postChanges options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Examples:[ "0007741142412418284" ]
JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Header parameter to specify the ID of the last events received by the server on a previous connection. Overrides
since
query parameter.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Query parameter to specify whether to return the documents in descending by key order.
Default:
false
Query parameter to specify the changes feed type.
Allowable values: [
continuous
,eventsource
,longpoll
,normal
]Default:
normal
Query parameter to specify a filter to emit only specific events from the changes stream.
The built-in filter types are:
_design
- Returns only changes to design documents._doc_ids
- Returns changes for documents with an ID matching one specified indoc_ids
request body parameter. (POST
only)_selector
- Returns changes for documents that match theselector
request body parameter. The selector syntax is the same as used for_find
. (POST
only)_view
- Returns changes for documents that match an existing map function in the view specified by the query parameterview
.
Additionally, the value can be the name of a JS filter function from a design document. For example:
design_doc/filtername
.Note: For better performance use the built-in
_selector
,_design
or_doc_ids
filters rather than JS based_view
or design document filters. If you need to pass values to change the filtered content use the_selector
filter type.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^_design|_docs_ids|_selector|_view|.*\/.*$/
Query parameter to specify the period in milliseconds after which an empty line is sent in the results. Off by default and only applicable for
continuous
andeventsource
feeds. Overrides any timeout to keep the feed alive indefinitely. May also betrue
to use a value of60000
.Note: Delivery of heartbeats cannot be relied on at specific intervals. If your application runs in an environment where idle network connections may break,
heartbeat
is not suitable as a keepalive mechanism. Instead, consider one of the following options:- Use the
timeout
parameter with a value that is compatible with your network environment. - Switch to scheduled usage of one of the non-continuous changes feed types
(
normal
orlongpoll
). - Use TCP keepalive.
Possible values: 1 ≤ value ≤ 60000
- Use the
Query parameter to specify whether to include the full content of the documents in the response.
Default:
false
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify that the update seq should only be calculated with every Nth result returned. When fetching changes in a batch, setting
seq_interval=<batch size>
, where <batch size> is the number of results requested per batch, load can be reduced on the source database as computing the seq value across many shards (especially in highly-sharded databases) is expensive.Possible values: 1 ≤ value ≤ 4294967295
Query parameter to specify to start the results from the change immediately after the given update sequence. Can be a valid update sequence or
now
value. Default is0
i.e. all changes.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Examples:0
Query parameter to specify how many revisions are returned in the changes array. The default,
main_only
, will only return the current "winning" revision; all_docs will return all leaf revisions (including conflicts and deleted former conflicts).Allowable values: [
main_only
,all_docs
]Default:
main_only
Query parameter to specify the maximum period in milliseconds to wait for a change before the response is sent, even if there are no results. Only applicable for
longpoll
orcontinuous
feeds. Default value is specified byhttpd/changes_timeout
configuration option. Note that60000
value is also the default maximum timeout to prevent undetected dead connections.Possible values: 0 ≤ value ≤ 60000
Default:
60000
Query parameter to specify a view function as a filter. Documents pass the filter if the view's map function emits at least one record for them.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Examples:JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Header parameter to specify the ID of the last events received by the server on a previous connection. Overrides
since
query parameter.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Query parameter to specify whether to return the documents in descending by key order.
Default:
false
Query parameter to specify the changes feed type.
Allowable values: [
continuous
,eventsource
,longpoll
,normal
]Default:
normal
Query parameter to specify a filter to emit only specific events from the changes stream.
The built-in filter types are:
_design
- Returns only changes to design documents._doc_ids
- Returns changes for documents with an ID matching one specified indoc_ids
request body parameter. (POST
only)_selector
- Returns changes for documents that match theselector
request body parameter. The selector syntax is the same as used for_find
. (POST
only)_view
- Returns changes for documents that match an existing map function in the view specified by the query parameterview
.
Additionally, the value can be the name of a JS filter function from a design document. For example:
design_doc/filtername
.Note: For better performance use the built-in
_selector
,_design
or_doc_ids
filters rather than JS based_view
or design document filters. If you need to pass values to change the filtered content use the_selector
filter type.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^_design|_docs_ids|_selector|_view|.*\/.*$/
Query parameter to specify the period in milliseconds after which an empty line is sent in the results. Off by default and only applicable for
continuous
andeventsource
feeds. Overrides any timeout to keep the feed alive indefinitely. May also betrue
to use a value of60000
.Note: Delivery of heartbeats cannot be relied on at specific intervals. If your application runs in an environment where idle network connections may break,
heartbeat
is not suitable as a keepalive mechanism. Instead, consider one of the following options:- Use the
timeout
parameter with a value that is compatible with your network environment. - Switch to scheduled usage of one of the non-continuous changes feed types
(
normal
orlongpoll
). - Use TCP keepalive.
Possible values: 1 ≤ value ≤ 60000
- Use the
Query parameter to specify whether to include the full content of the documents in the response.
Default:
false
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify that the update seq should only be calculated with every Nth result returned. When fetching changes in a batch, setting
seq_interval=<batch size>
, where <batch size> is the number of results requested per batch, load can be reduced on the source database as computing the seq value across many shards (especially in highly-sharded databases) is expensive.Possible values: 1 ≤ value ≤ 4294967295
Query parameter to specify to start the results from the change immediately after the given update sequence. Can be a valid update sequence or
now
value. Default is0
i.e. all changes.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Examples:Query parameter to specify how many revisions are returned in the changes array. The default,
main_only
, will only return the current "winning" revision; all_docs will return all leaf revisions (including conflicts and deleted former conflicts).Allowable values: [
main_only
,all_docs
]Default:
main_only
Query parameter to specify the maximum period in milliseconds to wait for a change before the response is sent, even if there are no results. Only applicable for
longpoll
orcontinuous
feeds. Default value is specified byhttpd/changes_timeout
configuration option. Note that60000
value is also the default maximum timeout to prevent undetected dead connections.Possible values: 0 ≤ value ≤ 60000
Default:
60000
Query parameter to specify a view function as a filter. Documents pass the filter if the view's map function emits at least one record for them.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Examples:JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Header parameter to specify the ID of the last events received by the server on a previous connection. Overrides
since
query parameter.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Query parameter to specify whether to return the documents in descending by key order.
Default:
false
Query parameter to specify the changes feed type.
Allowable values: [
continuous
,eventsource
,longpoll
,normal
]Default:
normal
Query parameter to specify a filter to emit only specific events from the changes stream.
The built-in filter types are:
_design
- Returns only changes to design documents._doc_ids
- Returns changes for documents with an ID matching one specified indoc_ids
request body parameter. (POST
only)_selector
- Returns changes for documents that match theselector
request body parameter. The selector syntax is the same as used for_find
. (POST
only)_view
- Returns changes for documents that match an existing map function in the view specified by the query parameterview
.
Additionally, the value can be the name of a JS filter function from a design document. For example:
design_doc/filtername
.Note: For better performance use the built-in
_selector
,_design
or_doc_ids
filters rather than JS based_view
or design document filters. If you need to pass values to change the filtered content use the_selector
filter type.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^_design|_docs_ids|_selector|_view|.*\/.*$/
Query parameter to specify the period in milliseconds after which an empty line is sent in the results. Off by default and only applicable for
continuous
andeventsource
feeds. Overrides any timeout to keep the feed alive indefinitely. May also betrue
to use a value of60000
.Note: Delivery of heartbeats cannot be relied on at specific intervals. If your application runs in an environment where idle network connections may break,
heartbeat
is not suitable as a keepalive mechanism. Instead, consider one of the following options:- Use the
timeout
parameter with a value that is compatible with your network environment. - Switch to scheduled usage of one of the non-continuous changes feed types
(
normal
orlongpoll
). - Use TCP keepalive.
Possible values: 1 ≤ value ≤ 60000
- Use the
Query parameter to specify whether to include the full content of the documents in the response.
Default:
false
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify that the update seq should only be calculated with every Nth result returned. When fetching changes in a batch, setting
seq_interval=<batch size>
, where <batch size> is the number of results requested per batch, load can be reduced on the source database as computing the seq value across many shards (especially in highly-sharded databases) is expensive.Possible values: 1 ≤ value ≤ 4294967295
Query parameter to specify to start the results from the change immediately after the given update sequence. Can be a valid update sequence or
now
value. Default is0
i.e. all changes.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Examples:Query parameter to specify how many revisions are returned in the changes array. The default,
main_only
, will only return the current "winning" revision; all_docs will return all leaf revisions (including conflicts and deleted former conflicts).Allowable values: [
main_only
,all_docs
]Default:
main_only
Query parameter to specify the maximum period in milliseconds to wait for a change before the response is sent, even if there are no results. Only applicable for
longpoll
orcontinuous
feeds. Default value is specified byhttpd/changes_timeout
configuration option. Note that60000
value is also the default maximum timeout to prevent undetected dead connections.Possible values: 0 ≤ value ≤ 60000
Default:
60000
Query parameter to specify a view function as a filter. Documents pass the filter if the view's map function emits at least one record for them.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X POST "$SERVICE_URL/orders/_changes" -H "Content-Type: application/json" --data '{ "doc_ids": [ "small-appliances:1000042" ] }'
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } postChangesOptions := service.NewPostChangesOptions( "orders", ) changesResult, response, err := service.PostChanges(postChangesOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(changesResult, "", " ") fmt.Println(string(b))
import ( "encoding/json" "fmt" "io" "os" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } postChangesOptions := service.NewPostChangesOptions( "orders", ) changesResult, response, err := service.PostChangesAsStream(postChangesOptions) if err != nil { panic(err) } if changesResult != nil { defer changesResult.Close() outFile, err := os.Create("result.json") if err != nil { panic(err) } defer outFile.Close() if _, err = io.Copy(outFile, changesResult); err != nil { panic(err) } }
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.ChangesResult; import com.ibm.cloud.cloudant.v1.model.PostChangesOptions;
Cloudant service = Cloudant.newInstance(); PostChangesOptions changesOptions = new PostChangesOptions.Builder() .db("orders") .build(); ChangesResult response = service.postChanges(changesOptions).execute() .getResult(); System.out.println(response);
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.PostChangesOptions; import java.io.InputStream; import java.io.File; import java.nio.file.StandardCopyOption;
Cloudant service = Cloudant.newInstance(); PostChangesOptions changesOptions = new PostChangesOptions.Builder() .db("orders") .build(); File file = new File("result.json"); try (InputStream response = service.postChangesAsStream(changesOptions).execute() .getResult()) { java.nio.file.Files.copy( response, file.toPath(), StandardCopyOption.REPLACE_EXISTING); }
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.postChanges({ db: 'orders' }).then(response => { console.log(response.result); });
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.postChangesAsStream({ db: 'orders' }).then(response => { let stream = fs.createWriteStream("result.json"); response.result.pipe(stream); response.result.on('end', () => stream.end()); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.post_changes( db='orders' ).get_result() print(response)
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() result = service.post_changes_as_stream( db='orders' ).get_result() with open('result.json', 'wb') as f: for chunk in result.iter_content(): f.write(chunk)
Response
Response type for PostChanges
: ChangesResult
Response type for PostChangesAsStream
: io.ReadCloser
Response type for postChanges
: ChangesResult
Response type for postChangesAsStream
: InputStream
Response type for postChanges
: ChangesResult
Response type for postChangesAsStream
: NodeJS.ReadableStream
Response type for post_changes
: ChangesResult
Response type for post_changes_as_stream
: BinaryIO
Schema for normal changes feed result.
last_seq
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
pending
Possible values: 0 ≤ value ≤ 9007199254740992
results
Possible values: 0 ≤ number of items ≤ 4294967295
Schema for normal changes feed result.
last_seq.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
pending.
Possible values: 0 ≤ value ≤ 9007199254740992
results.
Possible values: number of items ≥ 0
- Results
List of document's leaves with single field rev.
Possible values: number of items ≥ 1
- Changes
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
if
true
then the document is deleted.Schema for a document.
- Doc
Schema for a map of attachment name to attachment metadata.
- Attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- Revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- RevsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Update sequence.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for normal changes feed result.
last_seq.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
pending.
Possible values: 0 ≤ value ≤ 9007199254740992
results.
Possible values: number of items ≥ 0
- results
List of document's leaves with single field rev.
Possible values: number of items ≥ 1
- changes
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
if
true
then the document is deleted.Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- revsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Update sequence.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for normal changes feed result.
last_seq.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
pending.
Possible values: 0 ≤ value ≤ 9007199254740992
results.
Possible values: number of items ≥ 0
- results
List of document's leaves with single field rev.
Possible values: number of items ≥ 1
- changes
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
if
true
then the document is deleted.Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Update sequence.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for normal changes feed result.
last_seq.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
pending.
Possible values: 0 ≤ value ≤ 9007199254740992
results.
Possible values: number of items ≥ 0
- results
List of document's leaves with single field rev.
Possible values: number of items ≥ 1
- changes
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
if
true
then the document is deleted.Schema for a document.
- doc
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Update sequence.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Status Code
HTTP response for
/{db}/_changes
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example ChangesResult response.
{ "last_seq": "7-g1AAAAPveJy1kk9OAjEYxSuYGBO3nsCdC9LOP5yVXkGhB-jXdoKTsSQG1p7CKyj0Ep6CS3AGob5hwYSNMJOwek3T971fXr-KMXYz6Rt2Z0hP3-2ToWygq-ncKDfjXOzPA2dnFR73FKNbKcelYoe2-H9bbZJ07_2ynPTVxRvurjTPhU6i06YcpkVH0hDk6TGEbWtOmAKBddRwUpw-iKE4ByeCxlR6v2jNCdOSPkLY1JxsxykyLlKuDLueO2OLV2dNq6-tx23dJXuR8rMtD2wj2CDfqL5m6u2Ycp1HQ5N26e4ILaIWiIL8hvDTgXcDG-RZylXDm8V5IbLkPLwodgX58n7dgRfFriHYz9DsZpqQtQWdNqn8A1TdTOE", "pending": 3, "results": [ { "changes": [ { "rev": "7-7a5191bfeb2f6eed6b3b6fa83f4810f5" } ], "deleted": true, "id": "0007741142412418284", "seq": "1-g1AAAAMFeJydkcENgjAUhquYePHqBN48EEBj4klXUOgAbSExDUJi8OwUrqDQJZyCJZhBqD8XE0Iiwulvmvf1e68vJITMToZPFj4X8SXY-3xjijC--ixKLMv-ns0oSEIUjxnhc0o9yUgTW_3GaojypVKZPBlsdMbdVFhbW6yd_15p2pwOG0SK77SuevcJSHP06rbILicgj0ul0t5OQBm_aV22yI5l1FAVTciR0ntfKzAXGOKJz-prBpYCQ7y1fg1wl8AQB0rzAW4MnCMeShUD3Bi4QGDTGrT8AMkPBk0" } ] }
Example ChangesResult response.
{ "last_seq": "7-g1AAAAPveJy1kk9OAjEYxSuYGBO3nsCdC9LOP5yVXkGhB-jXdoKTsSQG1p7CKyj0Ep6CS3AGob5hwYSNMJOwek3T971fXr-KMXYz6Rt2Z0hP3-2ToWygq-ncKDfjXOzPA2dnFR73FKNbKcelYoe2-H9bbZJ07_2ynPTVxRvurjTPhU6i06YcpkVH0hDk6TGEbWtOmAKBddRwUpw-iKE4ByeCxlR6v2jNCdOSPkLY1JxsxykyLlKuDLueO2OLV2dNq6-tx23dJXuR8rMtD2wj2CDfqL5m6u2Ycp1HQ5N26e4ILaIWiIL8hvDTgXcDG-RZylXDm8V5IbLkPLwodgX58n7dgRfFriHYz9DsZpqQtQWdNqn8A1TdTOE", "pending": 3, "results": [ { "changes": [ { "rev": "7-7a5191bfeb2f6eed6b3b6fa83f4810f5" } ], "deleted": true, "id": "0007741142412418284", "seq": "1-g1AAAAMFeJydkcENgjAUhquYePHqBN48EEBj4klXUOgAbSExDUJi8OwUrqDQJZyCJZhBqD8XE0Iiwulvmvf1e68vJITMToZPFj4X8SXY-3xjijC--ixKLMv-ns0oSEIUjxnhc0o9yUgTW_3GaojypVKZPBlsdMbdVFhbW6yd_15p2pwOG0SK77SuevcJSHP06rbILicgj0ul0t5OQBm_aV22yI5l1FAVTciR0ntfKzAXGOKJz-prBpYCQ7y1fg1wl8AQB0rzAW4MnCMeShUD3Bi4QGDTGrT8AMkPBk0" } ] }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Create a transient replication
Requests, configures, or stops a replicate operation. Note: Use the _replicator
database to persist the replication configuration. That usage is preferred over this /_replicate
endpoint, which is a transient operation.
POST /_replicate
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
HTTP request body for replication operations.
Example ReplicationDocument request.
{
"cancel": false,
"checkpoint_interval": 4500,
"connection_timeout": 15000,
"continuous": true,
"create_target": true,
"create_target_params": {
"q": 1
},
"doc_ids": [
"badger",
"lemur",
"llama"
],
"filter": "ddoc/my_filter",
"http_connections": 10,
"retries_per_request": 3,
"selector": {
"_id": {
"$regex": "docid"
}
},
"since_seq": "34-g1AAAAGjeJzLYWBgYMlgTmGQT0lKzi9KdU",
"socket_options": "[{keepalive, true}, {nodelay, false}]",
"source": {
"url": "https://my-source-instance.cloudantnosqldb.appdomain.cloud.example/animaldb"
},
"target": {
"auth": {
"iam": {
"api_key": "iam_api_key"
}
},
"url": "https://my-target-instance.cloudantnosqldb.appdomain.cloud.example/animaldb-target"
},
"use_checkpoints": false,
"user_ctx": {
"name": "john",
"roles": [
"_replicator"
]
},
"worker_batch_size": 400,
"worker_processes": 3
}
Schema for a replication source or target database.
Schema for a replication source or target database.
Schema for a map of attachment name to attachment metadata.
- _attachments
Schema for an attachment.
Schema for a list of document revision identifiers.
Possible values: 0 ≤ number of items ≤ 4294967295, 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Deletion flag. Available if document was removed
Schema for a list of document revision identifiers.
Possible values: 0 ≤ number of items ≤ 4294967295, 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Document's update sequence in current database. Available if requested with local_seq=true query parameter
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Schema for list of revision information.
Schema for a list of objects with information about local revisions and their status.
Possible values: 1 ≤ number of items ≤ 4294967295
Cancels the replication.
Defines replication checkpoint interval in milliseconds.
Possible values: 0 ≤ value ≤ 2147483647
Default:
30000
HTTP connection timeout per replication. Even for very fast/reliable networks it might need to be increased if a remote database is too busy.
Possible values: 0 ≤ value ≤ 2147483647
Default:
30000
Configure the replication to be continuous.
Default:
false
Creates the target database. Requires administrator privileges on target server.
Default:
false
Request parameters to use during target database creation.
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
The name of a filter function which is defined in a design document in the source database in {ddoc_id}/{filter} format. It determines which documents get replicated. Using the selector option provides performance benefits when compared with using the filter option. Use the selector option when possible.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^/]+/.+$
Maximum number of HTTP connections per replication.
Possible values: 1 ≤ value ≤ 100
Default:
20
The replication document owner. The server sets an appropriate value if the field is unset when writing a replication document. Only administrators can modify the value to an owner other than themselves.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Deprecated: see
source_proxy
andtarget_proxy
. Address of a (http or socks5 protocol) proxy server through which replication with the source and target databases should occur.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Schema for a map of string key value pairs, such as query parameters.
- query_params
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Number of times a replication request is retried. The requests are retried with a doubling exponential backoff starting at 0.25 seconds, with a cap at 5 minutes.
Possible values: 0 ≤ value ≤ 5000
Default:
5
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate
the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax
- selector
Start the replication at a specific sequence value.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Replication socket options.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators.
Address of a (http or socks5 protocol) proxy server through which replication with the source database should occur.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^http(s)?:\/\/.*$
This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators.
Address of a (http or socks5 protocol) proxy server through which replication with the target database should occur.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^http(s)?:\/\/.*$
Specify whether to use _bulk_get for fetching documents from the source. If unset, the server configured default will be used.
Specify if checkpoints should be saved during replication. Using checkpoints means a replication can be efficiently resumed.
Default:
true
Schema for the user context of a session.
Replicate only the winning revisions. Replication with this mode discards conflicting revisions. Replication IDs and checkpoints generated by this mode are different to those generated by default, so it is possible to first replicate the winning revisions then later backfill remaining revisions with a regular replication job.
Default:
false
Controls how many documents are processed. After each batch a checkpoint is written so this controls how frequently checkpointing occurs.
Possible values: 1 ≤ value ≤ 65535
Default:
500
Controls how many separate processes will read from the changes manager and write to the target. A higher number can improve throughput.
Possible values: 1 ≤ value ≤ 16
Default:
4
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X POST "$SERVICE_URL/_replicate" -H "Content-Type: application/json" --data '{ "_id": "repldoc-example", "create_target": true, "source": { "url": "'"$SOURCE_SERVICE_URL/animaldb"'" }, "target": { "auth": { "iam": { "api_key": "'"$API_KEY"'" } }, "url": "'"$TARGET_SERVICE_URL/animaldb-target"'" } }'
Response
Schema for a replication result.
Replication history.
Possible values: 1 ≤ number of items ≤ 4294967295
Replication status.
Replication protocol version.
Possible values: 0 ≤ value ≤ 9007199254740992
Unique session ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Last sequence number read from source database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Changes since last checkpoint in replication history.
Status Code
HTTP response for postReplicate.
HTTP response for postReplicate.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example ReplicationResult response.
{ "history": [ { "doc_write_failures": 0, "docs_read": 10, "docs_written": 10, "end_last_seq": "28-abcdefghijklmnopqrstuvwxyz", "end_time": "Sun, 11 Aug 2019 20:38:50 GMT", "missing_checked": 10, "missing_found": 10, "recorded_seq": "28-abcdefghijklmnopqrstuvwxyz", "session_id": "142a35854a08e205c47174d91b1f9628", "start_last_seq": "1-abcdefghijklmnopqrstuvwxyz", "start_time": "Sun, 11 Aug 2019 20:38:50 GMT" } ], "ok": true, "replication_id_version": 3, "session_id": "142a35854a08e205c47174d91b1f9628", "source_last_seq": "28-abcdefghijklmnopqrstuvwxyz" }
Example ReplicationInformation response.
{ "_local_id": "460b3a44135318afce548ec26b604e6f+continuous", "ok": true }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for administrator privileges required.
{ "error": "unauthorized", "reason": "You are not a server admin." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request with a document size that exceeds the allowable limit.
{ "error": "document_too_large", "reason": "doc_id" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Create a persistent replication with a generated ID
Creates or modifies a document in the _replicator
database to start a new replication or to edit an existing replication.
Creates or modifies a document in the _replicator
database to start a new replication or to edit an existing replication.
Creates or modifies a document in the _replicator
database to start a new replication or to edit an existing replication.
Creates or modifies a document in the _replicator
database to start a new replication or to edit an existing replication.
Creates or modifies a document in the _replicator
database to start a new replication or to edit an existing replication.
POST /_replicator
(cloudant *CloudantV1) PostReplicator(postReplicatorOptions *PostReplicatorOptions) (result *DocumentResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostReplicatorWithContext(ctx context.Context, postReplicatorOptions *PostReplicatorOptions) (result *DocumentResult, response *core.DetailedResponse, err error)
ServiceCall<DocumentResult> postReplicator(PostReplicatorOptions postReplicatorOptions)
postReplicator(params)
post_replicator(
self,
replication_document: 'ReplicationDocument',
*,
batch: Optional[str] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the PostReplicatorOptions
struct and set the fields to provide parameter values for the PostReplicator
method.
Use the PostReplicatorOptions.Builder
to create a PostReplicatorOptions
object that contains the parameter values for the postReplicator
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Query Parameters
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]
HTTP request body for replication operations.
Example ReplicationDocument request.
{
"cancel": false,
"checkpoint_interval": 4500,
"connection_timeout": 15000,
"continuous": true,
"create_target": true,
"create_target_params": {
"q": 1
},
"doc_ids": [
"badger",
"lemur",
"llama"
],
"filter": "ddoc/my_filter",
"http_connections": 10,
"retries_per_request": 3,
"selector": {
"_id": {
"$regex": "docid"
}
},
"since_seq": "34-g1AAAAGjeJzLYWBgYMlgTmGQT0lKzi9KdU",
"socket_options": "[{keepalive, true}, {nodelay, false}]",
"source": {
"url": "https://my-source-instance.cloudantnosqldb.appdomain.cloud.example/animaldb"
},
"target": {
"auth": {
"iam": {
"api_key": "iam_api_key"
}
},
"url": "https://my-target-instance.cloudantnosqldb.appdomain.cloud.example/animaldb-target"
},
"use_checkpoints": false,
"user_ctx": {
"name": "john",
"roles": [
"_replicator"
]
},
"worker_batch_size": 400,
"worker_processes": 3
}
Schema for a replication source or target database.
Schema for a replication source or target database.
Schema for a map of attachment name to attachment metadata.
- _attachments
Schema for an attachment.
Schema for a list of document revision identifiers.
Possible values: 0 ≤ number of items ≤ 4294967295, 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Deletion flag. Available if document was removed
Schema for a list of document revision identifiers.
Possible values: 0 ≤ number of items ≤ 4294967295, 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Document's update sequence in current database. Available if requested with local_seq=true query parameter
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Schema for list of revision information.
Schema for a list of objects with information about local revisions and their status.
Possible values: 1 ≤ number of items ≤ 4294967295
Cancels the replication.
Defines replication checkpoint interval in milliseconds.
Possible values: 0 ≤ value ≤ 2147483647
Default:
30000
HTTP connection timeout per replication. Even for very fast/reliable networks it might need to be increased if a remote database is too busy.
Possible values: 0 ≤ value ≤ 2147483647
Default:
30000
Configure the replication to be continuous.
Default:
false
Creates the target database. Requires administrator privileges on target server.
Default:
false
Request parameters to use during target database creation.
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
The name of a filter function which is defined in a design document in the source database in {ddoc_id}/{filter} format. It determines which documents get replicated. Using the selector option provides performance benefits when compared with using the filter option. Use the selector option when possible.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^/]+/.+$
Maximum number of HTTP connections per replication.
Possible values: 1 ≤ value ≤ 100
Default:
20
The replication document owner. The server sets an appropriate value if the field is unset when writing a replication document. Only administrators can modify the value to an owner other than themselves.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Deprecated: see
source_proxy
andtarget_proxy
. Address of a (http or socks5 protocol) proxy server through which replication with the source and target databases should occur.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Schema for a map of string key value pairs, such as query parameters.
- query_params
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Number of times a replication request is retried. The requests are retried with a doubling exponential backoff starting at 0.25 seconds, with a cap at 5 minutes.
Possible values: 0 ≤ value ≤ 5000
Default:
5
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate
the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax
- selector
Start the replication at a specific sequence value.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Replication socket options.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators.
Address of a (http or socks5 protocol) proxy server through which replication with the source database should occur.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^http(s)?:\/\/.*$
This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators.
Address of a (http or socks5 protocol) proxy server through which replication with the target database should occur.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^http(s)?:\/\/.*$
Specify whether to use _bulk_get for fetching documents from the source. If unset, the server configured default will be used.
Specify if checkpoints should be saved during replication. Using checkpoints means a replication can be efficiently resumed.
Default:
true
Schema for the user context of a session.
Replicate only the winning revisions. Replication with this mode discards conflicting revisions. Replication IDs and checkpoints generated by this mode are different to those generated by default, so it is possible to first replicate the winning revisions then later backfill remaining revisions with a regular replication job.
Default:
false
Controls how many documents are processed. After each batch a checkpoint is written so this controls how frequently checkpointing occurs.
Possible values: 1 ≤ value ≤ 65535
Default:
500
Controls how many separate processes will read from the changes manager and write to the target. A higher number can improve throughput.
Possible values: 1 ≤ value ≤ 16
Default:
4
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The PostReplicator options.
HTTP request body for replication operations.
Examples:{ "cancel": false, "checkpoint_interval": 4500, "connection_timeout": 15000, "continuous": true, "create_target": true, "create_target_params": { "q": 1 }, "doc_ids": [ "badger", "lemur", "llama" ], "filter": "ddoc/my_filter", "http_connections": 10, "retries_per_request": 3, "selector": { "_id": { "$regex": "docid" } }, "since_seq": "34-g1AAAAGjeJzLYWBgYMlgTmGQT0lKzi9KdU", "socket_options": "[{keepalive, true}, {nodelay, false}]", "source": { "url": "https://my-source-instance.cloudantnosqldb.appdomain.cloud.example/animaldb" }, "target": { "auth": { "iam": { "api_key": "iam_api_key" } }, "url": "https://my-target-instance.cloudantnosqldb.appdomain.cloud.example/animaldb-target" }, "use_checkpoints": false, "user_ctx": { "name": "john", "roles": [ "_replicator" ] }, "worker_batch_size": 400, "worker_processes": 3 }
- ReplicationDocument
Schema for a map of attachment name to attachment metadata.
- Attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- Revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- RevsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Allowable values: [
available
,missing
,deleted
]
Cancels the replication.
Defines replication checkpoint interval in milliseconds.
Possible values: 0 ≤ value ≤ 2147483647
Default:
30000
HTTP connection timeout per replication. Even for very fast/reliable networks it might need to be increased if a remote database is too busy.
Possible values: 0 ≤ value ≤ 2147483647
Default:
30000
Configure the replication to be continuous.
Default:
false
Creates the target database. Requires administrator privileges on target server.
Default:
false
Request parameters to use during target database creation.
- CreateTargetParams
Schema for the number of replicas of a database in a cluster. The cluster is using the default value and it cannot be changed by the user.
Possible values: value = 3
Default:
3
Parameter to specify whether to enable database partitions when creating the target database.
Default:
false
Schema for the number of shards in a database. Each shard is a partition of the hash value range.
Possible values: 1 ≤ value ≤ 120
Default:
16
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
The name of a filter function which is defined in a design document in the source database in {ddoc_id}/{filter} format. It determines which documents get replicated. Using the selector option provides performance benefits when compared with using the filter option. Use the selector option when possible.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^\/]+\/.+$/
Maximum number of HTTP connections per replication.
Possible values: 1 ≤ value ≤ 100
Default:
20
The replication document owner. The server sets an appropriate value if the field is unset when writing a replication document. Only administrators can modify the value to an owner other than themselves.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a map of string key value pairs, such as query parameters.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Number of times a replication request is retried. The requests are retried with a doubling exponential backoff starting at 0.25 seconds, with a cap at 5 minutes.
Possible values: 0 ≤ value ≤ 5000
Default:
5
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Start the replication at a specific sequence value.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Replication socket options.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a replication source or target database.
- Source
Schema for replication source or target database authentication.
- Auth
Schema for basic authentication of replication source or target database.
- Basic
The password associated with the username.
Possible values: 16 ≤ length ≤ 7168, Value must match regular expression
/^[^\\n\\t]{16,}$/
Schema for a username.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
Schema for an IAM API key for replication database authentication.
- Iam
IAM API key.
Possible values: 1 ≤ length ≤ 44, Value must match regular expression
/^[A-Za-z0-9_-]{2,}$/
Replication request headers.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Replication database URL.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators.
Address of a (http or socks5 protocol) proxy server through which replication with the source database should occur.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^http(s)?:\/\/.*$/
Schema for a replication source or target database.
- Target
Schema for replication source or target database authentication.
- Auth
Schema for basic authentication of replication source or target database.
- Basic
The password associated with the username.
Possible values: 16 ≤ length ≤ 7168, Value must match regular expression
/^[^\\n\\t]{16,}$/
Schema for a username.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
Schema for an IAM API key for replication database authentication.
- Iam
IAM API key.
Possible values: 1 ≤ length ≤ 44, Value must match regular expression
/^[A-Za-z0-9_-]{2,}$/
Replication request headers.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Replication database URL.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators.
Address of a (http or socks5 protocol) proxy server through which replication with the target database should occur.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^http(s)?:\/\/.*$/
Specify whether to use _bulk_get for fetching documents from the source. If unset, the server configured default will be used.
Specify if checkpoints should be saved during replication. Using checkpoints means a replication can be efficiently resumed.
Default:
true
Schema for the user context of a session.
- UserCtx
Database name in the context of the provided operation.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Name of user running the process.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
List of user roles.
Allowable values: [
_reader
,_writer
,_admin
,_replicator
,_db_updates
,_design
,_shards
,_security
]Possible values: number of items ≥ 0
Replicate only the winning revisions. Replication with this mode discards conflicting revisions. Replication IDs and checkpoints generated by this mode are different to those generated by default, so it is possible to first replicate the winning revisions then later backfill remaining revisions with a regular replication job.
Default:
false
Controls how many documents are processed. After each batch a checkpoint is written so this controls how frequently checkpointing occurs.
Possible values: 1 ≤ value ≤ 65535
Default:
500
Controls how many separate processes will read from the changes manager and write to the target. A higher number can improve throughput.
Possible values: 1 ≤ value ≤ 16
Default:
4
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]
The postReplicator options.
HTTP request body for replication operations.
Examples:{ "cancel": false, "checkpoint_interval": 4500, "connection_timeout": 15000, "continuous": true, "create_target": true, "create_target_params": { "q": 1 }, "doc_ids": [ "badger", "lemur", "llama" ], "filter": "ddoc/my_filter", "http_connections": 10, "retries_per_request": 3, "selector": { "_id": { "$regex": "docid" } }, "since_seq": "34-g1AAAAGjeJzLYWBgYMlgTmGQT0lKzi9KdU", "socket_options": "[{keepalive, true}, {nodelay, false}]", "source": { "url": "https://my-source-instance.cloudantnosqldb.appdomain.cloud.example/animaldb" }, "target": { "auth": { "iam": { "api_key": "iam_api_key" } }, "url": "https://my-target-instance.cloudantnosqldb.appdomain.cloud.example/animaldb-target" }, "use_checkpoints": false, "user_ctx": { "name": "john", "roles": [ "_replicator" ] }, "worker_batch_size": 400, "worker_processes": 3 }
- replicationDocument
Schema for a map of attachment name to attachment metadata.
- attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- revsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Allowable values: [
available
,missing
,deleted
]
Cancels the replication.
Defines replication checkpoint interval in milliseconds.
Possible values: 0 ≤ value ≤ 2147483647
Default:
30000
HTTP connection timeout per replication. Even for very fast/reliable networks it might need to be increased if a remote database is too busy.
Possible values: 0 ≤ value ≤ 2147483647
Default:
30000
Configure the replication to be continuous.
Default:
false
Creates the target database. Requires administrator privileges on target server.
Default:
false
Request parameters to use during target database creation.
- createTargetParams
Schema for the number of replicas of a database in a cluster. The cluster is using the default value and it cannot be changed by the user.
Possible values: value = 3
Default:
3
Parameter to specify whether to enable database partitions when creating the target database.
Default:
false
Schema for the number of shards in a database. Each shard is a partition of the hash value range.
Possible values: 1 ≤ value ≤ 120
Default:
16
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
The name of a filter function which is defined in a design document in the source database in {ddoc_id}/{filter} format. It determines which documents get replicated. Using the selector option provides performance benefits when compared with using the filter option. Use the selector option when possible.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^\/]+\/.+$/
Maximum number of HTTP connections per replication.
Possible values: 1 ≤ value ≤ 100
Default:
20
The replication document owner. The server sets an appropriate value if the field is unset when writing a replication document. Only administrators can modify the value to an owner other than themselves.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a map of string key value pairs, such as query parameters.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Number of times a replication request is retried. The requests are retried with a doubling exponential backoff starting at 0.25 seconds, with a cap at 5 minutes.
Possible values: 0 ≤ value ≤ 5000
Default:
5
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Start the replication at a specific sequence value.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Replication socket options.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a replication source or target database.
- source
Schema for replication source or target database authentication.
- auth
Schema for basic authentication of replication source or target database.
- basic
The password associated with the username.
Possible values: 16 ≤ length ≤ 7168, Value must match regular expression
/^[^\\n\\t]{16,}$/
Schema for a username.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
Schema for an IAM API key for replication database authentication.
- iam
IAM API key.
Possible values: 1 ≤ length ≤ 44, Value must match regular expression
/^[A-Za-z0-9_-]{2,}$/
Replication request headers.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Replication database URL.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators.
Address of a (http or socks5 protocol) proxy server through which replication with the source database should occur.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^http(s)?:\/\/.*$/
Schema for a replication source or target database.
- target
Schema for replication source or target database authentication.
- auth
Schema for basic authentication of replication source or target database.
- basic
The password associated with the username.
Possible values: 16 ≤ length ≤ 7168, Value must match regular expression
/^[^\\n\\t]{16,}$/
Schema for a username.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
Schema for an IAM API key for replication database authentication.
- iam
IAM API key.
Possible values: 1 ≤ length ≤ 44, Value must match regular expression
/^[A-Za-z0-9_-]{2,}$/
Replication request headers.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Replication database URL.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators.
Address of a (http or socks5 protocol) proxy server through which replication with the target database should occur.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^http(s)?:\/\/.*$/
Specify whether to use _bulk_get for fetching documents from the source. If unset, the server configured default will be used.
Specify if checkpoints should be saved during replication. Using checkpoints means a replication can be efficiently resumed.
Default:
true
Schema for the user context of a session.
- userCtx
Database name in the context of the provided operation.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Name of user running the process.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
List of user roles.
Allowable values: [
_reader
,_writer
,_admin
,_replicator
,_db_updates
,_design
,_shards
,_security
]Possible values: number of items ≥ 0
Replicate only the winning revisions. Replication with this mode discards conflicting revisions. Replication IDs and checkpoints generated by this mode are different to those generated by default, so it is possible to first replicate the winning revisions then later backfill remaining revisions with a regular replication job.
Default:
false
Controls how many documents are processed. After each batch a checkpoint is written so this controls how frequently checkpointing occurs.
Possible values: 1 ≤ value ≤ 65535
Default:
500
Controls how many separate processes will read from the changes manager and write to the target. A higher number can improve throughput.
Possible values: 1 ≤ value ≤ 16
Default:
4
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]
parameters
Schema for a replication document. Note that
selector
,doc_ids
, andfilter
are incompatible with each other.- replicationDocument
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Allowable values: [
available
,missing
,deleted
]
Cancels the replication.
Defines replication checkpoint interval in milliseconds.
Possible values: 0 ≤ value ≤ 2147483647
Default:
30000
HTTP connection timeout per replication. Even for very fast/reliable networks it might need to be increased if a remote database is too busy.
Possible values: 0 ≤ value ≤ 2147483647
Default:
30000
Configure the replication to be continuous.
Default:
false
Creates the target database. Requires administrator privileges on target server.
Default:
false
Request parameters to use during target database creation.
- createTargetParams
Schema for the number of replicas of a database in a cluster. The cluster is using the default value and it cannot be changed by the user.
Possible values: value = 3
Default:
3
Parameter to specify whether to enable database partitions when creating the target database.
Default:
false
Schema for the number of shards in a database. Each shard is a partition of the hash value range.
Possible values: 1 ≤ value ≤ 120
Default:
16
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
The name of a filter function which is defined in a design document in the source database in {ddoc_id}/{filter} format. It determines which documents get replicated. Using the selector option provides performance benefits when compared with using the filter option. Use the selector option when possible.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^\/]+\/.+$/
Maximum number of HTTP connections per replication.
Possible values: 1 ≤ value ≤ 100
Default:
20
The replication document owner. The server sets an appropriate value if the field is unset when writing a replication document. Only administrators can modify the value to an owner other than themselves.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a map of string key value pairs, such as query parameters.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Number of times a replication request is retried. The requests are retried with a doubling exponential backoff starting at 0.25 seconds, with a cap at 5 minutes.
Possible values: 0 ≤ value ≤ 5000
Default:
5
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Start the replication at a specific sequence value.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Replication socket options.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a replication source or target database.
- source
Schema for replication source or target database authentication.
- auth
Schema for basic authentication of replication source or target database.
- basic
The password associated with the username.
Possible values: 16 ≤ length ≤ 7168, Value must match regular expression
/^[^\\n\\t]{16,}$/
Schema for a username.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
Schema for an IAM API key for replication database authentication.
- iam
IAM API key.
Possible values: 1 ≤ length ≤ 44, Value must match regular expression
/^[A-Za-z0-9_-]{2,}$/
Replication request headers.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Replication database URL.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators.
Address of a (http or socks5 protocol) proxy server through which replication with the source database should occur.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^http(s)?:\/\/.*$/
Schema for a replication source or target database.
- target
Schema for replication source or target database authentication.
- auth
Schema for basic authentication of replication source or target database.
- basic
The password associated with the username.
Possible values: 16 ≤ length ≤ 7168, Value must match regular expression
/^[^\\n\\t]{16,}$/
Schema for a username.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
Schema for an IAM API key for replication database authentication.
- iam
IAM API key.
Possible values: 1 ≤ length ≤ 44, Value must match regular expression
/^[A-Za-z0-9_-]{2,}$/
Replication request headers.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Replication database URL.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators.
Address of a (http or socks5 protocol) proxy server through which replication with the target database should occur.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^http(s)?:\/\/.*$/
Specify whether to use _bulk_get for fetching documents from the source. If unset, the server configured default will be used.
Specify if checkpoints should be saved during replication. Using checkpoints means a replication can be efficiently resumed.
Default:
true
Schema for the user context of a session.
- userCtx
Database name in the context of the provided operation.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Name of user running the process.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
List of user roles.
Allowable values: [
_reader
,_writer
,_admin
,_replicator
,_db_updates
,_design
,_shards
,_security
]Possible values: number of items ≥ 0
Replicate only the winning revisions. Replication with this mode discards conflicting revisions. Replication IDs and checkpoints generated by this mode are different to those generated by default, so it is possible to first replicate the winning revisions then later backfill remaining revisions with a regular replication job.
Default:
false
Controls how many documents are processed. After each batch a checkpoint is written so this controls how frequently checkpointing occurs.
Possible values: 1 ≤ value ≤ 65535
Default:
500
Controls how many separate processes will read from the changes manager and write to the target. A higher number can improve throughput.
Possible values: 1 ≤ value ≤ 16
Default:
4
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]
parameters
Schema for a replication document. Note that
selector
,doc_ids
, andfilter
are incompatible with each other.- replication_document
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Allowable values: [
available
,missing
,deleted
]
Cancels the replication.
Defines replication checkpoint interval in milliseconds.
Possible values: 0 ≤ value ≤ 2147483647
Default:
30000
HTTP connection timeout per replication. Even for very fast/reliable networks it might need to be increased if a remote database is too busy.
Possible values: 0 ≤ value ≤ 2147483647
Default:
30000
Configure the replication to be continuous.
Default:
false
Creates the target database. Requires administrator privileges on target server.
Default:
false
Request parameters to use during target database creation.
- create_target_params
Schema for the number of replicas of a database in a cluster. The cluster is using the default value and it cannot be changed by the user.
Possible values: value = 3
Default:
3
Parameter to specify whether to enable database partitions when creating the target database.
Default:
false
Schema for the number of shards in a database. Each shard is a partition of the hash value range.
Possible values: 1 ≤ value ≤ 120
Default:
16
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
The name of a filter function which is defined in a design document in the source database in {ddoc_id}/{filter} format. It determines which documents get replicated. Using the selector option provides performance benefits when compared with using the filter option. Use the selector option when possible.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^\/]+\/.+$/
Maximum number of HTTP connections per replication.
Possible values: 1 ≤ value ≤ 100
Default:
20
The replication document owner. The server sets an appropriate value if the field is unset when writing a replication document. Only administrators can modify the value to an owner other than themselves.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a map of string key value pairs, such as query parameters.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Number of times a replication request is retried. The requests are retried with a doubling exponential backoff starting at 0.25 seconds, with a cap at 5 minutes.
Possible values: 0 ≤ value ≤ 5000
Default:
5
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Start the replication at a specific sequence value.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Replication socket options.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a replication source or target database.
- source
Schema for replication source or target database authentication.
- auth
Schema for basic authentication of replication source or target database.
- basic
The password associated with the username.
Possible values: 16 ≤ length ≤ 7168, Value must match regular expression
/^[^\\n\\t]{16,}$/
Schema for a username.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
Schema for an IAM API key for replication database authentication.
- iam
IAM API key.
Possible values: 1 ≤ length ≤ 44, Value must match regular expression
/^[A-Za-z0-9_-]{2,}$/
Replication request headers.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Replication database URL.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators.
Address of a (http or socks5 protocol) proxy server through which replication with the source database should occur.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^http(s)?:\/\/.*$/
Schema for a replication source or target database.
- target
Schema for replication source or target database authentication.
- auth
Schema for basic authentication of replication source or target database.
- basic
The password associated with the username.
Possible values: 16 ≤ length ≤ 7168, Value must match regular expression
/^[^\\n\\t]{16,}$/
Schema for a username.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
Schema for an IAM API key for replication database authentication.
- iam
IAM API key.
Possible values: 1 ≤ length ≤ 44, Value must match regular expression
/^[A-Za-z0-9_-]{2,}$/
Replication request headers.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Replication database URL.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators.
Address of a (http or socks5 protocol) proxy server through which replication with the target database should occur.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^http(s)?:\/\/.*$/
Specify whether to use _bulk_get for fetching documents from the source. If unset, the server configured default will be used.
Specify if checkpoints should be saved during replication. Using checkpoints means a replication can be efficiently resumed.
Default:
true
Schema for the user context of a session.
- user_ctx
Database name in the context of the provided operation.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Name of user running the process.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
List of user roles.
Allowable values: [
_reader
,_writer
,_admin
,_replicator
,_db_updates
,_design
,_shards
,_security
]Possible values: number of items ≥ 0
Replicate only the winning revisions. Replication with this mode discards conflicting revisions. Replication IDs and checkpoints generated by this mode are different to those generated by default, so it is possible to first replicate the winning revisions then later backfill remaining revisions with a regular replication job.
Default:
false
Controls how many documents are processed. After each batch a checkpoint is written so this controls how frequently checkpointing occurs.
Possible values: 1 ≤ value ≤ 65535
Default:
500
Controls how many separate processes will read from the changes manager and write to the target. A higher number can improve throughput.
Possible values: 1 ≤ value ≤ 16
Default:
4
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]
Response
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
ok
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Status Code
HTTP response for Document modification operations.
HTTP response for Document modification operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for conflict.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for a document update conflict.
{ "error": "conflict", "reason": "Document update conflict." }
Example error response for a document update conflict.
{ "error": "conflict", "reason": "Document update conflict." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request with a document size that exceeds the allowable limit.
{ "error": "document_too_large", "reason": "doc_id" }
Example error response for a request with a document size that exceeds the allowable limit.
{ "error": "document_too_large", "reason": "doc_id" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Cancel a persistent replication
Cancels a replication by deleting the document that describes it from the _replicator
database.
Cancels a replication by deleting the document that describes it from the _replicator
database.
Cancels a replication by deleting the document that describes it from the _replicator
database.
Cancels a replication by deleting the document that describes it from the _replicator
database.
Cancels a replication by deleting the document that describes it from the _replicator
database.
DELETE /_replicator/{doc_id}
(cloudant *CloudantV1) DeleteReplicationDocument(deleteReplicationDocumentOptions *DeleteReplicationDocumentOptions) (result *DocumentResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) DeleteReplicationDocumentWithContext(ctx context.Context, deleteReplicationDocumentOptions *DeleteReplicationDocumentOptions) (result *DocumentResult, response *core.DetailedResponse, err error)
ServiceCall<DocumentResult> deleteReplicationDocument(DeleteReplicationDocumentOptions deleteReplicationDocumentOptions)
deleteReplicationDocument(params)
delete_replication_document(
self,
doc_id: str,
*,
if_match: Optional[str] = None,
batch: Optional[str] = None,
rev: Optional[str] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the DeleteReplicationDocumentOptions
struct and set the fields to provide parameter values for the DeleteReplicationDocument
method.
Use the DeleteReplicationDocumentOptions.Builder
to create a DeleteReplicationDocumentOptions
object that contains the parameter values for the deleteReplicationDocument
method.
Custom Headers
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
^"[A-Za-z0-9+\/]{2,24}={0,3}"$|^"[1-9]\d{0,9}-[\da-f]{32}"$|^"[0-9A-Z]{25}"$
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the ID of the stored replication configuration in the
_replicator
database.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Query Parameters
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The DeleteReplicationDocument options.
Path parameter to specify the ID of the stored replication configuration in the
_replicator
database.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
The deleteReplicationDocument options.
Path parameter to specify the ID of the stored replication configuration in the
_replicator
database.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
parameters
Path parameter to specify the ID of the stored replication configuration in the
_replicator
database.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
parameters
Path parameter to specify the ID of the stored replication configuration in the
_replicator
database.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X DELETE "$SERVICE_URL/_replicator/repldoc-example?rev=<document-revision>"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } deleteReplicationDocumentOptions := service.NewDeleteReplicationDocumentOptions( "repldoc-example", ) deleteReplicationDocumentOptions.SetRev("3-a0ccbdc6fe95b4184f9031d086034d85") documentResult, response, err := service.DeleteReplicationDocument(deleteReplicationDocumentOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(documentResult, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.DeleteReplicationDocumentOptions; import com.ibm.cloud.cloudant.v1.model.DocumentResult;
Cloudant service = Cloudant.newInstance(); DeleteReplicationDocumentOptions replicationDocOptions = new DeleteReplicationDocumentOptions.Builder() .docId("repldoc-example") .rev("3-a0ccbdc6fe95b4184f9031d086034d85") .build(); DocumentResult response = service.deleteReplicationDocument(replicationDocOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.deleteReplicationDocument({ docId: 'repldoc-example', rev: '3-a0ccbdc6fe95b4184f9031d086034d85' }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.delete_replication_document( doc_id='repldoc-example', rev='3-a0ccbdc6fe95b4184f9031d086034d85' ).get_result() print(response)
Response
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
ok
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Status Code
HTTP response for Document modification operations.
HTTP response for Document modification operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for conflict.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for a document update conflict.
{ "error": "conflict", "reason": "Document update conflict." }
Example error response for a document update conflict.
{ "error": "conflict", "reason": "Document update conflict." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve the configuration for a persistent replication
Retrieves a replication document from the _replicator
database to view the configuration of the replication. The status of the replication is no longer recorded in the document but can be checked via the replication scheduler.
Retrieves a replication document from the _replicator
database to view the configuration of the replication. The status of the replication is no longer recorded in the document but can be checked via the replication scheduler.
Retrieves a replication document from the _replicator
database to view the configuration of the replication. The status of the replication is no longer recorded in the document but can be checked via the replication scheduler.
Retrieves a replication document from the _replicator
database to view the configuration of the replication. The status of the replication is no longer recorded in the document but can be checked via the replication scheduler.
Retrieves a replication document from the _replicator
database to view the configuration of the replication. The status of the replication is no longer recorded in the document but can be checked via the replication scheduler.
GET /_replicator/{doc_id}
(cloudant *CloudantV1) GetReplicationDocument(getReplicationDocumentOptions *GetReplicationDocumentOptions) (result *ReplicationDocument, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) GetReplicationDocumentWithContext(ctx context.Context, getReplicationDocumentOptions *GetReplicationDocumentOptions) (result *ReplicationDocument, response *core.DetailedResponse, err error)
ServiceCall<ReplicationDocument> getReplicationDocument(GetReplicationDocumentOptions getReplicationDocumentOptions)
getReplicationDocument(params)
get_replication_document(
self,
doc_id: str,
*,
if_none_match: Optional[str] = None,
attachments: Optional[bool] = None,
att_encoding_info: Optional[bool] = None,
conflicts: Optional[bool] = None,
deleted_conflicts: Optional[bool] = None,
latest: Optional[bool] = None,
local_seq: Optional[bool] = None,
meta: Optional[bool] = None,
rev: Optional[str] = None,
revs: Optional[bool] = None,
revs_info: Optional[bool] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the GetReplicationDocumentOptions
struct and set the fields to provide parameter values for the GetReplicationDocument
method.
Use the GetReplicationDocumentOptions.Builder
to create a GetReplicationDocumentOptions
object that contains the parameter values for the getReplicationDocument
method.
Custom Headers
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
^"[A-Za-z0-9+\/]{2,24}={0,3}"$|^"[1-9]\d{0,9}-[\da-f]{32}"$|^"[0-9A-Z]{25}"$
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the ID of the stored replication configuration in the
_replicator
database.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Query Parameters
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to include attachments only since specified revisions. Note this does not include the attachments for the specified revisions.
Possible values: 1 ≤ number of items ≤ 4294967295, 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Examples:[ "1-99b02e08da151943c2dcb40090160bb8" ]
Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Query parameter to specify whether to include a list of deleted conflicted revisions in the
_deleted_conflicts
property of the returned document.Default:
false
Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
false
Query parameter to specify whether to include the last update sequence for the document.
Default:
false
Query parameter to specify whether to include document meta information. Acts the same as specifying all of the conflicts, deleted_conflicts and open_revs query parameters.
Default:
false
Query parameter to specify leaf revisions to retrieve. Additionally, it accepts a value of
all
to return all leaf revisions.Possible values: 1 ≤ number of items ≤ 4294967295, 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Query parameter to specify whether to include a list of all known document revisions.
Default:
false
Query parameter to specify whether to includes detailed information for all known document revisions.
Default:
false
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The GetReplicationDocument options.
Path parameter to specify the ID of the stored replication configuration in the
_replicator
database.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Query parameter to specify whether to include a list of deleted conflicted revisions in the
_deleted_conflicts
property of the returned document.Default:
false
Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
false
Query parameter to specify whether to include the last update sequence for the document.
Default:
false
Query parameter to specify whether to include document meta information. Acts the same as specifying all of the conflicts, deleted_conflicts and open_revs query parameters.
Default:
false
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Query parameter to specify whether to include a list of all known document revisions.
Default:
false
Query parameter to specify whether to includes detailed information for all known document revisions.
Default:
false
The getReplicationDocument options.
Path parameter to specify the ID of the stored replication configuration in the
_replicator
database.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Query parameter to specify whether to include a list of deleted conflicted revisions in the
_deleted_conflicts
property of the returned document.Default:
false
Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
false
Query parameter to specify whether to include the last update sequence for the document.
Default:
false
Query parameter to specify whether to include document meta information. Acts the same as specifying all of the conflicts, deleted_conflicts and open_revs query parameters.
Default:
false
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Query parameter to specify whether to include a list of all known document revisions.
Default:
false
Query parameter to specify whether to includes detailed information for all known document revisions.
Default:
false
parameters
Path parameter to specify the ID of the stored replication configuration in the
_replicator
database.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Query parameter to specify whether to include a list of deleted conflicted revisions in the
_deleted_conflicts
property of the returned document.Default:
false
Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
false
Query parameter to specify whether to include the last update sequence for the document.
Default:
false
Query parameter to specify whether to include document meta information. Acts the same as specifying all of the conflicts, deleted_conflicts and open_revs query parameters.
Default:
false
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Query parameter to specify whether to include a list of all known document revisions.
Default:
false
Query parameter to specify whether to includes detailed information for all known document revisions.
Default:
false
parameters
Path parameter to specify the ID of the stored replication configuration in the
_replicator
database.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Query parameter to specify whether to include a list of deleted conflicted revisions in the
_deleted_conflicts
property of the returned document.Default:
false
Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
false
Query parameter to specify whether to include the last update sequence for the document.
Default:
false
Query parameter to specify whether to include document meta information. Acts the same as specifying all of the conflicts, deleted_conflicts and open_revs query parameters.
Default:
false
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Query parameter to specify whether to include a list of all known document revisions.
Default:
false
Query parameter to specify whether to includes detailed information for all known document revisions.
Default:
false
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/_replicator/repldoc-example"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } getReplicationDocumentOptions := service.NewGetReplicationDocumentOptions( "repldoc-example", ) replicationDocument, response, err := service.GetReplicationDocument(getReplicationDocumentOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(replicationDocument, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.GetReplicationDocumentOptions; import com.ibm.cloud.cloudant.v1.model.ReplicationDocument;
Cloudant service = Cloudant.newInstance(); GetReplicationDocumentOptions replicationDocOptions = new GetReplicationDocumentOptions.Builder() .docId("repldoc-example") .build(); ReplicationDocument response = service.getReplicationDocument(replicationDocOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.getReplicationDocument({ docId: 'repldoc-example' }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.get_replication_document( doc_id='repldoc-example' ).get_result() print(response)
Response
Schema for a replication document. Note that selector
, doc_ids
, and filter
are incompatible with each other.
Schema for a replication source or target database.
Schema for a replication source or target database.
Schema for a map of attachment name to attachment metadata.
- _attachments
Schema for an attachment.
Schema for a list of document revision identifiers.
Possible values: 0 ≤ number of items ≤ 4294967295, 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Deletion flag. Available if document was removed
Schema for a list of document revision identifiers.
Possible values: 0 ≤ number of items ≤ 4294967295, 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Document's update sequence in current database. Available if requested with local_seq=true query parameter
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Schema for list of revision information.
Schema for a list of objects with information about local revisions and their status.
Possible values: 1 ≤ number of items ≤ 4294967295
Cancels the replication.
Defines replication checkpoint interval in milliseconds.
Possible values: 0 ≤ value ≤ 2147483647
HTTP connection timeout per replication. Even for very fast/reliable networks it might need to be increased if a remote database is too busy.
Possible values: 0 ≤ value ≤ 2147483647
Configure the replication to be continuous.
Creates the target database. Requires administrator privileges on target server.
Request parameters to use during target database creation.
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
The name of a filter function which is defined in a design document in the source database in {ddoc_id}/{filter} format. It determines which documents get replicated. Using the selector option provides performance benefits when compared with using the filter option. Use the selector option when possible.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^/]+/.+$
Maximum number of HTTP connections per replication.
Possible values: 1 ≤ value ≤ 100
The replication document owner. The server sets an appropriate value if the field is unset when writing a replication document. Only administrators can modify the value to an owner other than themselves.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Deprecated: see
source_proxy
andtarget_proxy
. Address of a (http or socks5 protocol) proxy server through which replication with the source and target databases should occur.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Schema for a map of string key value pairs, such as query parameters.
- query_params
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Number of times a replication request is retried. The requests are retried with a doubling exponential backoff starting at 0.25 seconds, with a cap at 5 minutes.
Possible values: 0 ≤ value ≤ 5000
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate
the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax
- selector
Start the replication at a specific sequence value.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Replication socket options.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators.
Address of a (http or socks5 protocol) proxy server through which replication with the source database should occur.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^http(s)?:\/\/.*$
This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators.
Address of a (http or socks5 protocol) proxy server through which replication with the target database should occur.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^http(s)?:\/\/.*$
Specify whether to use _bulk_get for fetching documents from the source. If unset, the server configured default will be used.
Specify if checkpoints should be saved during replication. Using checkpoints means a replication can be efficiently resumed.
Schema for the user context of a session.
Replicate only the winning revisions. Replication with this mode discards conflicting revisions. Replication IDs and checkpoints generated by this mode are different to those generated by default, so it is possible to first replicate the winning revisions then later backfill remaining revisions with a regular replication job.
Controls how many documents are processed. After each batch a checkpoint is written so this controls how frequently checkpointing occurs.
Possible values: 1 ≤ value ≤ 65535
Controls how many separate processes will read from the changes manager and write to the target. A higher number can improve throughput.
Possible values: 1 ≤ value ≤ 16
Schema for a replication document. Note that selector
, doc_ids
, and filter
are incompatible with each other.
Schema for a map of attachment name to attachment metadata.
- Attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- Revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- RevsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Cancels the replication.
Defines replication checkpoint interval in milliseconds.
Possible values: 0 ≤ value ≤ 2147483647
HTTP connection timeout per replication. Even for very fast/reliable networks it might need to be increased if a remote database is too busy.
Possible values: 0 ≤ value ≤ 2147483647
Configure the replication to be continuous.
Creates the target database. Requires administrator privileges on target server.
Request parameters to use during target database creation.
- CreateTargetParams
Schema for the number of replicas of a database in a cluster. The cluster is using the default value and it cannot be changed by the user.
Possible values: value = 3
Parameter to specify whether to enable database partitions when creating the target database.
Schema for the number of shards in a database. Each shard is a partition of the hash value range.
Possible values: 1 ≤ value ≤ 120
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
The name of a filter function which is defined in a design document in the source database in {ddoc_id}/{filter} format. It determines which documents get replicated. Using the selector option provides performance benefits when compared with using the filter option. Use the selector option when possible.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^\/]+\/.+$/
Maximum number of HTTP connections per replication.
Possible values: 1 ≤ value ≤ 100
The replication document owner. The server sets an appropriate value if the field is unset when writing a replication document. Only administrators can modify the value to an owner other than themselves.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a map of string key value pairs, such as query parameters.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Number of times a replication request is retried. The requests are retried with a doubling exponential backoff starting at 0.25 seconds, with a cap at 5 minutes.
Possible values: 0 ≤ value ≤ 5000
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Start the replication at a specific sequence value.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Replication socket options.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a replication source or target database.
- Source
Schema for replication source or target database authentication.
- Auth
Schema for basic authentication of replication source or target database.
- Basic
The password associated with the username.
Possible values: 16 ≤ length ≤ 7168, Value must match regular expression
/^[^\\n\\t]{16,}$/
Schema for a username.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
Schema for an IAM API key for replication database authentication.
- Iam
IAM API key.
Possible values: 1 ≤ length ≤ 44, Value must match regular expression
/^[A-Za-z0-9_-]{2,}$/
Replication request headers.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Replication database URL.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators.
Address of a (http or socks5 protocol) proxy server through which replication with the source database should occur.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^http(s)?:\/\/.*$/
Schema for a replication source or target database.
- Target
Schema for replication source or target database authentication.
- Auth
Schema for basic authentication of replication source or target database.
- Basic
The password associated with the username.
Possible values: 16 ≤ length ≤ 7168, Value must match regular expression
/^[^\\n\\t]{16,}$/
Schema for a username.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
Schema for an IAM API key for replication database authentication.
- Iam
IAM API key.
Possible values: 1 ≤ length ≤ 44, Value must match regular expression
/^[A-Za-z0-9_-]{2,}$/
Replication request headers.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Replication database URL.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators.
Address of a (http or socks5 protocol) proxy server through which replication with the target database should occur.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^http(s)?:\/\/.*$/
Specify whether to use _bulk_get for fetching documents from the source. If unset, the server configured default will be used.
Specify if checkpoints should be saved during replication. Using checkpoints means a replication can be efficiently resumed.
Schema for the user context of a session.
- UserCtx
Database name in the context of the provided operation.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Name of user running the process.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
List of user roles.
Possible values: [
_reader
,_writer
,_admin
,_replicator
,_db_updates
,_design
,_shards
,_security
]Possible values: number of items ≥ 0
Replicate only the winning revisions. Replication with this mode discards conflicting revisions. Replication IDs and checkpoints generated by this mode are different to those generated by default, so it is possible to first replicate the winning revisions then later backfill remaining revisions with a regular replication job.
Controls how many documents are processed. After each batch a checkpoint is written so this controls how frequently checkpointing occurs.
Possible values: 1 ≤ value ≤ 65535
Controls how many separate processes will read from the changes manager and write to the target. A higher number can improve throughput.
Possible values: 1 ≤ value ≤ 16
Schema for a replication document. Note that selector
, doc_ids
, and filter
are incompatible with each other.
Schema for a map of attachment name to attachment metadata.
- attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- revsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Cancels the replication.
Defines replication checkpoint interval in milliseconds.
Possible values: 0 ≤ value ≤ 2147483647
HTTP connection timeout per replication. Even for very fast/reliable networks it might need to be increased if a remote database is too busy.
Possible values: 0 ≤ value ≤ 2147483647
Configure the replication to be continuous.
Creates the target database. Requires administrator privileges on target server.
Request parameters to use during target database creation.
- createTargetParams
Schema for the number of replicas of a database in a cluster. The cluster is using the default value and it cannot be changed by the user.
Possible values: value = 3
Parameter to specify whether to enable database partitions when creating the target database.
Schema for the number of shards in a database. Each shard is a partition of the hash value range.
Possible values: 1 ≤ value ≤ 120
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
The name of a filter function which is defined in a design document in the source database in {ddoc_id}/{filter} format. It determines which documents get replicated. Using the selector option provides performance benefits when compared with using the filter option. Use the selector option when possible.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^\/]+\/.+$/
Maximum number of HTTP connections per replication.
Possible values: 1 ≤ value ≤ 100
The replication document owner. The server sets an appropriate value if the field is unset when writing a replication document. Only administrators can modify the value to an owner other than themselves.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a map of string key value pairs, such as query parameters.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Number of times a replication request is retried. The requests are retried with a doubling exponential backoff starting at 0.25 seconds, with a cap at 5 minutes.
Possible values: 0 ≤ value ≤ 5000
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Start the replication at a specific sequence value.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Replication socket options.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a replication source or target database.
- source
Schema for replication source or target database authentication.
- auth
Schema for basic authentication of replication source or target database.
- basic
The password associated with the username.
Possible values: 16 ≤ length ≤ 7168, Value must match regular expression
/^[^\\n\\t]{16,}$/
Schema for a username.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
Schema for an IAM API key for replication database authentication.
- iam
IAM API key.
Possible values: 1 ≤ length ≤ 44, Value must match regular expression
/^[A-Za-z0-9_-]{2,}$/
Replication request headers.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Replication database URL.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators.
Address of a (http or socks5 protocol) proxy server through which replication with the source database should occur.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^http(s)?:\/\/.*$/
Schema for a replication source or target database.
- target
Schema for replication source or target database authentication.
- auth
Schema for basic authentication of replication source or target database.
- basic
The password associated with the username.
Possible values: 16 ≤ length ≤ 7168, Value must match regular expression
/^[^\\n\\t]{16,}$/
Schema for a username.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
Schema for an IAM API key for replication database authentication.
- iam
IAM API key.
Possible values: 1 ≤ length ≤ 44, Value must match regular expression
/^[A-Za-z0-9_-]{2,}$/
Replication request headers.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Replication database URL.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators.
Address of a (http or socks5 protocol) proxy server through which replication with the target database should occur.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^http(s)?:\/\/.*$/
Specify whether to use _bulk_get for fetching documents from the source. If unset, the server configured default will be used.
Specify if checkpoints should be saved during replication. Using checkpoints means a replication can be efficiently resumed.
Schema for the user context of a session.
- userCtx
Database name in the context of the provided operation.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Name of user running the process.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
List of user roles.
Possible values: [
_reader
,_writer
,_admin
,_replicator
,_db_updates
,_design
,_shards
,_security
]Possible values: number of items ≥ 0
Replicate only the winning revisions. Replication with this mode discards conflicting revisions. Replication IDs and checkpoints generated by this mode are different to those generated by default, so it is possible to first replicate the winning revisions then later backfill remaining revisions with a regular replication job.
Controls how many documents are processed. After each batch a checkpoint is written so this controls how frequently checkpointing occurs.
Possible values: 1 ≤ value ≤ 65535
Controls how many separate processes will read from the changes manager and write to the target. A higher number can improve throughput.
Possible values: 1 ≤ value ≤ 16
Schema for a replication document. Note that selector
, doc_ids
, and filter
are incompatible with each other.
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Cancels the replication.
Defines replication checkpoint interval in milliseconds.
Possible values: 0 ≤ value ≤ 2147483647
HTTP connection timeout per replication. Even for very fast/reliable networks it might need to be increased if a remote database is too busy.
Possible values: 0 ≤ value ≤ 2147483647
Configure the replication to be continuous.
Creates the target database. Requires administrator privileges on target server.
Request parameters to use during target database creation.
- createTargetParams
Schema for the number of replicas of a database in a cluster. The cluster is using the default value and it cannot be changed by the user.
Possible values: value = 3
Parameter to specify whether to enable database partitions when creating the target database.
Schema for the number of shards in a database. Each shard is a partition of the hash value range.
Possible values: 1 ≤ value ≤ 120
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
The name of a filter function which is defined in a design document in the source database in {ddoc_id}/{filter} format. It determines which documents get replicated. Using the selector option provides performance benefits when compared with using the filter option. Use the selector option when possible.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^\/]+\/.+$/
Maximum number of HTTP connections per replication.
Possible values: 1 ≤ value ≤ 100
The replication document owner. The server sets an appropriate value if the field is unset when writing a replication document. Only administrators can modify the value to an owner other than themselves.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a map of string key value pairs, such as query parameters.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Number of times a replication request is retried. The requests are retried with a doubling exponential backoff starting at 0.25 seconds, with a cap at 5 minutes.
Possible values: 0 ≤ value ≤ 5000
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Start the replication at a specific sequence value.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Replication socket options.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a replication source or target database.
- source
Schema for replication source or target database authentication.
- auth
Schema for basic authentication of replication source or target database.
- basic
The password associated with the username.
Possible values: 16 ≤ length ≤ 7168, Value must match regular expression
/^[^\\n\\t]{16,}$/
Schema for a username.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
Schema for an IAM API key for replication database authentication.
- iam
IAM API key.
Possible values: 1 ≤ length ≤ 44, Value must match regular expression
/^[A-Za-z0-9_-]{2,}$/
Replication request headers.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Replication database URL.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators.
Address of a (http or socks5 protocol) proxy server through which replication with the source database should occur.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^http(s)?:\/\/.*$/
Schema for a replication source or target database.
- target
Schema for replication source or target database authentication.
- auth
Schema for basic authentication of replication source or target database.
- basic
The password associated with the username.
Possible values: 16 ≤ length ≤ 7168, Value must match regular expression
/^[^\\n\\t]{16,}$/
Schema for a username.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
Schema for an IAM API key for replication database authentication.
- iam
IAM API key.
Possible values: 1 ≤ length ≤ 44, Value must match regular expression
/^[A-Za-z0-9_-]{2,}$/
Replication request headers.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Replication database URL.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators.
Address of a (http or socks5 protocol) proxy server through which replication with the target database should occur.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^http(s)?:\/\/.*$/
Specify whether to use _bulk_get for fetching documents from the source. If unset, the server configured default will be used.
Specify if checkpoints should be saved during replication. Using checkpoints means a replication can be efficiently resumed.
Schema for the user context of a session.
- userCtx
Database name in the context of the provided operation.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Name of user running the process.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
List of user roles.
Possible values: [
_reader
,_writer
,_admin
,_replicator
,_db_updates
,_design
,_shards
,_security
]Possible values: number of items ≥ 0
Replicate only the winning revisions. Replication with this mode discards conflicting revisions. Replication IDs and checkpoints generated by this mode are different to those generated by default, so it is possible to first replicate the winning revisions then later backfill remaining revisions with a regular replication job.
Controls how many documents are processed. After each batch a checkpoint is written so this controls how frequently checkpointing occurs.
Possible values: 1 ≤ value ≤ 65535
Controls how many separate processes will read from the changes manager and write to the target. A higher number can improve throughput.
Possible values: 1 ≤ value ≤ 16
Schema for a replication document. Note that selector
, doc_ids
, and filter
are incompatible with each other.
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Cancels the replication.
Defines replication checkpoint interval in milliseconds.
Possible values: 0 ≤ value ≤ 2147483647
HTTP connection timeout per replication. Even for very fast/reliable networks it might need to be increased if a remote database is too busy.
Possible values: 0 ≤ value ≤ 2147483647
Configure the replication to be continuous.
Creates the target database. Requires administrator privileges on target server.
Request parameters to use during target database creation.
- create_target_params
Schema for the number of replicas of a database in a cluster. The cluster is using the default value and it cannot be changed by the user.
Possible values: value = 3
Parameter to specify whether to enable database partitions when creating the target database.
Schema for the number of shards in a database. Each shard is a partition of the hash value range.
Possible values: 1 ≤ value ≤ 120
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
The name of a filter function which is defined in a design document in the source database in {ddoc_id}/{filter} format. It determines which documents get replicated. Using the selector option provides performance benefits when compared with using the filter option. Use the selector option when possible.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^\/]+\/.+$/
Maximum number of HTTP connections per replication.
Possible values: 1 ≤ value ≤ 100
The replication document owner. The server sets an appropriate value if the field is unset when writing a replication document. Only administrators can modify the value to an owner other than themselves.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a map of string key value pairs, such as query parameters.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Number of times a replication request is retried. The requests are retried with a doubling exponential backoff starting at 0.25 seconds, with a cap at 5 minutes.
Possible values: 0 ≤ value ≤ 5000
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Start the replication at a specific sequence value.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Replication socket options.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a replication source or target database.
- source
Schema for replication source or target database authentication.
- auth
Schema for basic authentication of replication source or target database.
- basic
The password associated with the username.
Possible values: 16 ≤ length ≤ 7168, Value must match regular expression
/^[^\\n\\t]{16,}$/
Schema for a username.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
Schema for an IAM API key for replication database authentication.
- iam
IAM API key.
Possible values: 1 ≤ length ≤ 44, Value must match regular expression
/^[A-Za-z0-9_-]{2,}$/
Replication request headers.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Replication database URL.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators.
Address of a (http or socks5 protocol) proxy server through which replication with the source database should occur.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^http(s)?:\/\/.*$/
Schema for a replication source or target database.
- target
Schema for replication source or target database authentication.
- auth
Schema for basic authentication of replication source or target database.
- basic
The password associated with the username.
Possible values: 16 ≤ length ≤ 7168, Value must match regular expression
/^[^\\n\\t]{16,}$/
Schema for a username.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
Schema for an IAM API key for replication database authentication.
- iam
IAM API key.
Possible values: 1 ≤ length ≤ 44, Value must match regular expression
/^[A-Za-z0-9_-]{2,}$/
Replication request headers.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Replication database URL.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators.
Address of a (http or socks5 protocol) proxy server through which replication with the target database should occur.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^http(s)?:\/\/.*$/
Specify whether to use _bulk_get for fetching documents from the source. If unset, the server configured default will be used.
Specify if checkpoints should be saved during replication. Using checkpoints means a replication can be efficiently resumed.
Schema for the user context of a session.
- user_ctx
Database name in the context of the provided operation.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Name of user running the process.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
List of user roles.
Possible values: [
_reader
,_writer
,_admin
,_replicator
,_db_updates
,_design
,_shards
,_security
]Possible values: number of items ≥ 0
Replicate only the winning revisions. Replication with this mode discards conflicting revisions. Replication IDs and checkpoints generated by this mode are different to those generated by default, so it is possible to first replicate the winning revisions then later backfill remaining revisions with a regular replication job.
Controls how many documents are processed. After each batch a checkpoint is written so this controls how frequently checkpointing occurs.
Possible values: 1 ≤ value ≤ 65535
Controls how many separate processes will read from the changes manager and write to the target. A higher number can improve throughput.
Possible values: 1 ≤ value ≤ 16
Status Code
HTTP response for ReplicationDocument.
HTTP response for not modified client redirect.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example ReplicationDocument request.
{ "cancel": false, "checkpoint_interval": 4500, "connection_timeout": 15000, "continuous": true, "create_target": true, "create_target_params": { "q": 1 }, "doc_ids": [ "badger", "lemur", "llama" ], "filter": "ddoc/my_filter", "http_connections": 10, "retries_per_request": 3, "selector": { "_id": { "$regex": "docid" } }, "since_seq": "34-g1AAAAGjeJzLYWBgYMlgTmGQT0lKzi9KdU", "socket_options": "[{keepalive, true}, {nodelay, false}]", "source": { "url": "https://my-source-instance.cloudantnosqldb.appdomain.cloud.example/animaldb" }, "target": { "auth": { "iam": { "api_key": "iam_api_key" } }, "url": "https://my-target-instance.cloudantnosqldb.appdomain.cloud.example/animaldb-target" }, "use_checkpoints": false, "user_ctx": { "name": "john", "roles": [ "_replicator" ] }, "worker_batch_size": 400, "worker_processes": 3 }
Example ReplicationDocument request.
{ "cancel": false, "checkpoint_interval": 4500, "connection_timeout": 15000, "continuous": true, "create_target": true, "create_target_params": { "q": 1 }, "doc_ids": [ "badger", "lemur", "llama" ], "filter": "ddoc/my_filter", "http_connections": 10, "retries_per_request": 3, "selector": { "_id": { "$regex": "docid" } }, "since_seq": "34-g1AAAAGjeJzLYWBgYMlgTmGQT0lKzi9KdU", "socket_options": "[{keepalive, true}, {nodelay, false}]", "source": { "url": "https://my-source-instance.cloudantnosqldb.appdomain.cloud.example/animaldb" }, "target": { "auth": { "iam": { "api_key": "iam_api_key" } }, "url": "https://my-target-instance.cloudantnosqldb.appdomain.cloud.example/animaldb-target" }, "use_checkpoints": false, "user_ctx": { "name": "john", "roles": [ "_replicator" ] }, "worker_batch_size": 400, "worker_processes": 3 }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve the HTTP headers for a persistent replication
Retrieves the HTTP headers containing minimal amount of information about the specified replication document from the _replicator
database. The method supports the same query arguments as the GET /_replicator/{doc_id}
method, but only headers like content length and the revision (ETag header) are returned.
Retrieves the HTTP headers containing minimal amount of information about the specified replication document from the _replicator
database. The method supports the same query arguments as the GET /_replicator/{doc_id}
method, but only headers like content length and the revision (ETag header) are returned.
Retrieves the HTTP headers containing minimal amount of information about the specified replication document from the _replicator
database. The method supports the same query arguments as the GET /_replicator/{doc_id}
method, but only headers like content length and the revision (ETag header) are returned.
Retrieves the HTTP headers containing minimal amount of information about the specified replication document from the _replicator
database. The method supports the same query arguments as the GET /_replicator/{doc_id}
method, but only headers like content length and the revision (ETag header) are returned.
Retrieves the HTTP headers containing minimal amount of information about the specified replication document from the _replicator
database. The method supports the same query arguments as the GET /_replicator/{doc_id}
method, but only headers like content length and the revision (ETag header) are returned.
HEAD /_replicator/{doc_id}
(cloudant *CloudantV1) HeadReplicationDocument(headReplicationDocumentOptions *HeadReplicationDocumentOptions) (response *core.DetailedResponse, err error)
(cloudant *CloudantV1) HeadReplicationDocumentWithContext(ctx context.Context, headReplicationDocumentOptions *HeadReplicationDocumentOptions) (response *core.DetailedResponse, err error)
ServiceCall<Void> headReplicationDocument(HeadReplicationDocumentOptions headReplicationDocumentOptions)
headReplicationDocument(params)
head_replication_document(
self,
doc_id: str,
*,
if_none_match: Optional[str] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the HeadReplicationDocumentOptions
struct and set the fields to provide parameter values for the HeadReplicationDocument
method.
Use the HeadReplicationDocumentOptions.Builder
to create a HeadReplicationDocumentOptions
object that contains the parameter values for the headReplicationDocument
method.
Custom Headers
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
^"[A-Za-z0-9+\/]{2,24}={0,3}"$|^"[1-9]\d{0,9}-[\da-f]{32}"$|^"[0-9A-Z]{25}"$
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the ID of the stored replication configuration in the
_replicator
database.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The HeadReplicationDocument options.
Path parameter to specify the ID of the stored replication configuration in the
_replicator
database.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
The headReplicationDocument options.
Path parameter to specify the ID of the stored replication configuration in the
_replicator
database.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
parameters
Path parameter to specify the ID of the stored replication configuration in the
_replicator
database.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
parameters
Path parameter to specify the ID of the stored replication configuration in the
_replicator
database.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
curl -H "Authorization: Bearer $API_BEARER_TOKEN" --head "$SERVICE_URL/_replicator/repldoc-example"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } headReplicationDocumentOptions := service.NewHeadReplicationDocumentOptions( "repldoc-example", ) response, err := service.HeadReplicationDocument(headReplicationDocumentOptions) if err != nil { panic(err) } fmt.Println(response.StatusCode) fmt.Println(response.Headers["ETag"])
import com.ibm.cloud.sdk.core.http.Headers; import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.HeadReplicationDocumentOptions;
Cloudant service = Cloudant.newInstance(); HeadReplicationDocumentOptions replicationDocOptions = new HeadReplicationDocumentOptions.Builder() .docId("repldoc-example") .build(); int statusCode = service.headReplicationDocument(replicationDocOptions).execute().getStatusCode(); Headers headers = service.headReplicationDocument(replicationDocOptions).execute().getHeaders(); System.out.println(statusCode); System.out.println(headers.values("ETag"));
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.headReplicationDocument({ docId: 'repldoc-example' }).then(response => { console.log(response.status); console.log(response.headers['ETag']); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.head_replication_document( doc_id='repldoc-example' ) print(response.get_status_code()) print(response.get_headers()['ETag'])
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the ETag for a resource.
Examples:Double quoted base64 encoded attachment digest.
"MEHlNHhicVt9efOzyvsz0Q=="
Double quoted document revision identifier.
"2-240fc93fad07083c338c7e0ea55791b3"
Double quoted local document tag.
"6APCCGX4B76OFFD5972MSBFHD"
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for ReplicationDocument.
HTTP response for not modified client redirect.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Create or modify a persistent replication
Creates or modifies a document in the _replicator
database to start a new replication or to edit an existing replication.
Creates or modifies a document in the _replicator
database to start a new replication or to edit an existing replication.
Creates or modifies a document in the _replicator
database to start a new replication or to edit an existing replication.
Creates or modifies a document in the _replicator
database to start a new replication or to edit an existing replication.
Creates or modifies a document in the _replicator
database to start a new replication or to edit an existing replication.
PUT /_replicator/{doc_id}
(cloudant *CloudantV1) PutReplicationDocument(putReplicationDocumentOptions *PutReplicationDocumentOptions) (result *DocumentResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PutReplicationDocumentWithContext(ctx context.Context, putReplicationDocumentOptions *PutReplicationDocumentOptions) (result *DocumentResult, response *core.DetailedResponse, err error)
ServiceCall<DocumentResult> putReplicationDocument(PutReplicationDocumentOptions putReplicationDocumentOptions)
putReplicationDocument(params)
put_replication_document(
self,
doc_id: str,
replication_document: 'ReplicationDocument',
*,
if_match: Optional[str] = None,
batch: Optional[str] = None,
new_edits: Optional[bool] = None,
rev: Optional[str] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the PutReplicationDocumentOptions
struct and set the fields to provide parameter values for the PutReplicationDocument
method.
Use the PutReplicationDocumentOptions.Builder
to create a PutReplicationDocumentOptions
object that contains the parameter values for the putReplicationDocument
method.
Custom Headers
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
^"[A-Za-z0-9+\/]{2,24}={0,3}"$|^"[1-9]\d{0,9}-[\da-f]{32}"$|^"[0-9A-Z]{25}"$
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the ID of the stored replication configuration in the
_replicator
database.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Query Parameters
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]Query parameter to specify whether to prevent insertion of conflicting document revisions. If false, a well-formed _rev must be included in the document. False is used by the replicator to insert documents into the target database even if that leads to the creation of conflicts.
Avoid using this parameter, since this option applies document revisions without checking for conflicts, so it is very easy to accidentally end up with a large number of conflicts.
Default:
false
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
HTTP request body for replication operations.
Example ReplicationDocument request.
{
"cancel": false,
"checkpoint_interval": 4500,
"connection_timeout": 15000,
"continuous": true,
"create_target": true,
"create_target_params": {
"q": 1
},
"doc_ids": [
"badger",
"lemur",
"llama"
],
"filter": "ddoc/my_filter",
"http_connections": 10,
"retries_per_request": 3,
"selector": {
"_id": {
"$regex": "docid"
}
},
"since_seq": "34-g1AAAAGjeJzLYWBgYMlgTmGQT0lKzi9KdU",
"socket_options": "[{keepalive, true}, {nodelay, false}]",
"source": {
"url": "https://my-source-instance.cloudantnosqldb.appdomain.cloud.example/animaldb"
},
"target": {
"auth": {
"iam": {
"api_key": "iam_api_key"
}
},
"url": "https://my-target-instance.cloudantnosqldb.appdomain.cloud.example/animaldb-target"
},
"use_checkpoints": false,
"user_ctx": {
"name": "john",
"roles": [
"_replicator"
]
},
"worker_batch_size": 400,
"worker_processes": 3
}
Schema for a replication source or target database.
Schema for a replication source or target database.
Schema for a map of attachment name to attachment metadata.
- _attachments
Schema for an attachment.
Schema for a list of document revision identifiers.
Possible values: 0 ≤ number of items ≤ 4294967295, 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Deletion flag. Available if document was removed
Schema for a list of document revision identifiers.
Possible values: 0 ≤ number of items ≤ 4294967295, 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Document's update sequence in current database. Available if requested with local_seq=true query parameter
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Schema for list of revision information.
Schema for a list of objects with information about local revisions and their status.
Possible values: 1 ≤ number of items ≤ 4294967295
Cancels the replication.
Defines replication checkpoint interval in milliseconds.
Possible values: 0 ≤ value ≤ 2147483647
Default:
30000
HTTP connection timeout per replication. Even for very fast/reliable networks it might need to be increased if a remote database is too busy.
Possible values: 0 ≤ value ≤ 2147483647
Default:
30000
Configure the replication to be continuous.
Default:
false
Creates the target database. Requires administrator privileges on target server.
Default:
false
Request parameters to use during target database creation.
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
The name of a filter function which is defined in a design document in the source database in {ddoc_id}/{filter} format. It determines which documents get replicated. Using the selector option provides performance benefits when compared with using the filter option. Use the selector option when possible.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^/]+/.+$
Maximum number of HTTP connections per replication.
Possible values: 1 ≤ value ≤ 100
Default:
20
The replication document owner. The server sets an appropriate value if the field is unset when writing a replication document. Only administrators can modify the value to an owner other than themselves.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Deprecated: see
source_proxy
andtarget_proxy
. Address of a (http or socks5 protocol) proxy server through which replication with the source and target databases should occur.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Schema for a map of string key value pairs, such as query parameters.
- query_params
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Number of times a replication request is retried. The requests are retried with a doubling exponential backoff starting at 0.25 seconds, with a cap at 5 minutes.
Possible values: 0 ≤ value ≤ 5000
Default:
5
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate
the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax
- selector
Start the replication at a specific sequence value.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Replication socket options.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators.
Address of a (http or socks5 protocol) proxy server through which replication with the source database should occur.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^http(s)?:\/\/.*$
This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators.
Address of a (http or socks5 protocol) proxy server through which replication with the target database should occur.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^http(s)?:\/\/.*$
Specify whether to use _bulk_get for fetching documents from the source. If unset, the server configured default will be used.
Specify if checkpoints should be saved during replication. Using checkpoints means a replication can be efficiently resumed.
Default:
true
Schema for the user context of a session.
Replicate only the winning revisions. Replication with this mode discards conflicting revisions. Replication IDs and checkpoints generated by this mode are different to those generated by default, so it is possible to first replicate the winning revisions then later backfill remaining revisions with a regular replication job.
Default:
false
Controls how many documents are processed. After each batch a checkpoint is written so this controls how frequently checkpointing occurs.
Possible values: 1 ≤ value ≤ 65535
Default:
500
Controls how many separate processes will read from the changes manager and write to the target. A higher number can improve throughput.
Possible values: 1 ≤ value ≤ 16
Default:
4
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The PutReplicationDocument options.
Path parameter to specify the ID of the stored replication configuration in the
_replicator
database.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
HTTP request body for replication operations.
Examples:{ "cancel": false, "checkpoint_interval": 4500, "connection_timeout": 15000, "continuous": true, "create_target": true, "create_target_params": { "q": 1 }, "doc_ids": [ "badger", "lemur", "llama" ], "filter": "ddoc/my_filter", "http_connections": 10, "retries_per_request": 3, "selector": { "_id": { "$regex": "docid" } }, "since_seq": "34-g1AAAAGjeJzLYWBgYMlgTmGQT0lKzi9KdU", "socket_options": "[{keepalive, true}, {nodelay, false}]", "source": { "url": "https://my-source-instance.cloudantnosqldb.appdomain.cloud.example/animaldb" }, "target": { "auth": { "iam": { "api_key": "iam_api_key" } }, "url": "https://my-target-instance.cloudantnosqldb.appdomain.cloud.example/animaldb-target" }, "use_checkpoints": false, "user_ctx": { "name": "john", "roles": [ "_replicator" ] }, "worker_batch_size": 400, "worker_processes": 3 }
- ReplicationDocument
Schema for a map of attachment name to attachment metadata.
- Attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- Revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- RevsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Allowable values: [
available
,missing
,deleted
]
Cancels the replication.
Defines replication checkpoint interval in milliseconds.
Possible values: 0 ≤ value ≤ 2147483647
Default:
30000
HTTP connection timeout per replication. Even for very fast/reliable networks it might need to be increased if a remote database is too busy.
Possible values: 0 ≤ value ≤ 2147483647
Default:
30000
Configure the replication to be continuous.
Default:
false
Creates the target database. Requires administrator privileges on target server.
Default:
false
Request parameters to use during target database creation.
- CreateTargetParams
Schema for the number of replicas of a database in a cluster. The cluster is using the default value and it cannot be changed by the user.
Possible values: value = 3
Default:
3
Parameter to specify whether to enable database partitions when creating the target database.
Default:
false
Schema for the number of shards in a database. Each shard is a partition of the hash value range.
Possible values: 1 ≤ value ≤ 120
Default:
16
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
The name of a filter function which is defined in a design document in the source database in {ddoc_id}/{filter} format. It determines which documents get replicated. Using the selector option provides performance benefits when compared with using the filter option. Use the selector option when possible.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^\/]+\/.+$/
Maximum number of HTTP connections per replication.
Possible values: 1 ≤ value ≤ 100
Default:
20
The replication document owner. The server sets an appropriate value if the field is unset when writing a replication document. Only administrators can modify the value to an owner other than themselves.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a map of string key value pairs, such as query parameters.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Number of times a replication request is retried. The requests are retried with a doubling exponential backoff starting at 0.25 seconds, with a cap at 5 minutes.
Possible values: 0 ≤ value ≤ 5000
Default:
5
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Start the replication at a specific sequence value.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Replication socket options.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a replication source or target database.
- Source
Schema for replication source or target database authentication.
- Auth
Schema for basic authentication of replication source or target database.
- Basic
The password associated with the username.
Possible values: 16 ≤ length ≤ 7168, Value must match regular expression
/^[^\\n\\t]{16,}$/
Schema for a username.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
Schema for an IAM API key for replication database authentication.
- Iam
IAM API key.
Possible values: 1 ≤ length ≤ 44, Value must match regular expression
/^[A-Za-z0-9_-]{2,}$/
Replication request headers.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Replication database URL.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators.
Address of a (http or socks5 protocol) proxy server through which replication with the source database should occur.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^http(s)?:\/\/.*$/
Schema for a replication source or target database.
- Target
Schema for replication source or target database authentication.
- Auth
Schema for basic authentication of replication source or target database.
- Basic
The password associated with the username.
Possible values: 16 ≤ length ≤ 7168, Value must match regular expression
/^[^\\n\\t]{16,}$/
Schema for a username.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
Schema for an IAM API key for replication database authentication.
- Iam
IAM API key.
Possible values: 1 ≤ length ≤ 44, Value must match regular expression
/^[A-Za-z0-9_-]{2,}$/
Replication request headers.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Replication database URL.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators.
Address of a (http or socks5 protocol) proxy server through which replication with the target database should occur.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^http(s)?:\/\/.*$/
Specify whether to use _bulk_get for fetching documents from the source. If unset, the server configured default will be used.
Specify if checkpoints should be saved during replication. Using checkpoints means a replication can be efficiently resumed.
Default:
true
Schema for the user context of a session.
- UserCtx
Database name in the context of the provided operation.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Name of user running the process.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
List of user roles.
Allowable values: [
_reader
,_writer
,_admin
,_replicator
,_db_updates
,_design
,_shards
,_security
]Possible values: number of items ≥ 0
Replicate only the winning revisions. Replication with this mode discards conflicting revisions. Replication IDs and checkpoints generated by this mode are different to those generated by default, so it is possible to first replicate the winning revisions then later backfill remaining revisions with a regular replication job.
Default:
false
Controls how many documents are processed. After each batch a checkpoint is written so this controls how frequently checkpointing occurs.
Possible values: 1 ≤ value ≤ 65535
Default:
500
Controls how many separate processes will read from the changes manager and write to the target. A higher number can improve throughput.
Possible values: 1 ≤ value ≤ 16
Default:
4
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]Query parameter to specify whether to prevent insertion of conflicting document revisions. If false, a well-formed _rev must be included in the document. False is used by the replicator to insert documents into the target database even if that leads to the creation of conflicts.
Avoid using this parameter, since this option applies document revisions without checking for conflicts, so it is very easy to accidentally end up with a large number of conflicts.
Default:
false
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
The putReplicationDocument options.
Path parameter to specify the ID of the stored replication configuration in the
_replicator
database.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
HTTP request body for replication operations.
Examples:{ "cancel": false, "checkpoint_interval": 4500, "connection_timeout": 15000, "continuous": true, "create_target": true, "create_target_params": { "q": 1 }, "doc_ids": [ "badger", "lemur", "llama" ], "filter": "ddoc/my_filter", "http_connections": 10, "retries_per_request": 3, "selector": { "_id": { "$regex": "docid" } }, "since_seq": "34-g1AAAAGjeJzLYWBgYMlgTmGQT0lKzi9KdU", "socket_options": "[{keepalive, true}, {nodelay, false}]", "source": { "url": "https://my-source-instance.cloudantnosqldb.appdomain.cloud.example/animaldb" }, "target": { "auth": { "iam": { "api_key": "iam_api_key" } }, "url": "https://my-target-instance.cloudantnosqldb.appdomain.cloud.example/animaldb-target" }, "use_checkpoints": false, "user_ctx": { "name": "john", "roles": [ "_replicator" ] }, "worker_batch_size": 400, "worker_processes": 3 }
- replicationDocument
Schema for a map of attachment name to attachment metadata.
- attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- revsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Allowable values: [
available
,missing
,deleted
]
Cancels the replication.
Defines replication checkpoint interval in milliseconds.
Possible values: 0 ≤ value ≤ 2147483647
Default:
30000
HTTP connection timeout per replication. Even for very fast/reliable networks it might need to be increased if a remote database is too busy.
Possible values: 0 ≤ value ≤ 2147483647
Default:
30000
Configure the replication to be continuous.
Default:
false
Creates the target database. Requires administrator privileges on target server.
Default:
false
Request parameters to use during target database creation.
- createTargetParams
Schema for the number of replicas of a database in a cluster. The cluster is using the default value and it cannot be changed by the user.
Possible values: value = 3
Default:
3
Parameter to specify whether to enable database partitions when creating the target database.
Default:
false
Schema for the number of shards in a database. Each shard is a partition of the hash value range.
Possible values: 1 ≤ value ≤ 120
Default:
16
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
The name of a filter function which is defined in a design document in the source database in {ddoc_id}/{filter} format. It determines which documents get replicated. Using the selector option provides performance benefits when compared with using the filter option. Use the selector option when possible.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^\/]+\/.+$/
Maximum number of HTTP connections per replication.
Possible values: 1 ≤ value ≤ 100
Default:
20
The replication document owner. The server sets an appropriate value if the field is unset when writing a replication document. Only administrators can modify the value to an owner other than themselves.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a map of string key value pairs, such as query parameters.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Number of times a replication request is retried. The requests are retried with a doubling exponential backoff starting at 0.25 seconds, with a cap at 5 minutes.
Possible values: 0 ≤ value ≤ 5000
Default:
5
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Start the replication at a specific sequence value.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Replication socket options.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a replication source or target database.
- source
Schema for replication source or target database authentication.
- auth
Schema for basic authentication of replication source or target database.
- basic
The password associated with the username.
Possible values: 16 ≤ length ≤ 7168, Value must match regular expression
/^[^\\n\\t]{16,}$/
Schema for a username.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
Schema for an IAM API key for replication database authentication.
- iam
IAM API key.
Possible values: 1 ≤ length ≤ 44, Value must match regular expression
/^[A-Za-z0-9_-]{2,}$/
Replication request headers.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Replication database URL.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators.
Address of a (http or socks5 protocol) proxy server through which replication with the source database should occur.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^http(s)?:\/\/.*$/
Schema for a replication source or target database.
- target
Schema for replication source or target database authentication.
- auth
Schema for basic authentication of replication source or target database.
- basic
The password associated with the username.
Possible values: 16 ≤ length ≤ 7168, Value must match regular expression
/^[^\\n\\t]{16,}$/
Schema for a username.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
Schema for an IAM API key for replication database authentication.
- iam
IAM API key.
Possible values: 1 ≤ length ≤ 44, Value must match regular expression
/^[A-Za-z0-9_-]{2,}$/
Replication request headers.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Replication database URL.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators.
Address of a (http or socks5 protocol) proxy server through which replication with the target database should occur.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^http(s)?:\/\/.*$/
Specify whether to use _bulk_get for fetching documents from the source. If unset, the server configured default will be used.
Specify if checkpoints should be saved during replication. Using checkpoints means a replication can be efficiently resumed.
Default:
true
Schema for the user context of a session.
- userCtx
Database name in the context of the provided operation.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Name of user running the process.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
List of user roles.
Allowable values: [
_reader
,_writer
,_admin
,_replicator
,_db_updates
,_design
,_shards
,_security
]Possible values: number of items ≥ 0
Replicate only the winning revisions. Replication with this mode discards conflicting revisions. Replication IDs and checkpoints generated by this mode are different to those generated by default, so it is possible to first replicate the winning revisions then later backfill remaining revisions with a regular replication job.
Default:
false
Controls how many documents are processed. After each batch a checkpoint is written so this controls how frequently checkpointing occurs.
Possible values: 1 ≤ value ≤ 65535
Default:
500
Controls how many separate processes will read from the changes manager and write to the target. A higher number can improve throughput.
Possible values: 1 ≤ value ≤ 16
Default:
4
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]Query parameter to specify whether to prevent insertion of conflicting document revisions. If false, a well-formed _rev must be included in the document. False is used by the replicator to insert documents into the target database even if that leads to the creation of conflicts.
Avoid using this parameter, since this option applies document revisions without checking for conflicts, so it is very easy to accidentally end up with a large number of conflicts.
Default:
false
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
parameters
Path parameter to specify the ID of the stored replication configuration in the
_replicator
database.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Schema for a replication document. Note that
selector
,doc_ids
, andfilter
are incompatible with each other.- replicationDocument
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Allowable values: [
available
,missing
,deleted
]
Cancels the replication.
Defines replication checkpoint interval in milliseconds.
Possible values: 0 ≤ value ≤ 2147483647
Default:
30000
HTTP connection timeout per replication. Even for very fast/reliable networks it might need to be increased if a remote database is too busy.
Possible values: 0 ≤ value ≤ 2147483647
Default:
30000
Configure the replication to be continuous.
Default:
false
Creates the target database. Requires administrator privileges on target server.
Default:
false
Request parameters to use during target database creation.
- createTargetParams
Schema for the number of replicas of a database in a cluster. The cluster is using the default value and it cannot be changed by the user.
Possible values: value = 3
Default:
3
Parameter to specify whether to enable database partitions when creating the target database.
Default:
false
Schema for the number of shards in a database. Each shard is a partition of the hash value range.
Possible values: 1 ≤ value ≤ 120
Default:
16
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
The name of a filter function which is defined in a design document in the source database in {ddoc_id}/{filter} format. It determines which documents get replicated. Using the selector option provides performance benefits when compared with using the filter option. Use the selector option when possible.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^\/]+\/.+$/
Maximum number of HTTP connections per replication.
Possible values: 1 ≤ value ≤ 100
Default:
20
The replication document owner. The server sets an appropriate value if the field is unset when writing a replication document. Only administrators can modify the value to an owner other than themselves.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a map of string key value pairs, such as query parameters.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Number of times a replication request is retried. The requests are retried with a doubling exponential backoff starting at 0.25 seconds, with a cap at 5 minutes.
Possible values: 0 ≤ value ≤ 5000
Default:
5
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Start the replication at a specific sequence value.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Replication socket options.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a replication source or target database.
- source
Schema for replication source or target database authentication.
- auth
Schema for basic authentication of replication source or target database.
- basic
The password associated with the username.
Possible values: 16 ≤ length ≤ 7168, Value must match regular expression
/^[^\\n\\t]{16,}$/
Schema for a username.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
Schema for an IAM API key for replication database authentication.
- iam
IAM API key.
Possible values: 1 ≤ length ≤ 44, Value must match regular expression
/^[A-Za-z0-9_-]{2,}$/
Replication request headers.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Replication database URL.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators.
Address of a (http or socks5 protocol) proxy server through which replication with the source database should occur.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^http(s)?:\/\/.*$/
Schema for a replication source or target database.
- target
Schema for replication source or target database authentication.
- auth
Schema for basic authentication of replication source or target database.
- basic
The password associated with the username.
Possible values: 16 ≤ length ≤ 7168, Value must match regular expression
/^[^\\n\\t]{16,}$/
Schema for a username.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
Schema for an IAM API key for replication database authentication.
- iam
IAM API key.
Possible values: 1 ≤ length ≤ 44, Value must match regular expression
/^[A-Za-z0-9_-]{2,}$/
Replication request headers.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Replication database URL.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators.
Address of a (http or socks5 protocol) proxy server through which replication with the target database should occur.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^http(s)?:\/\/.*$/
Specify whether to use _bulk_get for fetching documents from the source. If unset, the server configured default will be used.
Specify if checkpoints should be saved during replication. Using checkpoints means a replication can be efficiently resumed.
Default:
true
Schema for the user context of a session.
- userCtx
Database name in the context of the provided operation.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Name of user running the process.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
List of user roles.
Allowable values: [
_reader
,_writer
,_admin
,_replicator
,_db_updates
,_design
,_shards
,_security
]Possible values: number of items ≥ 0
Replicate only the winning revisions. Replication with this mode discards conflicting revisions. Replication IDs and checkpoints generated by this mode are different to those generated by default, so it is possible to first replicate the winning revisions then later backfill remaining revisions with a regular replication job.
Default:
false
Controls how many documents are processed. After each batch a checkpoint is written so this controls how frequently checkpointing occurs.
Possible values: 1 ≤ value ≤ 65535
Default:
500
Controls how many separate processes will read from the changes manager and write to the target. A higher number can improve throughput.
Possible values: 1 ≤ value ≤ 16
Default:
4
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]Query parameter to specify whether to prevent insertion of conflicting document revisions. If false, a well-formed _rev must be included in the document. False is used by the replicator to insert documents into the target database even if that leads to the creation of conflicts.
Avoid using this parameter, since this option applies document revisions without checking for conflicts, so it is very easy to accidentally end up with a large number of conflicts.
Default:
false
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
parameters
Path parameter to specify the ID of the stored replication configuration in the
_replicator
database.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Schema for a replication document. Note that
selector
,doc_ids
, andfilter
are incompatible with each other.- replication_document
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Allowable values: [
available
,missing
,deleted
]
Cancels the replication.
Defines replication checkpoint interval in milliseconds.
Possible values: 0 ≤ value ≤ 2147483647
Default:
30000
HTTP connection timeout per replication. Even for very fast/reliable networks it might need to be increased if a remote database is too busy.
Possible values: 0 ≤ value ≤ 2147483647
Default:
30000
Configure the replication to be continuous.
Default:
false
Creates the target database. Requires administrator privileges on target server.
Default:
false
Request parameters to use during target database creation.
- create_target_params
Schema for the number of replicas of a database in a cluster. The cluster is using the default value and it cannot be changed by the user.
Possible values: value = 3
Default:
3
Parameter to specify whether to enable database partitions when creating the target database.
Default:
false
Schema for the number of shards in a database. Each shard is a partition of the hash value range.
Possible values: 1 ≤ value ≤ 120
Default:
16
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
The name of a filter function which is defined in a design document in the source database in {ddoc_id}/{filter} format. It determines which documents get replicated. Using the selector option provides performance benefits when compared with using the filter option. Use the selector option when possible.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^\/]+\/.+$/
Maximum number of HTTP connections per replication.
Possible values: 1 ≤ value ≤ 100
Default:
20
The replication document owner. The server sets an appropriate value if the field is unset when writing a replication document. Only administrators can modify the value to an owner other than themselves.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a map of string key value pairs, such as query parameters.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Number of times a replication request is retried. The requests are retried with a doubling exponential backoff starting at 0.25 seconds, with a cap at 5 minutes.
Possible values: 0 ≤ value ≤ 5000
Default:
5
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.
The selector object must:
- Be structured as valid JSON.
- Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.
Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.
Operators are identified by the use of a dollar sign
$
prefix in the name field.There are two core types of operators in the selector syntax:
- Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
- Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic
$eq
operator matches when the specified field contains a value that is equal to the supplied argument.
It is important for query performance to use appropriate selectors:
- Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. - Some operators such as
$not
,$or
,$in
, and$regex
cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.
See the Cloudant Docsfor a list of all available combination and conditional operators.
For further reference see selector syntax.
Start the replication at a specific sequence value.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Replication socket options.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a replication source or target database.
- source
Schema for replication source or target database authentication.
- auth
Schema for basic authentication of replication source or target database.
- basic
The password associated with the username.
Possible values: 16 ≤ length ≤ 7168, Value must match regular expression
/^[^\\n\\t]{16,}$/
Schema for a username.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
Schema for an IAM API key for replication database authentication.
- iam
IAM API key.
Possible values: 1 ≤ length ≤ 44, Value must match regular expression
/^[A-Za-z0-9_-]{2,}$/
Replication request headers.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Replication database URL.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators.
Address of a (http or socks5 protocol) proxy server through which replication with the source database should occur.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^http(s)?:\/\/.*$/
Schema for a replication source or target database.
- target
Schema for replication source or target database authentication.
- auth
Schema for basic authentication of replication source or target database.
- basic
The password associated with the username.
Possible values: 16 ≤ length ≤ 7168, Value must match regular expression
/^[^\\n\\t]{16,}$/
Schema for a username.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
Schema for an IAM API key for replication database authentication.
- iam
IAM API key.
Possible values: 1 ≤ length ≤ 44, Value must match regular expression
/^[A-Za-z0-9_-]{2,}$/
Replication request headers.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Replication database URL.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators.
Address of a (http or socks5 protocol) proxy server through which replication with the target database should occur.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^http(s)?:\/\/.*$/
Specify whether to use _bulk_get for fetching documents from the source. If unset, the server configured default will be used.
Specify if checkpoints should be saved during replication. Using checkpoints means a replication can be efficiently resumed.
Default:
true
Schema for the user context of a session.
- user_ctx
Database name in the context of the provided operation.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Name of user running the process.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
List of user roles.
Allowable values: [
_reader
,_writer
,_admin
,_replicator
,_db_updates
,_design
,_shards
,_security
]Possible values: number of items ≥ 0
Replicate only the winning revisions. Replication with this mode discards conflicting revisions. Replication IDs and checkpoints generated by this mode are different to those generated by default, so it is possible to first replicate the winning revisions then later backfill remaining revisions with a regular replication job.
Default:
false
Controls how many documents are processed. After each batch a checkpoint is written so this controls how frequently checkpointing occurs.
Possible values: 1 ≤ value ≤ 65535
Default:
500
Controls how many separate processes will read from the changes manager and write to the target. A higher number can improve throughput.
Possible values: 1 ≤ value ≤ 16
Default:
4
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]Query parameter to specify whether to prevent insertion of conflicting document revisions. If false, a well-formed _rev must be included in the document. False is used by the replicator to insert documents into the target database even if that leads to the creation of conflicts.
Avoid using this parameter, since this option applies document revisions without checking for conflicts, so it is very easy to accidentally end up with a large number of conflicts.
Default:
false
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X PUT "$SERVICE_URL/_replicator/repldoc-example" -H "Content-Type: application/json" --data '{ "_id": "repldoc-example", "create_target": true, "source": { "url": "'"$SOURCE_SERVICE_URL/animaldb"'" }, "target": { "auth": { "iam": { "api_key": "'"$API_KEY"'" } }, "url": "'"$TARGET_SERVICE_URL/animaldb-target"'" } }'
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" "github.com/IBM/go-sdk-core/v5/core" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } source, err := service.NewReplicationDatabase( "<your-source-service-url>/animaldb", ) if err != nil { panic(err) } target, err := service.NewReplicationDatabase( "<your-target-service-url>/animaldb-target", ) if err != nil { panic(err) } auth, err := service.NewReplicationDatabaseAuthIam( "<your-iam-api-key>", ) if err != nil { panic(err) } target.Auth = &cloudantv1.ReplicationDatabaseAuth{Iam: auth} replicationDoc, err := service.NewReplicationDocument( source, target, ) if err != nil { panic(err) } replicationDoc.CreateTarget = core.BoolPtr(true) putReplicationDocumentOptions := service.NewPutReplicationDocumentOptions( "repldoc-example", replicationDoc, ) documentResult, response, err := service.PutReplicationDocument(putReplicationDocumentOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(documentResult, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.DocumentResult; import com.ibm.cloud.cloudant.v1.model.PutReplicationDocumentOptions; import com.ibm.cloud.cloudant.v1.model.ReplicationDatabase; import com.ibm.cloud.cloudant.v1.model.ReplicationDatabaseAuth; import com.ibm.cloud.cloudant.v1.model.ReplicationDatabaseAuthIam; import com.ibm.cloud.cloudant.v1.model.ReplicationDocument;
Cloudant service = Cloudant.newInstance(); ReplicationDatabase sourceDb = new ReplicationDatabase.Builder() .url("<your-source-service-url>/animaldb") .build(); ReplicationDatabaseAuthIam targetAuthIam = new ReplicationDatabaseAuthIam.Builder() .apiKey("<your-iam-api-key>") .build(); ReplicationDatabaseAuth targetAuth = new ReplicationDatabaseAuth.Builder() .iam(targetAuthIam) .build(); ReplicationDatabase targetDb = new ReplicationDatabase.Builder() .auth(targetAuth) .url("<your-target-service-url>/animaldb-target") .build(); ReplicationDocument replDocument = new ReplicationDocument(); replDocument.setCreateTarget(true); replDocument.setSource(sourceDb); replDocument.setTarget(targetDb); PutReplicationDocumentOptions replicationDocumentOptions = new PutReplicationDocumentOptions.Builder() .docId("repldoc-example") .replicationDocument(replDocument) .build(); DocumentResult response = service.putReplicationDocument(replicationDocumentOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); const sourceDb: CloudantV1.ReplicationDatabase = { url: '<your-source-service-url>/animaldb' }; const targetDb: CloudantV1.ReplicationDatabase = { auth: { iam: { 'apiKey': '<your-iam-api-key>' } }, url: '<your-target-service-url>/animaldb-target' }; const replDocument: CloudantV1.ReplicationDocument = { id: 'repldoc-example', createTarget: true, source: sourceDb, target: targetDb } service.putReplicationDocument({ docId: 'repldoc-example', replicationDocument: replDocument }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1, ReplicationDocument, ReplicationDatabase, ReplicationDatabaseAuthIam, ReplicationDatabaseAuth service = CloudantV1.new_instance() source_db = ReplicationDatabase( url='<your-source-service-url>/animaldb' ) target_auth_iam = ReplicationDatabaseAuthIam( api_key='<your-iam-api-key>' ) target_auth = ReplicationDatabaseAuth( iam=target_auth_iam ) target_db = ReplicationDatabase( auth=target_auth, url='<your-target-service-url>/animaldb-target' ) replication_document = ReplicationDocument( _id='repldoc-example', create_target=True, source=source_db, target=target_db ) response = service.put_replication_document( doc_id='repldoc-example', replication_document=replication_document ).get_result() print(response)
Response
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
ok
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Status Code
HTTP response for Document modification operations.
HTTP response for Document modification operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for conflict.
HTTP error for gone.
HTTP error for precondition failed.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for a document update conflict.
{ "error": "conflict", "reason": "Document update conflict." }
Example error response for a document update conflict.
{ "error": "conflict", "reason": "Document update conflict." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a database already existing.
{ "error": "file_exists", "reason": "The database could not be created, the file already exists." }
Example error response for a database already existing.
{ "error": "file_exists", "reason": "The database could not be created, the file already exists." }
Example error response for a request with a document size that exceeds the allowable limit.
{ "error": "document_too_large", "reason": "doc_id" }
Example error response for a request with a document size that exceeds the allowable limit.
{ "error": "document_too_large", "reason": "doc_id" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve replication scheduler documents
Lists replication documents, including information about all documents, even the ones in a completed or failed state. For each document, the endpoint returns the document ID, database, replication ID, source and target, and other information.
Lists replication documents, including information about all documents, even the ones in a completed or failed state. For each document, the endpoint returns the document ID, database, replication ID, source and target, and other information.
Lists replication documents, including information about all documents, even the ones in a completed or failed state. For each document, the endpoint returns the document ID, database, replication ID, source and target, and other information.
Lists replication documents, including information about all documents, even the ones in a completed or failed state. For each document, the endpoint returns the document ID, database, replication ID, source and target, and other information.
Lists replication documents, including information about all documents, even the ones in a completed or failed state. For each document, the endpoint returns the document ID, database, replication ID, source and target, and other information.
GET /_scheduler/docs
(cloudant *CloudantV1) GetSchedulerDocs(getSchedulerDocsOptions *GetSchedulerDocsOptions) (result *SchedulerDocsResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) GetSchedulerDocsWithContext(ctx context.Context, getSchedulerDocsOptions *GetSchedulerDocsOptions) (result *SchedulerDocsResult, response *core.DetailedResponse, err error)
ServiceCall<SchedulerDocsResult> getSchedulerDocs(GetSchedulerDocsOptions getSchedulerDocsOptions)
getSchedulerDocs(params)
get_scheduler_docs(
self,
*,
limit: Optional[int] = None,
skip: Optional[int] = None,
states: Optional[List[str]] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the GetSchedulerDocsOptions
struct and set the fields to provide parameter values for the GetSchedulerDocs
method.
Use the GetSchedulerDocsOptions.Builder
to create a GetSchedulerDocsOptions
object that contains the parameter values for the getSchedulerDocs
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Query Parameters
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Query parameter to include only replication documents in the specified states. String must be a comma-delimited string.
Allowable values: [
initializing
,error
,pending
,running
,crashing
,completed
,failed
]Possible values: 1 ≤ number of items ≤ 7
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The GetSchedulerDocs options.
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Query parameter to include only replication documents in the specified states. String must be a comma-delimited string.
Allowable values: [
initializing
,error
,pending
,running
,crashing
,completed
,failed
]Possible values: 1 ≤ number of items ≤ 7
The getSchedulerDocs options.
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Query parameter to include only replication documents in the specified states. String must be a comma-delimited string.
Allowable values: [
initializing
,error
,pending
,running
,crashing
,completed
,failed
]Possible values: 1 ≤ number of items ≤ 7
parameters
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Query parameter to include only replication documents in the specified states. String must be a comma-delimited string.
Allowable values: [
initializing
,error
,pending
,running
,crashing
,completed
,failed
]Possible values: 1 ≤ number of items ≤ 7
parameters
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Query parameter to include only replication documents in the specified states. String must be a comma-delimited string.
Allowable values: [
initializing
,error
,pending
,running
,crashing
,completed
,failed
]Possible values: 1 ≤ number of items ≤ 7
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/_scheduler/docs?limit=100&states=completed"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } getSchedulerDocsOptions := service.NewGetSchedulerDocsOptions() getSchedulerDocsOptions.SetLimit(100) getSchedulerDocsOptions.SetStates([]string{"completed"}) schedulerDocsResult, response, err := service.GetSchedulerDocs(getSchedulerDocsOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(schedulerDocsResult, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.GetSchedulerDocsOptions; import com.ibm.cloud.cloudant.v1.model.SchedulerDocsResult; import java.util.Arrays;
Cloudant service = Cloudant.newInstance(); GetSchedulerDocsOptions schedulerDocsOptions = new GetSchedulerDocsOptions.Builder() .limit(100) .states(Arrays.asList("completed")) .build(); SchedulerDocsResult response = service.getSchedulerDocs(schedulerDocsOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.getSchedulerDocs({ limit: 100, states: ['completed'] }).then(response => { console.log(response.result); })
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.get_scheduler_docs( limit=100, states=['completed'] ).get_result() print(response)
Response
Schema for a listing of replication scheduler documents.
Offset where the list started.
Possible values: 0 ≤ value ≤ 9007199254740992
Total number of replication scheduler documents.
Possible values: 0 ≤ value ≤ 4294967295
Array of replication scheduler doc objects.
Possible values: 0 ≤ number of items ≤ 4294967295
Schema for a listing of replication scheduler documents.
Total number of replication scheduler documents.
Possible values: 0 ≤ value ≤ 4294967295
Array of replication scheduler doc objects.
Possible values: number of items ≥ 0
- Docs
Database where replication document came from.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Replication document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Consecutive errors count. Indicates how many times in a row this replication has crashed. Replication will be retried with an exponential backoff based on this number. As soon as the replication succeeds this count is reset to 0. To can be used to get an idea why a particular replication is not making progress.
Possible values: 0 ≤ value ≤ 9007199254740992
Replication ID, or null if state is completed or failed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for scheduler document information. A JSON object that may contain additional information about the state. For error states this will contain an error field and string value.
- Info
The count of changes not yet replicated.
Possible values: 0 ≤ value ≤ 9007199254740992
The source sequence id which was last successfully replicated.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
The count of docs which failed to be written to the target.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of docs which have been read from the source.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of docs which have been written to the target.
Possible values: 0 ≤ value ≤ 9007199254740992
Replication error message.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The count of revisions which were found on the source, but missing from the target.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of revisions which have been checked since this replication began.
Possible values: 0 ≤ value ≤ 9007199254740992
The last sequence number obtained from the source database changes feed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
The last sequence number processed by the replicator.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Timestamp of last state update.
Cluster node where the job is running.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^.+$/
Replication source.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
Forbidden in IBM Cloudant mediated replications.
Address of the (http or socks5 protocol) proxy server through which replication with the source database occurs.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Timestamp of when the replication was started.
Schema for replication state.
Possible values: [
initializing
,error
,pending
,running
,crashing
,completed
,failed
]Replication target.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
Forbidden in IBM Cloudant mediated replications.
Address of the (http or socks5 protocol) proxy server through which replication with the target database occurs.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a listing of replication scheduler documents.
Total number of replication scheduler documents.
Possible values: 0 ≤ value ≤ 4294967295
Array of replication scheduler doc objects.
Possible values: number of items ≥ 0
- docs
Database where replication document came from.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Replication document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Consecutive errors count. Indicates how many times in a row this replication has crashed. Replication will be retried with an exponential backoff based on this number. As soon as the replication succeeds this count is reset to 0. To can be used to get an idea why a particular replication is not making progress.
Possible values: 0 ≤ value ≤ 9007199254740992
Replication ID, or null if state is completed or failed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for scheduler document information. A JSON object that may contain additional information about the state. For error states this will contain an error field and string value.
- info
The count of changes not yet replicated.
Possible values: 0 ≤ value ≤ 9007199254740992
The source sequence id which was last successfully replicated.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
The count of docs which failed to be written to the target.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of docs which have been read from the source.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of docs which have been written to the target.
Possible values: 0 ≤ value ≤ 9007199254740992
Replication error message.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The count of revisions which were found on the source, but missing from the target.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of revisions which have been checked since this replication began.
Possible values: 0 ≤ value ≤ 9007199254740992
The last sequence number obtained from the source database changes feed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
The last sequence number processed by the replicator.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Timestamp of last state update.
Cluster node where the job is running.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^.+$/
Replication source.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
Forbidden in IBM Cloudant mediated replications.
Address of the (http or socks5 protocol) proxy server through which replication with the source database occurs.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Timestamp of when the replication was started.
Schema for replication state.
Possible values: [
initializing
,error
,pending
,running
,crashing
,completed
,failed
]Replication target.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
Forbidden in IBM Cloudant mediated replications.
Address of the (http or socks5 protocol) proxy server through which replication with the target database occurs.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a listing of replication scheduler documents.
Total number of replication scheduler documents.
Possible values: 0 ≤ value ≤ 4294967295
Array of replication scheduler doc objects.
Possible values: number of items ≥ 0
- docs
Database where replication document came from.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Replication document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Consecutive errors count. Indicates how many times in a row this replication has crashed. Replication will be retried with an exponential backoff based on this number. As soon as the replication succeeds this count is reset to 0. To can be used to get an idea why a particular replication is not making progress.
Possible values: 0 ≤ value ≤ 9007199254740992
Replication ID, or null if state is completed or failed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for scheduler document information. A JSON object that may contain additional information about the state. For error states this will contain an error field and string value.
- info
The count of changes not yet replicated.
Possible values: 0 ≤ value ≤ 9007199254740992
The source sequence id which was last successfully replicated.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
The count of docs which failed to be written to the target.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of docs which have been read from the source.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of docs which have been written to the target.
Possible values: 0 ≤ value ≤ 9007199254740992
Replication error message.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The count of revisions which were found on the source, but missing from the target.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of revisions which have been checked since this replication began.
Possible values: 0 ≤ value ≤ 9007199254740992
The last sequence number obtained from the source database changes feed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
The last sequence number processed by the replicator.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Timestamp of last state update.
Cluster node where the job is running.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^.+$/
Replication source.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
Forbidden in IBM Cloudant mediated replications.
Address of the (http or socks5 protocol) proxy server through which replication with the source database occurs.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Timestamp of when the replication was started.
Schema for replication state.
Possible values: [
initializing
,error
,pending
,running
,crashing
,completed
,failed
]Replication target.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
Forbidden in IBM Cloudant mediated replications.
Address of the (http or socks5 protocol) proxy server through which replication with the target database occurs.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a listing of replication scheduler documents.
Total number of replication scheduler documents.
Possible values: 0 ≤ value ≤ 4294967295
Array of replication scheduler doc objects.
Possible values: number of items ≥ 0
- docs
Database where replication document came from.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Replication document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Consecutive errors count. Indicates how many times in a row this replication has crashed. Replication will be retried with an exponential backoff based on this number. As soon as the replication succeeds this count is reset to 0. To can be used to get an idea why a particular replication is not making progress.
Possible values: 0 ≤ value ≤ 9007199254740992
Replication ID, or null if state is completed or failed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for scheduler document information. A JSON object that may contain additional information about the state. For error states this will contain an error field and string value.
- info
The count of changes not yet replicated.
Possible values: 0 ≤ value ≤ 9007199254740992
The source sequence id which was last successfully replicated.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
The count of docs which failed to be written to the target.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of docs which have been read from the source.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of docs which have been written to the target.
Possible values: 0 ≤ value ≤ 9007199254740992
Replication error message.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The count of revisions which were found on the source, but missing from the target.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of revisions which have been checked since this replication began.
Possible values: 0 ≤ value ≤ 9007199254740992
The last sequence number obtained from the source database changes feed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
The last sequence number processed by the replicator.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Timestamp of last state update.
Cluster node where the job is running.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^.+$/
Replication source.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
Forbidden in IBM Cloudant mediated replications.
Address of the (http or socks5 protocol) proxy server through which replication with the source database occurs.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Timestamp of when the replication was started.
Schema for replication state.
Possible values: [
initializing
,error
,pending
,running
,crashing
,completed
,failed
]Replication target.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
Forbidden in IBM Cloudant mediated replications.
Address of the (http or socks5 protocol) proxy server through which replication with the target database occurs.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Status Code
HTTP response for
/_scheduler/docs
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example SchedulerDocsResult response.
{ "docs": [ { "database": "_replicator", "doc_id": "repldoc-example", "error_count": 0, "id": null, "info": { "changes_pending": null, "checkpointed_source_seq": "14-g1AAAAGjeJzLYWBgYMlgTmGQT0lKzi9KdUhJMtFLykxPyilN1UvOyS9NScwr0ctLLckBKmRKZEiy____f1YGcyJrLlCAPS3RKM0wOZWwdlQrDHFbkeQAJJPqobYwgm2xMDIzTUuxJGwCqi2muG3JYwGSDA1ACmjRfoR_Uo2NUxOTzQmbQrR_IDYdgNgE9hMz2CZLc9MkC4tkwqZkAQCT-Yfn", "doc_write_failures": 0, "docs_read": 15, "docs_written": 15, "missing_revisions_found": 15, "revisions_checked": 15 }, "last_updated": "2020-06-04T20:05:30Z", "source": "https://my-source-instance.cloudantnosqldb.appdomain.cloud.example/animaldb/", "start_time": "2020-06-04T20:05:24Z", "state": "completed", "target": "https://my-target-instance.cloudantnosqldb.appdomain.cloud.example/animaldb-target/" } ], "offset": 0, "total_rows": 1 }
Example SchedulerDocsResult response.
{ "docs": [ { "database": "_replicator", "doc_id": "repldoc-example", "error_count": 0, "id": null, "info": { "changes_pending": null, "checkpointed_source_seq": "14-g1AAAAGjeJzLYWBgYMlgTmGQT0lKzi9KdUhJMtFLykxPyilN1UvOyS9NScwr0ctLLckBKmRKZEiy____f1YGcyJrLlCAPS3RKM0wOZWwdlQrDHFbkeQAJJPqobYwgm2xMDIzTUuxJGwCqi2muG3JYwGSDA1ACmjRfoR_Uo2NUxOTzQmbQrR_IDYdgNgE9hMz2CZLc9MkC4tkwqZkAQCT-Yfn", "doc_write_failures": 0, "docs_read": 15, "docs_written": 15, "missing_revisions_found": 15, "revisions_checked": 15 }, "last_updated": "2020-06-04T20:05:30Z", "source": "https://my-source-instance.cloudantnosqldb.appdomain.cloud.example/animaldb/", "start_time": "2020-06-04T20:05:24Z", "state": "completed", "target": "https://my-target-instance.cloudantnosqldb.appdomain.cloud.example/animaldb-target/" } ], "offset": 0, "total_rows": 1 }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve HTTP headers for replication scheduler documents
Retrieves the HTTP headers for replication scheduler documents.
HEAD /_scheduler/docs
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for
/_scheduler/docs
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Retrieve a replication scheduler document
Retrieves information about a replication document from the replicator database. The endpoint returns the document ID, database, replication ID, source and target, and other information.
Retrieves information about a replication document from the replicator database. The endpoint returns the document ID, database, replication ID, source and target, and other information.
Retrieves information about a replication document from the replicator database. The endpoint returns the document ID, database, replication ID, source and target, and other information.
Retrieves information about a replication document from the replicator database. The endpoint returns the document ID, database, replication ID, source and target, and other information.
Retrieves information about a replication document from the replicator database. The endpoint returns the document ID, database, replication ID, source and target, and other information.
GET /_scheduler/docs/_replicator/{doc_id}
(cloudant *CloudantV1) GetSchedulerDocument(getSchedulerDocumentOptions *GetSchedulerDocumentOptions) (result *SchedulerDocument, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) GetSchedulerDocumentWithContext(ctx context.Context, getSchedulerDocumentOptions *GetSchedulerDocumentOptions) (result *SchedulerDocument, response *core.DetailedResponse, err error)
ServiceCall<SchedulerDocument> getSchedulerDocument(GetSchedulerDocumentOptions getSchedulerDocumentOptions)
getSchedulerDocument(params)
get_scheduler_document(
self,
doc_id: str,
**kwargs,
) -> DetailedResponse
Request
Instantiate the GetSchedulerDocumentOptions
struct and set the fields to provide parameter values for the GetSchedulerDocument
method.
Use the GetSchedulerDocumentOptions.Builder
to create a GetSchedulerDocumentOptions
object that contains the parameter values for the getSchedulerDocument
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The GetSchedulerDocument options.
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
The getSchedulerDocument options.
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
parameters
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
parameters
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/_scheduler/docs/_replicator/repldoc-example"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } getSchedulerDocumentOptions := service.NewGetSchedulerDocumentOptions( "repldoc-example", ) schedulerDocument, response, err := service.GetSchedulerDocument(getSchedulerDocumentOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(schedulerDocument, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.GetSchedulerDocumentOptions; import com.ibm.cloud.cloudant.v1.model.SchedulerDocument;
Cloudant service = Cloudant.newInstance(); GetSchedulerDocumentOptions schedulerDocumentOptions = new GetSchedulerDocumentOptions.Builder() .docId("repldoc-example") .build(); SchedulerDocument response = service.getSchedulerDocument(schedulerDocumentOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.getSchedulerDocument({ docId: 'repldoc-example' }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.get_scheduler_document(doc_id='repldoc-example').get_result() print(response)
Response
Schema for a replication scheduler document.
Database where replication document came from
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Replication document ID
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Consecutive errors count. Indicates how many times in a row this replication has crashed. Replication will be retried with an exponential backoff based on this number. As soon as the replication succeeds this count is reset to 0. To can be used to get an idea why a particular replication is not making progress.
Possible values: 0 ≤ value ≤ 9007199254740992
Replication ID, or null if state is completed or failed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Schema for scheduler document information. A JSON object that may contain additional information about the state. For error states this will contain an error field and string value.
Timestamp of last state update.
Possible values: 1 ≤ length ≤ 26
Timestamp of when the replication was started.
Possible values: 1 ≤ length ≤ 26
Schema for replication state.
Possible values: [
initializing
,error
,pending
,running
,crashing
,completed
,failed
]Cluster node where the job is running.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^.+$
Replication source.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
^https:\/\/.*$
Forbidden in IBM Cloudant mediated replications.
Address of the (http or socks5 protocol) proxy server through which replication with the source database occurs.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Replication target.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
^https:\/\/.*$
Forbidden in IBM Cloudant mediated replications.
Address of the (http or socks5 protocol) proxy server through which replication with the target database occurs.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Schema for a replication scheduler document.
Database where replication document came from.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Replication document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Consecutive errors count. Indicates how many times in a row this replication has crashed. Replication will be retried with an exponential backoff based on this number. As soon as the replication succeeds this count is reset to 0. To can be used to get an idea why a particular replication is not making progress.
Possible values: 0 ≤ value ≤ 9007199254740992
Replication ID, or null if state is completed or failed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for scheduler document information. A JSON object that may contain additional information about the state. For error states this will contain an error field and string value.
- Info
The count of changes not yet replicated.
Possible values: 0 ≤ value ≤ 9007199254740992
The source sequence id which was last successfully replicated.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
The count of docs which failed to be written to the target.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of docs which have been read from the source.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of docs which have been written to the target.
Possible values: 0 ≤ value ≤ 9007199254740992
Replication error message.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The count of revisions which were found on the source, but missing from the target.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of revisions which have been checked since this replication began.
Possible values: 0 ≤ value ≤ 9007199254740992
The last sequence number obtained from the source database changes feed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
The last sequence number processed by the replicator.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Timestamp of last state update.
Cluster node where the job is running.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^.+$/
Replication source.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
Forbidden in IBM Cloudant mediated replications.
Address of the (http or socks5 protocol) proxy server through which replication with the source database occurs.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Timestamp of when the replication was started.
Schema for replication state.
Possible values: [
initializing
,error
,pending
,running
,crashing
,completed
,failed
]Replication target.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
Forbidden in IBM Cloudant mediated replications.
Address of the (http or socks5 protocol) proxy server through which replication with the target database occurs.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a replication scheduler document.
Database where replication document came from.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Replication document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Consecutive errors count. Indicates how many times in a row this replication has crashed. Replication will be retried with an exponential backoff based on this number. As soon as the replication succeeds this count is reset to 0. To can be used to get an idea why a particular replication is not making progress.
Possible values: 0 ≤ value ≤ 9007199254740992
Replication ID, or null if state is completed or failed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for scheduler document information. A JSON object that may contain additional information about the state. For error states this will contain an error field and string value.
- info
The count of changes not yet replicated.
Possible values: 0 ≤ value ≤ 9007199254740992
The source sequence id which was last successfully replicated.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
The count of docs which failed to be written to the target.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of docs which have been read from the source.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of docs which have been written to the target.
Possible values: 0 ≤ value ≤ 9007199254740992
Replication error message.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The count of revisions which were found on the source, but missing from the target.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of revisions which have been checked since this replication began.
Possible values: 0 ≤ value ≤ 9007199254740992
The last sequence number obtained from the source database changes feed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
The last sequence number processed by the replicator.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Timestamp of last state update.
Cluster node where the job is running.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^.+$/
Replication source.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
Forbidden in IBM Cloudant mediated replications.
Address of the (http or socks5 protocol) proxy server through which replication with the source database occurs.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Timestamp of when the replication was started.
Schema for replication state.
Possible values: [
initializing
,error
,pending
,running
,crashing
,completed
,failed
]Replication target.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
Forbidden in IBM Cloudant mediated replications.
Address of the (http or socks5 protocol) proxy server through which replication with the target database occurs.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a replication scheduler document.
Database where replication document came from.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Replication document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Consecutive errors count. Indicates how many times in a row this replication has crashed. Replication will be retried with an exponential backoff based on this number. As soon as the replication succeeds this count is reset to 0. To can be used to get an idea why a particular replication is not making progress.
Possible values: 0 ≤ value ≤ 9007199254740992
Replication ID, or null if state is completed or failed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for scheduler document information. A JSON object that may contain additional information about the state. For error states this will contain an error field and string value.
- info
The count of changes not yet replicated.
Possible values: 0 ≤ value ≤ 9007199254740992
The source sequence id which was last successfully replicated.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
The count of docs which failed to be written to the target.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of docs which have been read from the source.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of docs which have been written to the target.
Possible values: 0 ≤ value ≤ 9007199254740992
Replication error message.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The count of revisions which were found on the source, but missing from the target.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of revisions which have been checked since this replication began.
Possible values: 0 ≤ value ≤ 9007199254740992
The last sequence number obtained from the source database changes feed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
The last sequence number processed by the replicator.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Timestamp of last state update.
Cluster node where the job is running.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^.+$/
Replication source.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
Forbidden in IBM Cloudant mediated replications.
Address of the (http or socks5 protocol) proxy server through which replication with the source database occurs.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Timestamp of when the replication was started.
Schema for replication state.
Possible values: [
initializing
,error
,pending
,running
,crashing
,completed
,failed
]Replication target.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
Forbidden in IBM Cloudant mediated replications.
Address of the (http or socks5 protocol) proxy server through which replication with the target database occurs.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a replication scheduler document.
Database where replication document came from.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Replication document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Consecutive errors count. Indicates how many times in a row this replication has crashed. Replication will be retried with an exponential backoff based on this number. As soon as the replication succeeds this count is reset to 0. To can be used to get an idea why a particular replication is not making progress.
Possible values: 0 ≤ value ≤ 9007199254740992
Replication ID, or null if state is completed or failed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for scheduler document information. A JSON object that may contain additional information about the state. For error states this will contain an error field and string value.
- info
The count of changes not yet replicated.
Possible values: 0 ≤ value ≤ 9007199254740992
The source sequence id which was last successfully replicated.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
The count of docs which failed to be written to the target.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of docs which have been read from the source.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of docs which have been written to the target.
Possible values: 0 ≤ value ≤ 9007199254740992
Replication error message.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The count of revisions which were found on the source, but missing from the target.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of revisions which have been checked since this replication began.
Possible values: 0 ≤ value ≤ 9007199254740992
The last sequence number obtained from the source database changes feed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
The last sequence number processed by the replicator.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Timestamp of last state update.
Cluster node where the job is running.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^.+$/
Replication source.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
Forbidden in IBM Cloudant mediated replications.
Address of the (http or socks5 protocol) proxy server through which replication with the source database occurs.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Timestamp of when the replication was started.
Schema for replication state.
Possible values: [
initializing
,error
,pending
,running
,crashing
,completed
,failed
]Replication target.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
Forbidden in IBM Cloudant mediated replications.
Address of the (http or socks5 protocol) proxy server through which replication with the target database occurs.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Status Code
HTTP response for
/_scheduler/docs/_replicator/{doc_id}
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example SchedulerDocResult response.
{ "database": "_replicator", "doc_id": "repldoc-example", "error_count": 0, "id": null, "info": { "changes_pending": null, "checkpointed_source_seq": "14-g1AAAAGjeJzLYWBgYMlgTmGQT0lKzi9KdUhJMtFLykxPyilN1UvOyS9NScwr0ctLLckBKmRKZEiy____f1YGcyJrLlCAPS3RKM0wOZWwdlQrDHFbkeQAJJPqobYwgm2xMDIzTUuxJGwCqi2muG3JYwGSDA1ACmjRfoR_Uo2NUxOTzQmbQrR_IDYdgNgE9hMz2CZLc9MkC4tkwqZkAQCT-Yfn", "doc_write_failures": 0, "docs_read": 15, "docs_written": 15, "missing_revisions_found": 15, "revisions_checked": 15 }, "last_updated": "2017-04-29T05:01:37.000Z", "source": "https://my-source-instance.cloudantnosqldb.appdomain.cloud.example/animaldb/", "start_time": "2020-06-04T20:05:24Z", "state": "completed", "target": "https://my-target-instance.cloudantnosqldb.appdomain.cloud.example/animaldb-target/" }
Example SchedulerDocResult response.
{ "database": "_replicator", "doc_id": "repldoc-example", "error_count": 0, "id": null, "info": { "changes_pending": null, "checkpointed_source_seq": "14-g1AAAAGjeJzLYWBgYMlgTmGQT0lKzi9KdUhJMtFLykxPyilN1UvOyS9NScwr0ctLLckBKmRKZEiy____f1YGcyJrLlCAPS3RKM0wOZWwdlQrDHFbkeQAJJPqobYwgm2xMDIzTUuxJGwCqi2muG3JYwGSDA1ACmjRfoR_Uo2NUxOTzQmbQrR_IDYdgNgE9hMz2CZLc9MkC4tkwqZkAQCT-Yfn", "doc_write_failures": 0, "docs_read": 15, "docs_written": 15, "missing_revisions_found": 15, "revisions_checked": 15 }, "last_updated": "2017-04-29T05:01:37.000Z", "source": "https://my-source-instance.cloudantnosqldb.appdomain.cloud.example/animaldb/", "start_time": "2020-06-04T20:05:24Z", "state": "completed", "target": "https://my-target-instance.cloudantnosqldb.appdomain.cloud.example/animaldb-target/" }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve HTTP headers for a replication scheduler document
Retrieves the HTTP headers containing minimal amount of information about the specified replication scheduler document. Since the response body is empty, using the HEAD method is a lightweight way to check if the replication scheduler document exists or not.
Retrieves the HTTP headers containing minimal amount of information about the specified replication scheduler document. Since the response body is empty, using the HEAD method is a lightweight way to check if the replication scheduler document exists or not.
Retrieves the HTTP headers containing minimal amount of information about the specified replication scheduler document. Since the response body is empty, using the HEAD method is a lightweight way to check if the replication scheduler document exists or not.
Retrieves the HTTP headers containing minimal amount of information about the specified replication scheduler document. Since the response body is empty, using the HEAD method is a lightweight way to check if the replication scheduler document exists or not.
Retrieves the HTTP headers containing minimal amount of information about the specified replication scheduler document. Since the response body is empty, using the HEAD method is a lightweight way to check if the replication scheduler document exists or not.
HEAD /_scheduler/docs/_replicator/{doc_id}
(cloudant *CloudantV1) HeadSchedulerDocument(headSchedulerDocumentOptions *HeadSchedulerDocumentOptions) (response *core.DetailedResponse, err error)
(cloudant *CloudantV1) HeadSchedulerDocumentWithContext(ctx context.Context, headSchedulerDocumentOptions *HeadSchedulerDocumentOptions) (response *core.DetailedResponse, err error)
ServiceCall<Void> headSchedulerDocument(HeadSchedulerDocumentOptions headSchedulerDocumentOptions)
headSchedulerDocument(params)
head_scheduler_document(
self,
doc_id: str,
**kwargs,
) -> DetailedResponse
Request
Instantiate the HeadSchedulerDocumentOptions
struct and set the fields to provide parameter values for the HeadSchedulerDocument
method.
Use the HeadSchedulerDocumentOptions.Builder
to create a HeadSchedulerDocumentOptions
object that contains the parameter values for the headSchedulerDocument
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The HeadSchedulerDocument options.
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
The headSchedulerDocument options.
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
parameters
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
parameters
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for
/_scheduler/docs/_replicator/{doc_id}
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Retrieve replication scheduler jobs
Retrieves information about replications that were created via /_replicate
endpoint, as well as those created from replication documents. It doesn't include replications that completed or failed to start because replication documents were malformed. Each job description includes source and target information, replication ID, history of recent events, and other information.
Retrieves information about replications that were created via /_replicate
endpoint, as well as those created from replication documents. It doesn't include replications that completed or failed to start because replication documents were malformed. Each job description includes source and target information, replication ID, history of recent events, and other information.
Retrieves information about replications that were created via /_replicate
endpoint, as well as those created from replication documents. It doesn't include replications that completed or failed to start because replication documents were malformed. Each job description includes source and target information, replication ID, history of recent events, and other information.
Retrieves information about replications that were created via /_replicate
endpoint, as well as those created from replication documents. It doesn't include replications that completed or failed to start because replication documents were malformed. Each job description includes source and target information, replication ID, history of recent events, and other information.
Retrieves information about replications that were created via /_replicate
endpoint, as well as those created from replication documents. It doesn't include replications that completed or failed to start because replication documents were malformed. Each job description includes source and target information, replication ID, history of recent events, and other information.
GET /_scheduler/jobs
(cloudant *CloudantV1) GetSchedulerJobs(getSchedulerJobsOptions *GetSchedulerJobsOptions) (result *SchedulerJobsResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) GetSchedulerJobsWithContext(ctx context.Context, getSchedulerJobsOptions *GetSchedulerJobsOptions) (result *SchedulerJobsResult, response *core.DetailedResponse, err error)
ServiceCall<SchedulerJobsResult> getSchedulerJobs(GetSchedulerJobsOptions getSchedulerJobsOptions)
getSchedulerJobs(params)
get_scheduler_jobs(
self,
*,
limit: Optional[int] = None,
skip: Optional[int] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the GetSchedulerJobsOptions
struct and set the fields to provide parameter values for the GetSchedulerJobs
method.
Use the GetSchedulerJobsOptions.Builder
to create a GetSchedulerJobsOptions
object that contains the parameter values for the getSchedulerJobs
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Query Parameters
Query parameter to specify the number of returned jobs to limit the result to.
Possible values: 0 ≤ value ≤ 200
Default:
25
Query parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The GetSchedulerJobs options.
Query parameter to specify the number of returned jobs to limit the result to.
Possible values: 0 ≤ value ≤ 200
Default:
25
Query parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
The getSchedulerJobs options.
Query parameter to specify the number of returned jobs to limit the result to.
Possible values: 0 ≤ value ≤ 200
Default:
25
Query parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
parameters
Query parameter to specify the number of returned jobs to limit the result to.
Possible values: 0 ≤ value ≤ 200
Default:
25
Query parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
parameters
Query parameter to specify the number of returned jobs to limit the result to.
Possible values: 0 ≤ value ≤ 200
Default:
25
Query parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/_scheduler/jobs?limit=100"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } getSchedulerJobsOptions := service.NewGetSchedulerJobsOptions() getSchedulerJobsOptions.SetLimit(100) schedulerJobsResult, response, err := service.GetSchedulerJobs(getSchedulerJobsOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(schedulerJobsResult, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.GetSchedulerJobsOptions; import com.ibm.cloud.cloudant.v1.model.SchedulerJobsResult;
Cloudant service = Cloudant.newInstance(); GetSchedulerJobsOptions schedulerJobsOptions = new GetSchedulerJobsOptions.Builder() .limit(100) .build(); SchedulerJobsResult response = service.getSchedulerJobs(schedulerJobsOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.getSchedulerJobs({ limit: 100 }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.get_scheduler_jobs( limit=100 ).get_result() print(response)
Response
Schema for a listing of replication scheduler jobs.
Offset where the list started.
Possible values: 0 ≤ value ≤ 9007199254740992
Total number of replication jobs.
Possible values: 0 ≤ value ≤ 4294967295
Array of replication job objects.
Possible values: 0 ≤ number of items ≤ 500
Schema for a listing of replication scheduler jobs.
Total number of replication jobs.
Possible values: 0 ≤ value ≤ 4294967295
Array of replication job objects.
Possible values: 0 ≤ number of items ≤ 500
- Jobs
Replication document database.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Replication document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Timestamped history of events as a list of objects.
Possible values: 0 ≤ number of items ≤ 20
- History
Reason for current state of event.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Timestamp of the event.
Type of the event.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a replication job id.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
Schema for scheduler document information. A JSON object that may contain additional information about the state. For error states this will contain an error field and string value.
- Info
The count of changes not yet replicated.
Possible values: 0 ≤ value ≤ 9007199254740992
The source sequence id which was last successfully replicated.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
The count of docs which failed to be written to the target.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of docs which have been read from the source.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of docs which have been written to the target.
Possible values: 0 ≤ value ≤ 9007199254740992
Replication error message.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The count of revisions which were found on the source, but missing from the target.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of revisions which have been checked since this replication began.
Possible values: 0 ≤ value ≤ 9007199254740992
The last sequence number obtained from the source database changes feed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
The last sequence number processed by the replicator.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Cluster node where the job is running.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^.+$/
Replication process ID.
Possible values: 1 ≤ length ≤ 34, Value must match regular expression
/^.+$/
Replication source.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
Timestamp of when the replication was started.
Replication target.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
Name of user running the process.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
Schema for a listing of replication scheduler jobs.
Total number of replication jobs.
Possible values: 0 ≤ value ≤ 4294967295
Array of replication job objects.
Possible values: 0 ≤ number of items ≤ 500
- jobs
Replication document database.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Replication document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Timestamped history of events as a list of objects.
Possible values: 0 ≤ number of items ≤ 20
- history
Reason for current state of event.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Timestamp of the event.
Type of the event.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a replication job id.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
Schema for scheduler document information. A JSON object that may contain additional information about the state. For error states this will contain an error field and string value.
- info
The count of changes not yet replicated.
Possible values: 0 ≤ value ≤ 9007199254740992
The source sequence id which was last successfully replicated.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
The count of docs which failed to be written to the target.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of docs which have been read from the source.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of docs which have been written to the target.
Possible values: 0 ≤ value ≤ 9007199254740992
Replication error message.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The count of revisions which were found on the source, but missing from the target.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of revisions which have been checked since this replication began.
Possible values: 0 ≤ value ≤ 9007199254740992
The last sequence number obtained from the source database changes feed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
The last sequence number processed by the replicator.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Cluster node where the job is running.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^.+$/
Replication process ID.
Possible values: 1 ≤ length ≤ 34, Value must match regular expression
/^.+$/
Replication source.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
Timestamp of when the replication was started.
Replication target.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
Name of user running the process.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
Schema for a listing of replication scheduler jobs.
Total number of replication jobs.
Possible values: 0 ≤ value ≤ 4294967295
Array of replication job objects.
Possible values: 0 ≤ number of items ≤ 500
- jobs
Replication document database.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Replication document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Timestamped history of events as a list of objects.
Possible values: 0 ≤ number of items ≤ 20
- history
Reason for current state of event.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Timestamp of the event.
Type of the event.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a replication job id.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
Schema for scheduler document information. A JSON object that may contain additional information about the state. For error states this will contain an error field and string value.
- info
The count of changes not yet replicated.
Possible values: 0 ≤ value ≤ 9007199254740992
The source sequence id which was last successfully replicated.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
The count of docs which failed to be written to the target.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of docs which have been read from the source.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of docs which have been written to the target.
Possible values: 0 ≤ value ≤ 9007199254740992
Replication error message.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The count of revisions which were found on the source, but missing from the target.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of revisions which have been checked since this replication began.
Possible values: 0 ≤ value ≤ 9007199254740992
The last sequence number obtained from the source database changes feed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
The last sequence number processed by the replicator.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Cluster node where the job is running.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^.+$/
Replication process ID.
Possible values: 1 ≤ length ≤ 34, Value must match regular expression
/^.+$/
Replication source.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
Timestamp of when the replication was started.
Replication target.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
Name of user running the process.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
Schema for a listing of replication scheduler jobs.
Total number of replication jobs.
Possible values: 0 ≤ value ≤ 4294967295
Array of replication job objects.
Possible values: 0 ≤ number of items ≤ 500
- jobs
Replication document database.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Replication document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Timestamped history of events as a list of objects.
Possible values: 0 ≤ number of items ≤ 20
- history
Reason for current state of event.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Timestamp of the event.
Type of the event.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a replication job id.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
Schema for scheduler document information. A JSON object that may contain additional information about the state. For error states this will contain an error field and string value.
- info
The count of changes not yet replicated.
Possible values: 0 ≤ value ≤ 9007199254740992
The source sequence id which was last successfully replicated.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
The count of docs which failed to be written to the target.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of docs which have been read from the source.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of docs which have been written to the target.
Possible values: 0 ≤ value ≤ 9007199254740992
Replication error message.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The count of revisions which were found on the source, but missing from the target.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of revisions which have been checked since this replication began.
Possible values: 0 ≤ value ≤ 9007199254740992
The last sequence number obtained from the source database changes feed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
The last sequence number processed by the replicator.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Cluster node where the job is running.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^.+$/
Replication process ID.
Possible values: 1 ≤ length ≤ 34, Value must match regular expression
/^.+$/
Replication source.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
Timestamp of when the replication was started.
Replication target.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
Name of user running the process.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
Status Code
HTTP response for
/_scheduler/jobs
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example SchedulerJobsResult response.
{ "jobs": [ { "database": "_replicator", "doc_id": "cdyno-0000001-0000003", "history": [ { "timestamp": "2017-04-29T05:01:37Z", "type": "started" }, { "timestamp": "2017-04-29T05:01:37Z", "type": "added" } ], "id": "8f5b1bd0be6f9166ccfd36fc8be8fc22+continuous", "info": { "changes_pending": null, "checkpointed_source_seq": "1-g1AAAARheJzLYWBgEMhgTmHQTElKzi9KdUhJMtJLytVNTtYtLdYtzi8tydA1stBLzskvTUnMK9HLSy3JAWphSmRI4v", "doc_write_failures": 0, "docs_read": 12, "docs_written": 12, "missing_revisions_found": 12, "revisions_checked": 12, "source_seq": "12-g1AAAACTeJzLYWBgYMpgTmHgz8tPSTV0MDQy1zMAQsMckEQiQ1L9____szKYE1lzgQLsBsZm5pZJJpjKcRqRxwIkGRqA1H-oSexgk4yMkhITjS0wdWUBADfEJBg", "through_seq": "12-g1AAAACTeJzLYWBgYMpgTmHgz8tPSTV0MDQy1zMAQsMckEQiQ1L9____szKYE1lzgQLsBsZm5pZJJpjKcRqRxwIkGRqA1H-oSexgk4yMkhITjS0wdWUBADfEJBg" }, "node": "node1@127.0.0.1", "pid": "<0.1850.0>", "source": "https://mysourceserver.example/db/", "start_time": "2017-04-29T05:01:37Z", "target": "https://mytargetserver.example/mydb3/", "user": null }, { "database": "_replicator", "doc_id": "cdyno-0000001-0000002", "history": [ { "timestamp": "2017-04-29T05:01:37Z", "type": "started" }, { "timestamp": "2017-04-29T05:01:37Z", "type": "added" } ], "id": "e327d79214831ca4c11550b4a453c9ba+continuous", "info": { "changes_pending": null, "checkpointed_source_seq": "1-g1AAAASbeJzLYWBgEMhgTmHQTElKzi9KdUhJMtJLytVNTtYtLdYtzi8tydA1stBLzskvTUnMK9HLSy3JAWphSmRI4v", "doc_write_failures": 0, "docs_read": 12, "docs_written": 12, "missing_revisions_found": 12, "revisions_checked": 12, "source_seq": "12-g1AAAACTeJzLYWBgYMpgTmHgz8tPSTV0MDQy1zMAQsMckEQiQ1L9____szKYE1lzgQLsBsZm5pZJJpjKcRqRxwIkGRqA1H-oSexgk4yMkhITjS0wdWUBADfEJBg", "through_seq": "12-g1AAAACTeJzLYWBgYMpgTmHgz8tPSTV0MDQy1zMAQsMckEQiQ1L9____szKYE1lzgQLsBsZm5pZJJpjKcRqRxwIkGRqA1H-oSexgk4yMkhITjS0wdWUBADfEJBg" }, "node": "node2@127.0.0.1", "pid": "<0.1757.0>", "source": "https://mysourceserver.example/db/", "start_time": "2017-04-29T05:01:37Z", "target": "https://mytargetserver.example/mydb2/", "user": null } ], "offset": 0, "total_rows": 2 }
Example SchedulerJobsResult response.
{ "jobs": [ { "database": "_replicator", "doc_id": "cdyno-0000001-0000003", "history": [ { "timestamp": "2017-04-29T05:01:37Z", "type": "started" }, { "timestamp": "2017-04-29T05:01:37Z", "type": "added" } ], "id": "8f5b1bd0be6f9166ccfd36fc8be8fc22+continuous", "info": { "changes_pending": null, "checkpointed_source_seq": "1-g1AAAARheJzLYWBgEMhgTmHQTElKzi9KdUhJMtJLytVNTtYtLdYtzi8tydA1stBLzskvTUnMK9HLSy3JAWphSmRI4v", "doc_write_failures": 0, "docs_read": 12, "docs_written": 12, "missing_revisions_found": 12, "revisions_checked": 12, "source_seq": "12-g1AAAACTeJzLYWBgYMpgTmHgz8tPSTV0MDQy1zMAQsMckEQiQ1L9____szKYE1lzgQLsBsZm5pZJJpjKcRqRxwIkGRqA1H-oSexgk4yMkhITjS0wdWUBADfEJBg", "through_seq": "12-g1AAAACTeJzLYWBgYMpgTmHgz8tPSTV0MDQy1zMAQsMckEQiQ1L9____szKYE1lzgQLsBsZm5pZJJpjKcRqRxwIkGRqA1H-oSexgk4yMkhITjS0wdWUBADfEJBg" }, "node": "node1@127.0.0.1", "pid": "<0.1850.0>", "source": "https://mysourceserver.example/db/", "start_time": "2017-04-29T05:01:37Z", "target": "https://mytargetserver.example/mydb3/", "user": null }, { "database": "_replicator", "doc_id": "cdyno-0000001-0000002", "history": [ { "timestamp": "2017-04-29T05:01:37Z", "type": "started" }, { "timestamp": "2017-04-29T05:01:37Z", "type": "added" } ], "id": "e327d79214831ca4c11550b4a453c9ba+continuous", "info": { "changes_pending": null, "checkpointed_source_seq": "1-g1AAAASbeJzLYWBgEMhgTmHQTElKzi9KdUhJMtJLytVNTtYtLdYtzi8tydA1stBLzskvTUnMK9HLSy3JAWphSmRI4v", "doc_write_failures": 0, "docs_read": 12, "docs_written": 12, "missing_revisions_found": 12, "revisions_checked": 12, "source_seq": "12-g1AAAACTeJzLYWBgYMpgTmHgz8tPSTV0MDQy1zMAQsMckEQiQ1L9____szKYE1lzgQLsBsZm5pZJJpjKcRqRxwIkGRqA1H-oSexgk4yMkhITjS0wdWUBADfEJBg", "through_seq": "12-g1AAAACTeJzLYWBgYMpgTmHgz8tPSTV0MDQy1zMAQsMckEQiQ1L9____szKYE1lzgQLsBsZm5pZJJpjKcRqRxwIkGRqA1H-oSexgk4yMkhITjS0wdWUBADfEJBg" }, "node": "node2@127.0.0.1", "pid": "<0.1757.0>", "source": "https://mysourceserver.example/db/", "start_time": "2017-04-29T05:01:37Z", "target": "https://mytargetserver.example/mydb2/", "user": null } ], "offset": 0, "total_rows": 2 }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve HTTP headers for replication scheduler jobs
Retrieves the HTTP headers for replication scheduler jobs.
HEAD /_scheduler/jobs
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for
/_scheduler/jobs
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Retrieve a replication scheduler job
Retrieves the state of a single replication task based on its replication ID
Retrieves the state of a single replication task based on its replication ID.
Retrieves the state of a single replication task based on its replication ID.
Retrieves the state of a single replication task based on its replication ID.
Retrieves the state of a single replication task based on its replication ID.
GET /_scheduler/jobs/{job_id}
(cloudant *CloudantV1) GetSchedulerJob(getSchedulerJobOptions *GetSchedulerJobOptions) (result *SchedulerJob, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) GetSchedulerJobWithContext(ctx context.Context, getSchedulerJobOptions *GetSchedulerJobOptions) (result *SchedulerJob, response *core.DetailedResponse, err error)
ServiceCall<SchedulerJob> getSchedulerJob(GetSchedulerJobOptions getSchedulerJobOptions)
getSchedulerJob(params)
get_scheduler_job(
self,
job_id: str,
**kwargs,
) -> DetailedResponse
Request
Instantiate the GetSchedulerJobOptions
struct and set the fields to provide parameter values for the GetSchedulerJob
method.
Use the GetSchedulerJobOptions.Builder
to create a GetSchedulerJobOptions
object that contains the parameter values for the getSchedulerJob
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the replication job id.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].*$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The GetSchedulerJob options.
Path parameter to specify the replication job id.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
The getSchedulerJob options.
Path parameter to specify the replication job id.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
parameters
Path parameter to specify the replication job id.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
parameters
Path parameter to specify the replication job id.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/_scheduler/jobs/$JOB_ID?limit=100"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } getSchedulerJobOptions := service.NewGetSchedulerJobOptions( "7b94915cd8c4a0173c77c55cd0443939+continuous", ) schedulerJob, response, err := service.GetSchedulerJob(getSchedulerJobOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(schedulerJob, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.GetSchedulerJobOptions; import com.ibm.cloud.cloudant.v1.model.SchedulerJob;
Cloudant service = Cloudant.newInstance(); GetSchedulerJobOptions schedulerJobOptions = new GetSchedulerJobOptions.Builder() .jobId("7b94915cd8c4a0173c77c55cd0443939+continuous") .build(); SchedulerJob response = service.getSchedulerJob(schedulerJobOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.getSchedulerJob({ jobId: '7b94915cd8c4a0173c77c55cd0443939+continuous' }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.get_scheduler_job( job_id='7b94915cd8c4a0173c77c55cd0443939+continuous' ).get_result() print(response)
Response
Schema for a replication scheduler job.
Replication document database.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Replication document ID
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Timestamped history of events as a list of objects.
Possible values: 0 ≤ number of items ≤ 20
Schema for a replication job id.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].*$
Schema for scheduler document information. A JSON object that may contain additional information about the state. For error states this will contain an error field and string value.
Cluster node where the job is running.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^.+$
Replication process ID.
Possible values: 1 ≤ length ≤ 34, Value must match regular expression
^.+$
Replication source.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
^https:\/\/.*$
Timestamp of when the replication was started.
Possible values: 1 ≤ length ≤ 26
Replication target.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
^https:\/\/.*$
Name of user running the process.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$
Schema for a replication scheduler job.
Replication document database.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Replication document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Timestamped history of events as a list of objects.
Possible values: 0 ≤ number of items ≤ 20
- History
Reason for current state of event.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Timestamp of the event.
Type of the event.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a replication job id.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
Schema for scheduler document information. A JSON object that may contain additional information about the state. For error states this will contain an error field and string value.
- Info
The count of changes not yet replicated.
Possible values: 0 ≤ value ≤ 9007199254740992
The source sequence id which was last successfully replicated.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
The count of docs which failed to be written to the target.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of docs which have been read from the source.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of docs which have been written to the target.
Possible values: 0 ≤ value ≤ 9007199254740992
Replication error message.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The count of revisions which were found on the source, but missing from the target.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of revisions which have been checked since this replication began.
Possible values: 0 ≤ value ≤ 9007199254740992
The last sequence number obtained from the source database changes feed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
The last sequence number processed by the replicator.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Cluster node where the job is running.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^.+$/
Replication process ID.
Possible values: 1 ≤ length ≤ 34, Value must match regular expression
/^.+$/
Replication source.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
Timestamp of when the replication was started.
Replication target.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
Name of user running the process.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
Schema for a replication scheduler job.
Replication document database.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Replication document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Timestamped history of events as a list of objects.
Possible values: 0 ≤ number of items ≤ 20
- history
Reason for current state of event.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Timestamp of the event.
Type of the event.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a replication job id.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
Schema for scheduler document information. A JSON object that may contain additional information about the state. For error states this will contain an error field and string value.
- info
The count of changes not yet replicated.
Possible values: 0 ≤ value ≤ 9007199254740992
The source sequence id which was last successfully replicated.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
The count of docs which failed to be written to the target.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of docs which have been read from the source.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of docs which have been written to the target.
Possible values: 0 ≤ value ≤ 9007199254740992
Replication error message.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The count of revisions which were found on the source, but missing from the target.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of revisions which have been checked since this replication began.
Possible values: 0 ≤ value ≤ 9007199254740992
The last sequence number obtained from the source database changes feed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
The last sequence number processed by the replicator.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Cluster node where the job is running.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^.+$/
Replication process ID.
Possible values: 1 ≤ length ≤ 34, Value must match regular expression
/^.+$/
Replication source.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
Timestamp of when the replication was started.
Replication target.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
Name of user running the process.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
Schema for a replication scheduler job.
Replication document database.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Replication document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Timestamped history of events as a list of objects.
Possible values: 0 ≤ number of items ≤ 20
- history
Reason for current state of event.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Timestamp of the event.
Type of the event.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a replication job id.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
Schema for scheduler document information. A JSON object that may contain additional information about the state. For error states this will contain an error field and string value.
- info
The count of changes not yet replicated.
Possible values: 0 ≤ value ≤ 9007199254740992
The source sequence id which was last successfully replicated.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
The count of docs which failed to be written to the target.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of docs which have been read from the source.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of docs which have been written to the target.
Possible values: 0 ≤ value ≤ 9007199254740992
Replication error message.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The count of revisions which were found on the source, but missing from the target.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of revisions which have been checked since this replication began.
Possible values: 0 ≤ value ≤ 9007199254740992
The last sequence number obtained from the source database changes feed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
The last sequence number processed by the replicator.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Cluster node where the job is running.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^.+$/
Replication process ID.
Possible values: 1 ≤ length ≤ 34, Value must match regular expression
/^.+$/
Replication source.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
Timestamp of when the replication was started.
Replication target.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
Name of user running the process.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
Schema for a replication scheduler job.
Replication document database.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Replication document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Timestamped history of events as a list of objects.
Possible values: 0 ≤ number of items ≤ 20
- history
Reason for current state of event.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Timestamp of the event.
Type of the event.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for a replication job id.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
Schema for scheduler document information. A JSON object that may contain additional information about the state. For error states this will contain an error field and string value.
- info
The count of changes not yet replicated.
Possible values: 0 ≤ value ≤ 9007199254740992
The source sequence id which was last successfully replicated.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
The count of docs which failed to be written to the target.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of docs which have been read from the source.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of docs which have been written to the target.
Possible values: 0 ≤ value ≤ 9007199254740992
Replication error message.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The count of revisions which were found on the source, but missing from the target.
Possible values: 0 ≤ value ≤ 9007199254740992
The count of revisions which have been checked since this replication began.
Possible values: 0 ≤ value ≤ 9007199254740992
The last sequence number obtained from the source database changes feed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
The last sequence number processed by the replicator.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Cluster node where the job is running.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^.+$/
Replication process ID.
Possible values: 1 ≤ length ≤ 34, Value must match regular expression
/^.+$/
Replication source.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
Timestamp of when the replication was started.
Replication target.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
/^https:\/\/.*$/
Name of user running the process.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
Status Code
HTTP response for SchedulerJob.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example SchedulerJob response.
{ "database": "_replicator", "doc_id": "15972f3ef583b3cd6b6620ae4a91b6c5", "history": [ { "timestamp": "2022-04-29T05:01:37Z", "type": "started" }, { "timestamp": "2022-04-29T05:01:37Z", "type": "added" } ], "id": "935c58f9ff98aabe5340d8cb8946f5ca+create_target", "info": { "changes_pending": null, "checkpointed_source_seq": "1-g1AAAARheJzLYWBgEMhgTmHQTElKzi9KdUhJMtJLyt__VNTtYtLdYtzi8tydA1stBLzskvTUnMK9HLSy3JAWphSmRI4v", "doc_write_failures": 0, "docs_read": 2710, "docs_written": 2710, "missing_revisions_found": 12, "revisions_checked": 12, "source_seq": "1037-g1AAAACTeJzLYWBgYMpgTmHgz8tPSTV0MDQy1zMAQsMckEQiQ1L9___szKYE1lzgQLsBsZm5pZJJpjKcRqRxwIkGRqA1H-oSexgk4yMkhITjS0wdWUBADfEJBg", "through_seq": "667-g1AAAACTeJzLYWBgYMpgTmHgz8tPSTV0MDQy1zMAQsMckEQiQ1L9____szKYE1lzgQLsBsZm5pZJJpjKcRqRxwIkGRqA1H-oSexgk4yMkhITjS0wdWUBADfEJB" }, "node": "node1@127.0.0.1", "pid": "<0.1850.0>", "source": "https://mysourceserver.example/db/", "start_time": "2017-04-29T05:01:37Z", "target": "https://mytargetserver.example/mydb/", "user": null }
Example SchedulerJob response.
{ "database": "_replicator", "doc_id": "15972f3ef583b3cd6b6620ae4a91b6c5", "history": [ { "timestamp": "2022-04-29T05:01:37Z", "type": "started" }, { "timestamp": "2022-04-29T05:01:37Z", "type": "added" } ], "id": "935c58f9ff98aabe5340d8cb8946f5ca+create_target", "info": { "changes_pending": null, "checkpointed_source_seq": "1-g1AAAARheJzLYWBgEMhgTmHQTElKzi9KdUhJMtJLyt__VNTtYtLdYtzi8tydA1stBLzskvTUnMK9HLSy3JAWphSmRI4v", "doc_write_failures": 0, "docs_read": 2710, "docs_written": 2710, "missing_revisions_found": 12, "revisions_checked": 12, "source_seq": "1037-g1AAAACTeJzLYWBgYMpgTmHgz8tPSTV0MDQy1zMAQsMckEQiQ1L9___szKYE1lzgQLsBsZm5pZJJpjKcRqRxwIkGRqA1H-oSexgk4yMkhITjS0wdWUBADfEJBg", "through_seq": "667-g1AAAACTeJzLYWBgYMpgTmHgz8tPSTV0MDQy1zMAQsMckEQiQ1L9____szKYE1lzgQLsBsZm5pZJJpjKcRqRxwIkGRqA1H-oSexgk4yMkhITjS0wdWUBADfEJB" }, "node": "node1@127.0.0.1", "pid": "<0.1850.0>", "source": "https://mysourceserver.example/db/", "start_time": "2017-04-29T05:01:37Z", "target": "https://mytargetserver.example/mydb/", "user": null }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve the HTTP headers for a replication scheduler job
Returns the HTTP headers that contain a minimal amount of information about the specified replication task. Only the header information is returned.
Returns the HTTP headers that contain a minimal amount of information about the specified replication task. Only the header information is returned.
Returns the HTTP headers that contain a minimal amount of information about the specified replication task. Only the header information is returned.
Returns the HTTP headers that contain a minimal amount of information about the specified replication task. Only the header information is returned.
Returns the HTTP headers that contain a minimal amount of information about the specified replication task. Only the header information is returned.
HEAD /_scheduler/jobs/{job_id}
(cloudant *CloudantV1) HeadSchedulerJob(headSchedulerJobOptions *HeadSchedulerJobOptions) (response *core.DetailedResponse, err error)
(cloudant *CloudantV1) HeadSchedulerJobWithContext(ctx context.Context, headSchedulerJobOptions *HeadSchedulerJobOptions) (response *core.DetailedResponse, err error)
ServiceCall<Void> headSchedulerJob(HeadSchedulerJobOptions headSchedulerJobOptions)
headSchedulerJob(params)
head_scheduler_job(
self,
job_id: str,
**kwargs,
) -> DetailedResponse
Request
Instantiate the HeadSchedulerJobOptions
struct and set the fields to provide parameter values for the HeadSchedulerJob
method.
Use the HeadSchedulerJobOptions.Builder
to create a HeadSchedulerJobOptions
object that contains the parameter values for the headSchedulerJob
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the replication job id.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].*$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The HeadSchedulerJob options.
Path parameter to specify the replication job id.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
The headSchedulerJob options.
Path parameter to specify the replication job id.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
parameters
Path parameter to specify the replication job id.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
parameters
Path parameter to specify the replication job id.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
curl -H "Authorization: Bearer $API_BEARER_TOKEN" --head "$SERVICE_URL/_scheduler/jobs/$JOB_ID"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } headSchedulerJobOptions := service.NewHeadSchedulerJobOptions( "7b94915cd8c4a0173c77c55cd0443939+continuous", ) response, err := service.HeadSchedulerJob(headSchedulerJobOptions) if err != nil { panic(err) } fmt.Println(response.StatusCode)
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.HeadSchedulerJobOptions;
Cloudant service = Cloudant.newInstance(); HeadSchedulerJobOptions schedulerJobOptions = new HeadSchedulerJobOptions.Builder() .jobId("7b94915cd8c4a0173c77c55cd0443939+continuous") .build(); int statusCode = service.headSchedulerJob(schedulerJobOptions).execute() .getStatusCode(); System.out.println(statusCode);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.headSchedulerJob({ jobId: '7b94915cd8c4a0173c77c55cd0443939+continuous' }).then(response => { console.log(response.status); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.head_scheduler_job( job_id='7b94915cd8c4a0173c77c55cd0443939+continuous' ).get_result() print(response.get_status_code())
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for SchedulerJob.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Delete an IAM cookie session
Returns a response that instructs the HTTP client to clear the cookie. The session cookies are stateless and cannot be invalidated; hence, this operation is optional and does not invalidate the cookie on the server.
DELETE /_iam_session
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Response
Schema for an OK result.
ok
Status Code
HTTP response for Ok operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example Ok response.
{ "ok": true }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve current IAM cookie session information
Retrieves information about an IAM cookie session.
GET /_iam_session
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Response
Schema for information about an IAM session.
User ID
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Session is ok
Scope of the session
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Type of the session
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for getIamSessionInformation.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example IamSessionInformation response.
{ "id": "abc-123", "ok": true, "scope": "ibm openid", "type": "user" }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Create a session cookie by using an IAM token
Log in by exchanging an IAM token for an IBM Cloudant cookie.
POST /_iam_session
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
HTTP request body for postIamSession.
Example IamSessionConfiguration request.
{
"access_token": "a2.b3.c4"
}
Token obtained from the IAM service.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[A-Za-z0-9_-]{2,}\.[A-Za-z0-9_-]{2,}\.[A-Za-z0-9_-]{2,}$
Response
Schema for an OK result.
ok
Status Code
HTTP response for postIamSession.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example Ok response.
{ "ok": true }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Delete a session cookie
Returns a response that instructs the HTTP client to clear the cookie. The session cookies are stateless and cannot be invalidated; hence, this operation is optional and does not invalidate the cookie on the server.
DELETE /_session
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X DELETE "$SERVICE_URL/_session"
For more details on Session Authentication, see Authentication.
Response
Schema for an OK result.
ok
Status Code
HTTP response for Ok operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example Ok response.
{ "ok": true }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve current session cookie information
Retrieves information about the authenticated user's session.
Retrieves information about the authenticated user's session.
Retrieves information about the authenticated user's session.
Retrieves information about the authenticated user's session.
Retrieves information about the authenticated user's session.
GET /_session
(cloudant *CloudantV1) GetSessionInformation(getSessionInformationOptions *GetSessionInformationOptions) (result *SessionInformation, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) GetSessionInformationWithContext(ctx context.Context, getSessionInformationOptions *GetSessionInformationOptions) (result *SessionInformation, response *core.DetailedResponse, err error)
ServiceCall<SessionInformation> getSessionInformation()
getSessionInformation(params)
get_session_information(
self,
**kwargs,
) -> DetailedResponse
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
No Request Parameters
No Request Parameters
No Request Parameters
No Request Parameters
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/_session"
For more details on Session Authentication, see Authentication.
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } getSessionInformationOptions := service.NewGetSessionInformationOptions() sessionInformation, response, err := service.GetSessionInformation(getSessionInformationOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(sessionInformation, "", " ") fmt.Println(string(b))
For more details on Session Authentication, see Authentication.
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.SessionInformation;
Cloudant service = Cloudant.newInstance(); SessionInformation response = service.getSessionInformation().execute().getResult(); System.out.println(response);
For more details on Session Authentication, see Authentication.
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.getSessionInformation().then(response => { console.log(response.result); });
For more details on Session Authentication, see Authentication.
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.get_session_information().get_result() print(response)
For more details on Session Authentication, see Authentication.
Response
Schema for information about a session.
ok
Schema for session authentication information.
Schema for the user context of a session.
Schema for information about a session.
ok.
Schema for session authentication information.
- Info
authenticated.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
authentication_db.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_users$|^[a-z][a-z0-9_$()+\/-]*$/
authentication_handlers.
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the user context of a session.
- UserCtx
Database name in the context of the provided operation.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Name of user running the process.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
List of user roles.
Possible values: [
_reader
,_writer
,_admin
,_replicator
,_db_updates
,_design
,_shards
,_security
]Possible values: number of items ≥ 0
Schema for information about a session.
ok.
Schema for session authentication information.
- info
authenticated.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
authentication_db.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_users$|^[a-z][a-z0-9_$()+\/-]*$/
authentication_handlers.
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the user context of a session.
- userCtx
Database name in the context of the provided operation.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Name of user running the process.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
List of user roles.
Possible values: [
_reader
,_writer
,_admin
,_replicator
,_db_updates
,_design
,_shards
,_security
]Possible values: number of items ≥ 0
Schema for information about a session.
ok.
Schema for session authentication information.
- info
authenticated.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
authentication_db.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_users$|^[a-z][a-z0-9_$()+\/-]*$/
authentication_handlers.
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the user context of a session.
- userCtx
Database name in the context of the provided operation.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Name of user running the process.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
List of user roles.
Possible values: [
_reader
,_writer
,_admin
,_replicator
,_db_updates
,_design
,_shards
,_security
]Possible values: number of items ≥ 0
Schema for information about a session.
ok.
Schema for session authentication information.
- info
authenticated.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
authentication_db.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_users$|^[a-z][a-z0-9_$()+\/-]*$/
authentication_handlers.
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for the user context of a session.
- user_ctx
Database name in the context of the provided operation.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Name of user running the process.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/
List of user roles.
Possible values: [
_reader
,_writer
,_admin
,_replicator
,_db_updates
,_design
,_shards
,_security
]Possible values: number of items ≥ 0
Status Code
HTTP response for
/_session
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example SessionInformation response.
{ "info": { "authenticated": "default", "authentication_db": "_users", "authentication_handlers": [ "iam", "cookie", "default", "local" ] }, "ok": true, "userCtx": { "name": "user", "roles": [ "_admin", "_reader", "_writer" ] } }
Example SessionInformation response.
{ "info": { "authenticated": "default", "authentication_db": "_users", "authentication_handlers": [ "iam", "cookie", "default", "local" ] }, "ok": true, "userCtx": { "name": "user", "roles": [ "_admin", "_reader", "_writer" ] } }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve HTTP headers for the current session cookie
Retrieves the HTTP headers for the authenticated user's session.
HEAD /_session
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for
/_session
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Create a session cookie
Response returns a cookie, generated by the server, that confirms you have successfully authenticated. Once the cookie is created, you send the cookie with all requests that require you to be authenticated. The presence of a valid cookie is sufficient to ensure that your call request is processed rather than rejected immediately as unauthenticated. You can use the cookie until it expires.
POST /_session
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Query Parameters
Enforces redirect after successful login to the specified location. This location is relative from server root.
Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
^.+$
HTTP request body for postSession.
The password associated with the username.
Possible values: 16 ≤ length ≤ 7168, Value must match regular expression
^(?:(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).*){8,}$
Schema for a username.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$
curl -X POST "$SERVICE_URL/_session" -H "Content-Type: application/json" --data '{ "username": "'"$SERVICE_USERNAME"'", "password": "'"$SERVICE_PASSWORD"'" }'
For more details on Session Authentication, see Authentication.
Response
Schema for the result of requesting a session.
name
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
ok
roles
Possible values: [
_reader
,_writer
,_admin
,_replicator
,_db_updates
,_design
,_shards
,_security
]Possible values: 0 ≤ number of items ≤ 4294967295
Status Code
HTTP response for postSession.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example SessionResult response.
{ "name": "user", "ok": true, "roles": [ "_reader", "_writer" ] }
Example error response for an invalid base64 header value.
{ "error": "bad_request", "reason": "Authorization header has invalid base64 value" }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Generates API keys for apps or persons to enable database access
Generates API keys to enable database access for a person or application, but without creating a new IBM Cloudant account for that person or application. An API key is a randomly generated username and password. The key is given the wanted access permissions for a database.
Generates API keys to enable database access for a person or application, but without creating a new IBM Cloudant account for that person or application. An API key is a randomly generated username and password. The key is given the wanted access permissions for a database.
Generates API keys to enable database access for a person or application, but without creating a new IBM Cloudant account for that person or application. An API key is a randomly generated username and password. The key is given the wanted access permissions for a database.
Generates API keys to enable database access for a person or application, but without creating a new IBM Cloudant account for that person or application. An API key is a randomly generated username and password. The key is given the wanted access permissions for a database.
Generates API keys to enable database access for a person or application, but without creating a new IBM Cloudant account for that person or application. An API key is a randomly generated username and password. The key is given the wanted access permissions for a database.
POST /_api/v2/api_keys
(cloudant *CloudantV1) PostApiKeys(postApiKeysOptions *PostApiKeysOptions) (result *ApiKeysResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostApiKeysWithContext(ctx context.Context, postApiKeysOptions *PostApiKeysOptions) (result *ApiKeysResult, response *core.DetailedResponse, err error)
ServiceCall<ApiKeysResult> postApiKeys()
postApiKeys(params)
post_api_keys(
self,
**kwargs,
) -> DetailedResponse
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
No Request Parameters
No Request Parameters
No Request Parameters
No Request Parameters
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X POST "$SERVICE_URL/_api/v2/api_keys"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } postApiKeysOptions := service.NewPostApiKeysOptions() apiKeysResult, response, err := service.PostApiKeys(postApiKeysOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(apiKeysResult, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.ApiKeysResult;
Cloudant service = Cloudant.newInstance(); ApiKeysResult response = service.postApiKeys().execute().getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.postApiKeys().then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.post_api_keys().get_result() print(response)
Response
Schema for api keys.
ok
The generated api key.
Possible values: 1 ≤ length ≤ 44, Value must match regular expression
^[A-Za-z0-9_-]{2,}$
The password associated with the api key.
Possible values: 40 ≤ length ≤ 7168, Value must match regular expression
^[\da-f]+$
Schema for api keys.
ok.
The generated api key.
Possible values: 1 ≤ length ≤ 44, Value must match regular expression
/^[A-Za-z0-9_-]{2,}$/
The password associated with the api key.
Possible values: 40 ≤ length ≤ 7168, Value must match regular expression
/^[\\da-f]+$/
Schema for api keys.
ok.
The generated api key.
Possible values: 1 ≤ length ≤ 44, Value must match regular expression
/^[A-Za-z0-9_-]{2,}$/
The password associated with the api key.
Possible values: 40 ≤ length ≤ 7168, Value must match regular expression
/^[\\da-f]+$/
Schema for api keys.
ok.
The generated api key.
Possible values: 1 ≤ length ≤ 44, Value must match regular expression
/^[A-Za-z0-9_-]{2,}$/
The password associated with the api key.
Possible values: 40 ≤ length ≤ 7168, Value must match regular expression
/^[\\da-f]+$/
Schema for api keys.
ok.
The generated api key.
Possible values: 1 ≤ length ≤ 44, Value must match regular expression
/^[A-Za-z0-9_-]{2,}$/
The password associated with the api key.
Possible values: 40 ≤ length ≤ 7168, Value must match regular expression
/^[\\da-f]+$/
Status Code
HTTP response for postApiKeys.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example ApiKeysResult response.
{ "key": "blentfortedsionstrindigl", "ok": true, "password": "YPNCaIX1sJRX5upaL3eqvTfi" }
Example ApiKeysResult response.
{ "key": "blentfortedsionstrindigl", "ok": true, "password": "YPNCaIX1sJRX5upaL3eqvTfi" }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve database permissions information
See who has permission to read, write, and manage the database. The credentials you use to log in to the dashboard automatically include _admin
permissions to all databases you create. Everyone and everything else, including users you share databases with and API keys you create, must be given a permission level explicitly.
GET /_api/v2/db/{db}/_security
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/_api/v2/db/products/_security"
The
nobody
username applies to all unauthenticated connection attempts. For example, if an application tries to read data from a database, but didn't identify itself, the task can continue only if thenobody
user has the role_reader
.If instead of using Cloudant's security model for managing permissions you opt to use the Apache CouchDB
_users
database (that is using legacy credentials and thecouchdb_auth_only:true
option) then be aware that the user must already exist in_users
database before getting permissions. For information on the_users
database, see Using the_users
database with Cloudant.
Response
Schema for a security document.
Schema for names and roles to map to a database permission.
Database permissions for Cloudant users and/or API keys.
- cloudant
Schema for a security role.
Possible values: [
_reader
,_writer
,_admin
,_replicator
,_db_updates
,_design
,_shards
,_security
]Possible values: 0 ≤ number of items ≤ 65535
Manage permissions using the
_users
database only.Schema for names and roles to map to a database permission.
Status Code
HTTP response for getSecurity and getCloudantSecurityInformation.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example Cloudant Security response.
{ "cloudant": { "nobody": [ "_replicator", "_reader" ] } }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Modify only Cloudant related database permissions
Modify only Cloudant related permissions to database. Be careful: by removing an API key from the list, you remove the API key from the list of users that have access to the database.
Note about nobody role
The nobody
username applies to all unauthenticated connection
attempts. For example, if an application tries to read data from a
database, but did not identify itself, the task can continue only if
the nobody
user has the role _reader
.
Modify only Cloudant related permissions to database. Be careful: by removing an API key from the list, you remove the API key from the list of users that have access to the database.
Note about nobody role
The nobody
username applies to all unauthenticated connection attempts. For example, if an application tries to read data from a database, but did not identify itself, the task can continue only if the nobody
user has the role _reader
.
Modify only Cloudant related permissions to database. Be careful: by removing an API key from the list, you remove the API key from the list of users that have access to the database.
Note about nobody role
The nobody
username applies to all unauthenticated connection attempts. For example, if an application tries to read data from a database, but did not identify itself, the task can continue only if the nobody
user has the role _reader
.
Modify only Cloudant related permissions to database. Be careful: by removing an API key from the list, you remove the API key from the list of users that have access to the database.
Note about nobody role
The nobody
username applies to all unauthenticated connection attempts. For example, if an application tries to read data from a database, but did not identify itself, the task can continue only if the nobody
user has the role _reader
.
Modify only Cloudant related permissions to database. Be careful: by removing an API key from the list, you remove the API key from the list of users that have access to the database.
Note about nobody role
The nobody
username applies to all unauthenticated connection attempts. For example, if an application tries to read data from a database, but did not identify itself, the task can continue only if the nobody
user has the role _reader
.
PUT /_api/v2/db/{db}/_security
(cloudant *CloudantV1) PutCloudantSecurityConfiguration(putCloudantSecurityConfigurationOptions *PutCloudantSecurityConfigurationOptions) (result *Ok, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PutCloudantSecurityConfigurationWithContext(ctx context.Context, putCloudantSecurityConfigurationOptions *PutCloudantSecurityConfigurationOptions) (result *Ok, response *core.DetailedResponse, err error)
ServiceCall<Ok> putCloudantSecurityConfiguration(PutCloudantSecurityConfigurationOptions putCloudantSecurityConfigurationOptions)
putCloudantSecurityConfiguration(params)
put_cloudant_security_configuration(
self,
db: str,
cloudant: dict,
*,
admins: Optional['SecurityObject'] = None,
couchdb_auth_only: Optional[bool] = None,
members: Optional['SecurityObject'] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the PutCloudantSecurityConfigurationOptions
struct and set the fields to provide parameter values for the PutCloudantSecurityConfiguration
method.
Use the PutCloudantSecurityConfigurationOptions.Builder
to create a PutCloudantSecurityConfigurationOptions
object that contains the parameter values for the putCloudantSecurityConfiguration
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
HTTP request body for putCloudantSecurityConfiguration.
Example Cloudant Security document.
{
"cloudant": {
"antsellseadespecteposene": [
"_reader",
"_writer",
"_admin"
],
"garbados": [
"_reader",
"_writer"
],
"nobody": [
"_reader"
]
}
}
Database permissions for Cloudant users and/or API keys.
- cloudant
Schema for a security role.
Allowable values: [
_reader
,_writer
,_admin
,_replicator
,_db_updates
,_design
,_shards
,_security
]Possible values: 0 ≤ number of items ≤ 65535
Schema for names and roles to map to a database permission.
Manage permissions using the
_users
database only.Schema for names and roles to map to a database permission.
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The PutCloudantSecurityConfiguration options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Database permissions for Cloudant users and/or API keys.
Allowable values: [
_reader
,_writer
,_admin
,_replicator
,_db_updates
,_design
,_shards
,_security
]Possible values: 0 ≤ number of items ≤ 65535
Examples:{ "antsellseadespecteposene": [ "_reader", "_writer", "_admin" ], "garbados": [ "_reader", "_writer" ], "nobody": [ "_reader" ] }
Schema for names and roles to map to a database permission.
- Admins
List of usernames.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
List of roles.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 238, Value must match regular expression
/^.+$/
Manage permissions using the
_users
database only.Schema for names and roles to map to a database permission.
- Members
List of usernames.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
List of roles.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 238, Value must match regular expression
/^.+$/
The putCloudantSecurityConfiguration options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Database permissions for Cloudant users and/or API keys.
Allowable values: [
_reader
,_writer
,_admin
,_replicator
,_db_updates
,_design
,_shards
,_security
]Possible values: 0 ≤ number of items ≤ 65535
Examples:{ "antsellseadespecteposene": [ "_reader", "_writer", "_admin" ], "garbados": [ "_reader", "_writer" ], "nobody": [ "_reader" ] }
Schema for names and roles to map to a database permission.
- admins
List of usernames.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
List of roles.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 238, Value must match regular expression
/^.+$/
Manage permissions using the
_users
database only.Schema for names and roles to map to a database permission.
- members
List of usernames.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
List of roles.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 238, Value must match regular expression
/^.+$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Database permissions for Cloudant users and/or API keys.
Allowable values: [
_reader
,_writer
,_admin
,_replicator
,_db_updates
,_design
,_shards
,_security
]Possible values: 0 ≤ number of items ≤ 65535
Examples:Schema for names and roles to map to a database permission.
- admins
List of usernames.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
List of roles.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 238, Value must match regular expression
/^.+$/
Manage permissions using the
_users
database only.Schema for names and roles to map to a database permission.
- members
List of usernames.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
List of roles.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 238, Value must match regular expression
/^.+$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Database permissions for Cloudant users and/or API keys.
Allowable values: [
_reader
,_writer
,_admin
,_replicator
,_db_updates
,_design
,_shards
,_security
]Possible values: 0 ≤ number of items ≤ 65535
Examples:Schema for names and roles to map to a database permission.
- admins
List of usernames.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
List of roles.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 238, Value must match regular expression
/^.+$/
Manage permissions using the
_users
database only.Schema for names and roles to map to a database permission.
- members
List of usernames.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
List of roles.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 238, Value must match regular expression
/^.+$/
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X PUT "$SERVICE_URL/_api/v2/db/products/_security" --data '{"nobody": ["_reader"]}'
The
nobody
username applies to all unauthenticated connection attempts. For example, if an application tries to read data from a database, but didn't identify itself, the task can continue only if thenobody
user has the role_reader
.If instead of using Cloudant's security model for managing permissions you opt to use the Apache CouchDB
_users
database (that is using legacy credentials and thecouchdb_auth_only:true
option) then be aware that the user must already exist in_users
database before adding permissions. For information on the_users
database, see Using the_users
database with Cloudant.
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } putCloudantSecurityConfigurationOptions := service.NewPutCloudantSecurityConfigurationOptions( "products", map[string][]string{ "nobody": {cloudantv1.SecurityCloudantReaderConst}, }, ) ok, response, err := service.PutCloudantSecurityConfiguration(putCloudantSecurityConfigurationOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(ok, "", " ") fmt.Println(string(b))
The
nobody
username applies to all unauthenticated connection attempts. For example, if an application tries to read data from a database, but didn't identify itself, the task can continue only if thenobody
user has the role_reader
.If instead of using Cloudant's security model for managing permissions you opt to use the Apache CouchDB
_users
database (that is using legacy credentials and thecouchdb_auth_only:true
option) then be aware that the user must already exist in_users
database before adding permissions. For information on the_users
database, see Using the_users
database with Cloudant.
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.Ok; import com.ibm.cloud.cloudant.v1.model.PutCloudantSecurityConfigurationOptions; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map;
Cloudant service = Cloudant.newInstance(); Map<String, List<String>> securityObject = new HashMap<>(); securityObject.put("nobody", Arrays.asList("_reader")); PutCloudantSecurityConfigurationOptions securityOptions = new PutCloudantSecurityConfigurationOptions.Builder() .db("products") .cloudant(securityObject) .build(); Ok response = service.putCloudantSecurityConfiguration(securityOptions) .execute() .getResult(); System.out.println(response);
The
nobody
username applies to all unauthenticated connection attempts. For example, if an application tries to read data from a database, but didn't identify itself, the task can continue only if thenobody
user has the role_reader
.If instead of using Cloudant's security model for managing permissions you opt to use the Apache CouchDB
_users
database (that is using legacy credentials and thecouchdb_auth_only:true
option) then be aware that the user must already exist in_users
database before adding permissions. For information on the_users
database, see Using the_users
database with Cloudant.
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.putCloudantSecurityConfiguration({ db: 'products', cloudant: {'nobody': ['_reader']} }).then(response => { console.log(response.result); });
The
nobody
username applies to all unauthenticated connection attempts. For example, if an application tries to read data from a database, but didn't identify itself, the task can continue only if thenobody
user has the role_reader
.If instead of using Cloudant's security model for managing permissions you opt to use the Apache CouchDB
_users
database (that is using legacy credentials and thecouchdb_auth_only:true
option) then be aware that the user must already exist in_users
database before adding permissions. For information on the_users
database, see Using the_users
database with Cloudant.
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() security_object = {'nobody':['_reader']} response = service.put_cloudant_security_configuration( db='products', cloudant=security_object ).get_result() print(response)
The
nobody
username applies to all unauthenticated connection attempts. For example, if an application tries to read data from a database, but didn't identify itself, the task can continue only if thenobody
user has the role_reader
.If instead of using Cloudant's security model for managing permissions you opt to use the Apache CouchDB
_users
database (that is using legacy credentials and thecouchdb_auth_only:true
option) then be aware that the user must already exist in_users
database before adding permissions. For information on the_users
database, see Using the_users
database with Cloudant.
Response
Schema for an OK result.
ok
Schema for an OK result.
ok.
Schema for an OK result.
ok.
Schema for an OK result.
ok.
Schema for an OK result.
ok.
Status Code
HTTP response for Ok operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example Ok response.
{ "ok": true }
Example Ok response.
{ "ok": true }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve database permissions information
See who has permission to read, write, and manage the database. The credentials you use to log in to the dashboard automatically include _admin
permissions to all databases you create. Everyone and everything else, including users you share databases with and API keys you create, must be given a permission level explicitly.
See who has permission to read, write, and manage the database. The credentials you use to log in to the dashboard automatically include _admin
permissions to all databases you create. Everyone and everything else, including users you share databases with and API keys you create, must be given a permission level explicitly.
See who has permission to read, write, and manage the database. The credentials you use to log in to the dashboard automatically include _admin
permissions to all databases you create. Everyone and everything else, including users you share databases with and API keys you create, must be given a permission level explicitly.
See who has permission to read, write, and manage the database. The credentials you use to log in to the dashboard automatically include _admin
permissions to all databases you create. Everyone and everything else, including users you share databases with and API keys you create, must be given a permission level explicitly.
See who has permission to read, write, and manage the database. The credentials you use to log in to the dashboard automatically include _admin
permissions to all databases you create. Everyone and everything else, including users you share databases with and API keys you create, must be given a permission level explicitly.
GET /{db}/_security
(cloudant *CloudantV1) GetSecurity(getSecurityOptions *GetSecurityOptions) (result *Security, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) GetSecurityWithContext(ctx context.Context, getSecurityOptions *GetSecurityOptions) (result *Security, response *core.DetailedResponse, err error)
ServiceCall<Security> getSecurity(GetSecurityOptions getSecurityOptions)
getSecurity(params)
get_security(
self,
db: str,
**kwargs,
) -> DetailedResponse
Request
Instantiate the GetSecurityOptions
struct and set the fields to provide parameter values for the GetSecurity
method.
Use the GetSecurityOptions.Builder
to create a GetSecurityOptions
object that contains the parameter values for the getSecurity
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The GetSecurity options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
The getSecurity options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/products/_security"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } getSecurityOptions := service.NewGetSecurityOptions( "products", ) security, response, err := service.GetSecurity(getSecurityOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(security, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.GetSecurityOptions; import com.ibm.cloud.cloudant.v1.model.Security;
Cloudant service = Cloudant.newInstance(); GetSecurityOptions securityOptions = new GetSecurityOptions.Builder() .db("products") .build(); Security response = service.getSecurity(securityOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.getSecurity({ db: 'products' }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.get_security( db='products' ).get_result() print(response)
Response
Schema for a security document.
Schema for names and roles to map to a database permission.
Database permissions for Cloudant users and/or API keys.
- cloudant
Schema for a security role.
Possible values: [
_reader
,_writer
,_admin
,_replicator
,_db_updates
,_design
,_shards
,_security
]Possible values: 0 ≤ number of items ≤ 65535
Manage permissions using the
_users
database only.Schema for names and roles to map to a database permission.
Schema for a security document.
Schema for names and roles to map to a database permission.
- Admins
List of usernames.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
List of roles.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 238, Value must match regular expression
/^.+$/
Database permissions for Cloudant users and/or API keys.
Possible values: [
_reader
,_writer
,_admin
,_replicator
,_db_updates
,_design
,_shards
,_security
]Possible values: 0 ≤ number of items ≤ 65535
Manage permissions using the
_users
database only.Schema for names and roles to map to a database permission.
- Members
List of usernames.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
List of roles.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 238, Value must match regular expression
/^.+$/
Schema for a security document.
Schema for names and roles to map to a database permission.
- admins
List of usernames.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
List of roles.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 238, Value must match regular expression
/^.+$/
Database permissions for Cloudant users and/or API keys.
Possible values: [
_reader
,_writer
,_admin
,_replicator
,_db_updates
,_design
,_shards
,_security
]Possible values: 0 ≤ number of items ≤ 65535
Manage permissions using the
_users
database only.Schema for names and roles to map to a database permission.
- members
List of usernames.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
List of roles.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 238, Value must match regular expression
/^.+$/
Schema for a security document.
Schema for names and roles to map to a database permission.
- admins
List of usernames.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
List of roles.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 238, Value must match regular expression
/^.+$/
Database permissions for Cloudant users and/or API keys.
Possible values: [
_reader
,_writer
,_admin
,_replicator
,_db_updates
,_design
,_shards
,_security
]Possible values: 0 ≤ number of items ≤ 65535
Manage permissions using the
_users
database only.Schema for names and roles to map to a database permission.
- members
List of usernames.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
List of roles.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 238, Value must match regular expression
/^.+$/
Schema for a security document.
Schema for names and roles to map to a database permission.
- admins
List of usernames.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
List of roles.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 238, Value must match regular expression
/^.+$/
Database permissions for Cloudant users and/or API keys.
Possible values: [
_reader
,_writer
,_admin
,_replicator
,_db_updates
,_design
,_shards
,_security
]Possible values: 0 ≤ number of items ≤ 65535
Manage permissions using the
_users
database only.Schema for names and roles to map to a database permission.
- members
List of usernames.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
List of roles.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 238, Value must match regular expression
/^.+$/
Status Code
HTTP response for getSecurity and getCloudantSecurityInformation.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example Cloudant Security response.
{ "cloudant": { "nobody": [ "_replicator", "_reader" ] } }
Example Cloudant Security response.
{ "cloudant": { "nobody": [ "_replicator", "_reader" ] } }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve HTTP headers for database permissions information
Retrieves the HTTP headers for database permissions information. Since the response body is empty, using the HEAD method is a lightweight way to check if the current user has permission to access the database.
HEAD /{db}/_security
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for
/{db}/_security
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Modify database permissions
Modify who has permission to read, write, or manage a database. This endpoint can be used to modify both Cloudant and CouchDB related permissions. Be careful: by removing a Cloudant API key, a member or an admin from the list of users that have access permissions, you remove it from the list of users that have access to the database.
Note about nobody role
The nobody
username applies to all unauthenticated connection
attempts. For example, if an application tries to read data from a
database, but did not identify itself, the task can continue only if
the nobody
user has the role _reader
.
Modify who has permission to read, write, or manage a database. This endpoint can be used to modify both Cloudant and CouchDB related permissions. Be careful: by removing a Cloudant API key, a member or an admin from the list of users that have access permissions, you remove it from the list of users that have access to the database.
Note about nobody role
The nobody
username applies to all unauthenticated connection attempts. For example, if an application tries to read data from a database, but did not identify itself, the task can continue only if the nobody
user has the role _reader
.
Modify who has permission to read, write, or manage a database. This endpoint can be used to modify both Cloudant and CouchDB related permissions. Be careful: by removing a Cloudant API key, a member or an admin from the list of users that have access permissions, you remove it from the list of users that have access to the database.
Note about nobody role
The nobody
username applies to all unauthenticated connection attempts. For example, if an application tries to read data from a database, but did not identify itself, the task can continue only if the nobody
user has the role _reader
.
Modify who has permission to read, write, or manage a database. This endpoint can be used to modify both Cloudant and CouchDB related permissions. Be careful: by removing a Cloudant API key, a member or an admin from the list of users that have access permissions, you remove it from the list of users that have access to the database.
Note about nobody role
The nobody
username applies to all unauthenticated connection attempts. For example, if an application tries to read data from a database, but did not identify itself, the task can continue only if the nobody
user has the role _reader
.
Modify who has permission to read, write, or manage a database. This endpoint can be used to modify both Cloudant and CouchDB related permissions. Be careful: by removing a Cloudant API key, a member or an admin from the list of users that have access permissions, you remove it from the list of users that have access to the database.
Note about nobody role
The nobody
username applies to all unauthenticated connection attempts. For example, if an application tries to read data from a database, but did not identify itself, the task can continue only if the nobody
user has the role _reader
.
PUT /{db}/_security
(cloudant *CloudantV1) PutSecurity(putSecurityOptions *PutSecurityOptions) (result *Ok, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PutSecurityWithContext(ctx context.Context, putSecurityOptions *PutSecurityOptions) (result *Ok, response *core.DetailedResponse, err error)
ServiceCall<Ok> putSecurity(PutSecurityOptions putSecurityOptions)
putSecurity(params)
put_security(
self,
db: str,
*,
admins: Optional['SecurityObject'] = None,
cloudant: Optional[dict] = None,
couchdb_auth_only: Optional[bool] = None,
members: Optional['SecurityObject'] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the PutSecurityOptions
struct and set the fields to provide parameter values for the PutSecurity
method.
Use the PutSecurityOptions.Builder
to create a PutSecurityOptions
object that contains the parameter values for the putSecurity
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
HTTP request body for putSecurity.
Example Security document.
{
"admins": {
"names": [
"superuser"
],
"roles": [
"admins"
]
},
"members": {
"names": [
"user1",
"user2"
],
"roles": [
"developers"
]
}
}
Schema for names and roles to map to a database permission.
Database permissions for Cloudant users and/or API keys.
- cloudant
Schema for a security role.
Allowable values: [
_reader
,_writer
,_admin
,_replicator
,_db_updates
,_design
,_shards
,_security
]Possible values: 0 ≤ number of items ≤ 65535
Manage permissions using the
_users
database only.Schema for names and roles to map to a database permission.
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The PutSecurity options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Schema for names and roles to map to a database permission.
Examples:{ "names": [ "superuser" ], "roles": [ "admins" ] }
- Admins
List of usernames.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
List of roles.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 238, Value must match regular expression
/^.+$/
Database permissions for Cloudant users and/or API keys.
Allowable values: [
_reader
,_writer
,_admin
,_replicator
,_db_updates
,_design
,_shards
,_security
]Possible values: 0 ≤ number of items ≤ 65535
Manage permissions using the
_users
database only.Schema for names and roles to map to a database permission.
Examples:{ "names": [ "user1", "user2" ], "roles": [ "developers" ] }
- Members
List of usernames.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
List of roles.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 238, Value must match regular expression
/^.+$/
The putSecurity options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Schema for names and roles to map to a database permission.
Examples:{ "names": [ "superuser" ], "roles": [ "admins" ] }
- admins
List of usernames.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
List of roles.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 238, Value must match regular expression
/^.+$/
Database permissions for Cloudant users and/or API keys.
Allowable values: [
_reader
,_writer
,_admin
,_replicator
,_db_updates
,_design
,_shards
,_security
]Possible values: 0 ≤ number of items ≤ 65535
Manage permissions using the
_users
database only.Schema for names and roles to map to a database permission.
Examples:{ "names": [ "user1", "user2" ], "roles": [ "developers" ] }
- members
List of usernames.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
List of roles.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 238, Value must match regular expression
/^.+$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Schema for names and roles to map to a database permission.
- admins
List of usernames.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
List of roles.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 238, Value must match regular expression
/^.+$/
Database permissions for Cloudant users and/or API keys.
Allowable values: [
_reader
,_writer
,_admin
,_replicator
,_db_updates
,_design
,_shards
,_security
]Possible values: 0 ≤ number of items ≤ 65535
Manage permissions using the
_users
database only.Schema for names and roles to map to a database permission.
- members
List of usernames.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
List of roles.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 238, Value must match regular expression
/^.+$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Schema for names and roles to map to a database permission.
- admins
List of usernames.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
List of roles.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 238, Value must match regular expression
/^.+$/
Database permissions for Cloudant users and/or API keys.
Allowable values: [
_reader
,_writer
,_admin
,_replicator
,_db_updates
,_design
,_shards
,_security
]Possible values: 0 ≤ number of items ≤ 65535
Manage permissions using the
_users
database only.Schema for names and roles to map to a database permission.
- members
List of usernames.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
List of roles.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 238, Value must match regular expression
/^.+$/
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X PUT "$SERVICE_URL/products/_security" -H "Content-Type: application/json" --data '{ "members": { "names": [ "user1", "user2" ], "roles": [ "developers" ] } }'
The
nobody
username applies to all unauthenticated connection attempts. For example, if an application tries to read data from a database, but didn't identify itself, the task can continue only if thenobody
user has the role_reader
.If instead of using Cloudant's security model for managing permissions you opt to use the Apache CouchDB
_users
database (that is using legacy credentials and thecouchdb_auth_only:true
option) then be aware that the user must already exist in_users
database before adding permissions. For information on the_users
database, see Using the_users
database with Cloudant.
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } putSecurityOptions := service.NewPutSecurityOptions( "products", ) putSecurityOptions.SetMembers(&cloudantv1.SecurityObject{ Names: []string{"user1", "user2"}, Roles: []string{"developers"}, }) ok, response, err := service.PutSecurity(putSecurityOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(ok, "", " ") fmt.Println(string(b))
The
nobody
username applies to all unauthenticated connection attempts. For example, if an application tries to read data from a database, but didn't identify itself, the task can continue only if thenobody
user has the role_reader
.If instead of using Cloudant's security model for managing permissions you opt to use the Apache CouchDB
_users
database (that is using legacy credentials and thecouchdb_auth_only:true
option) then be aware that the user must already exist in_users
database before adding permissions. For information on the_users
database, see Using the_users
database with Cloudant.
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.Ok; import com.ibm.cloud.cloudant.v1.model.PutSecurityOptions; import com.ibm.cloud.cloudant.v1.model.SecurityObject; import java.util.Arrays;
Cloudant service = Cloudant.newInstance(); SecurityObject members = new SecurityObject.Builder() .names(Arrays.asList("user1", "user2")) .roles(Arrays.asList("developers")) .build(); PutSecurityOptions securityOptions = new PutSecurityOptions.Builder() .db("products") .members(members) .build(); Ok response = service.putSecurity(securityOptions).execute() .getResult(); System.out.println(response);
The
nobody
username applies to all unauthenticated connection attempts. For example, if an application tries to read data from a database, but didn't identify itself, the task can continue only if thenobody
user has the role_reader
.If instead of using Cloudant's security model for managing permissions you opt to use the Apache CouchDB
_users
database (that is using legacy credentials and thecouchdb_auth_only:true
option) then be aware that the user must already exist in_users
database before adding permissions. For information on the_users
database, see Using the_users
database with Cloudant.
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); const members: CloudantV1.SecurityObject = { names: ['user1', 'user2'], roles: ['developers'] }; service.putSecurity({ db: 'products', members: members }).then(response => { console.log(response.result); });
The
nobody
username applies to all unauthenticated connection attempts. For example, if an application tries to read data from a database, but didn't identify itself, the task can continue only if thenobody
user has the role_reader
.If instead of using Cloudant's security model for managing permissions you opt to use the Apache CouchDB
_users
database (that is using legacy credentials and thecouchdb_auth_only:true
option) then be aware that the user must already exist in_users
database before adding permissions. For information on the_users
database, see Using the_users
database with Cloudant.
from ibmcloudant.cloudant_v1 import CloudantV1, SecurityObject service = CloudantV1.new_instance() members = SecurityObject( names=['user1', 'user2'], roles=['developers'] ) response = service.put_security( db='products', members=members ).get_result() print(response)
The
nobody
username applies to all unauthenticated connection attempts. For example, if an application tries to read data from a database, but didn't identify itself, the task can continue only if thenobody
user has the role_reader
.If instead of using Cloudant's security model for managing permissions you opt to use the Apache CouchDB
_users
database (that is using legacy credentials and thecouchdb_auth_only:true
option) then be aware that the user must already exist in_users
database before adding permissions. For information on the_users
database, see Using the_users
database with Cloudant.
Response
Schema for an OK result.
ok
Schema for an OK result.
ok.
Schema for an OK result.
ok.
Schema for an OK result.
ok.
Schema for an OK result.
ok.
Status Code
HTTP response for Ok operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example Ok response.
{ "ok": true }
Example Ok response.
{ "ok": true }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request with a document size that exceeds the allowable limit.
{ "error": "document_too_large", "reason": "doc_id" }
Example error response for a request with a document size that exceeds the allowable limit.
{ "error": "document_too_large", "reason": "doc_id" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve CORS configuration information
Lists all Cross-origin resource sharing (CORS) configuration. CORS defines a way in which the browser and the server interact to determine whether or not to allow the request.
Lists all Cross-origin resource sharing (CORS) configuration. CORS defines a way in which the browser and the server interact to determine whether or not to allow the request.
Lists all Cross-origin resource sharing (CORS) configuration. CORS defines a way in which the browser and the server interact to determine whether or not to allow the request.
Lists all Cross-origin resource sharing (CORS) configuration. CORS defines a way in which the browser and the server interact to determine whether or not to allow the request.
Lists all Cross-origin resource sharing (CORS) configuration. CORS defines a way in which the browser and the server interact to determine whether or not to allow the request.
GET /_api/v2/user/config/cors
(cloudant *CloudantV1) GetCorsInformation(getCorsInformationOptions *GetCorsInformationOptions) (result *CorsInformation, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) GetCorsInformationWithContext(ctx context.Context, getCorsInformationOptions *GetCorsInformationOptions) (result *CorsInformation, response *core.DetailedResponse, err error)
ServiceCall<CorsInformation> getCorsInformation()
getCorsInformation(params)
get_cors_information(
self,
**kwargs,
) -> DetailedResponse
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
No Request Parameters
No Request Parameters
No Request Parameters
No Request Parameters
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/_api/v2/user/config/cors"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } getCorsInformationOptions := service.NewGetCorsInformationOptions() corsConfiguration, response, err := service.GetCorsInformation(getCorsInformationOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(corsConfiguration, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.CorsInformation;
Cloudant service = Cloudant.newInstance(); CorsInformation response = service.getCorsInformation().execute().getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.getCorsInformation().then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.get_cors_information().get_result() print(response)
Response
Schema for information about the CORS configuration.
Boolean value to allow authentication credentials. If set to true, browser requests must be done by using withCredentials = true.
Boolean value to turn CORS on and off.
An array of strings that contain allowed origin domains. You have to specify the full URL including the protocol. It is recommended that only the HTTPS protocol is used. Subdomains count as separate domains, so you have to specify all subdomains used.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^http(s)?:\/\/.*$
Schema for information about the CORS configuration.
Boolean value to allow authentication credentials. If set to true, browser requests must be done by using withCredentials = true.
Boolean value to turn CORS on and off.
An array of strings that contain allowed origin domains. You have to specify the full URL including the protocol. It is recommended that only the HTTPS protocol is used. Subdomains count as separate domains, so you have to specify all subdomains used.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^http(s)?:\/\/.*$/
Schema for information about the CORS configuration.
Boolean value to allow authentication credentials. If set to true, browser requests must be done by using withCredentials = true.
Boolean value to turn CORS on and off.
An array of strings that contain allowed origin domains. You have to specify the full URL including the protocol. It is recommended that only the HTTPS protocol is used. Subdomains count as separate domains, so you have to specify all subdomains used.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^http(s)?:\/\/.*$/
Schema for information about the CORS configuration.
Boolean value to allow authentication credentials. If set to true, browser requests must be done by using withCredentials = true.
Boolean value to turn CORS on and off.
An array of strings that contain allowed origin domains. You have to specify the full URL including the protocol. It is recommended that only the HTTPS protocol is used. Subdomains count as separate domains, so you have to specify all subdomains used.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^http(s)?:\/\/.*$/
Schema for information about the CORS configuration.
Boolean value to allow authentication credentials. If set to true, browser requests must be done by using withCredentials = true.
Boolean value to turn CORS on and off.
An array of strings that contain allowed origin domains. You have to specify the full URL including the protocol. It is recommended that only the HTTPS protocol is used. Subdomains count as separate domains, so you have to specify all subdomains used.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^http(s)?:\/\/.*$/
Status Code
HTTP response for getCorsInformation.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example CorsConfiguration request.
{ "allow_credentials": true, "enable_cors": true, "origins": [ "https://example.com", "https://www.example.com" ] }
Example CorsConfiguration request.
{ "allow_credentials": true, "enable_cors": true, "origins": [ "https://example.com", "https://www.example.com" ] }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Modify CORS configuration
Sets the CORS configuration. The configuration applies to all databases and all account level endpoints in your account.
Sets the CORS configuration. The configuration applies to all databases and all account level endpoints in your account.
Sets the CORS configuration. The configuration applies to all databases and all account level endpoints in your account.
Sets the CORS configuration. The configuration applies to all databases and all account level endpoints in your account.
Sets the CORS configuration. The configuration applies to all databases and all account level endpoints in your account.
PUT /_api/v2/user/config/cors
(cloudant *CloudantV1) PutCorsConfiguration(putCorsConfigurationOptions *PutCorsConfigurationOptions) (result *Ok, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PutCorsConfigurationWithContext(ctx context.Context, putCorsConfigurationOptions *PutCorsConfigurationOptions) (result *Ok, response *core.DetailedResponse, err error)
ServiceCall<Ok> putCorsConfiguration(PutCorsConfigurationOptions putCorsConfigurationOptions)
putCorsConfiguration(params)
put_cors_configuration(
self,
origins: List[str],
*,
allow_credentials: Optional[bool] = None,
enable_cors: Optional[bool] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the PutCorsConfigurationOptions
struct and set the fields to provide parameter values for the PutCorsConfiguration
method.
Use the PutCorsConfigurationOptions.Builder
to create a PutCorsConfigurationOptions
object that contains the parameter values for the putCorsConfiguration
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
HTTP request body for putCorsConfiguration.
Example CorsConfiguration request.
{
"allow_credentials": true,
"enable_cors": true,
"origins": [
"https://example.com",
"https://www.example.com"
]
}
An array of strings that contain allowed origin domains. You have to specify the full URL including the protocol. It is recommended that only the HTTPS protocol is used. Subdomains count as separate domains, so you have to specify all subdomains used.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^http(s)?:\/\/.*$
Boolean value to allow authentication credentials. If set to true, browser requests must be done by using withCredentials = true.
Default:
true
Boolean value to turn CORS on and off.
Default:
true
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The PutCorsConfiguration options.
An array of strings that contain allowed origin domains. You have to specify the full URL including the protocol. It is recommended that only the HTTPS protocol is used. Subdomains count as separate domains, so you have to specify all subdomains used.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^http(s)?:\/\/.*$/
Examples:[ "https://example.com", "https://www.example.com" ]
Boolean value to allow authentication credentials. If set to true, browser requests must be done by using withCredentials = true.
Default:
true
Examples:true
Boolean value to turn CORS on and off.
Default:
true
Examples:true
The putCorsConfiguration options.
An array of strings that contain allowed origin domains. You have to specify the full URL including the protocol. It is recommended that only the HTTPS protocol is used. Subdomains count as separate domains, so you have to specify all subdomains used.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^http(s)?:\/\/.*$/
Examples:[ "https://example.com", "https://www.example.com" ]
Boolean value to allow authentication credentials. If set to true, browser requests must be done by using withCredentials = true.
Default:
true
Examples:true
Boolean value to turn CORS on and off.
Default:
true
Examples:true
parameters
An array of strings that contain allowed origin domains. You have to specify the full URL including the protocol. It is recommended that only the HTTPS protocol is used. Subdomains count as separate domains, so you have to specify all subdomains used.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^http(s)?:\/\/.*$/
Examples:Boolean value to allow authentication credentials. If set to true, browser requests must be done by using withCredentials = true.
Default:
true
Examples:Boolean value to turn CORS on and off.
Default:
true
Examples:
parameters
An array of strings that contain allowed origin domains. You have to specify the full URL including the protocol. It is recommended that only the HTTPS protocol is used. Subdomains count as separate domains, so you have to specify all subdomains used.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
/^http(s)?:\/\/.*$/
Examples:Boolean value to allow authentication credentials. If set to true, browser requests must be done by using withCredentials = true.
Default:
true
Examples:Boolean value to turn CORS on and off.
Default:
true
Examples:
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X PUT "$SERVICE_URL/_api/v2/user/config/cors" -H "Content-Type: application/json" --data '{ "enable_cors": true, "origins": [ "https://example.com" ] }'
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } putCorsConfigurationOptions := service.NewPutCorsConfigurationOptions([]string{ "https://example.com", }) putCorsConfigurationOptions.SetEnableCors(true) ok, response, err := service.PutCorsConfiguration(putCorsConfigurationOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(ok, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.Ok; import com.ibm.cloud.cloudant.v1.model.PutCorsConfigurationOptions;
Cloudant service = Cloudant.newInstance(); PutCorsConfigurationOptions configurationOptions = new PutCorsConfigurationOptions.Builder() .addOrigins("https://example.com") .enableCors(true) .build(); Ok response = service.putCorsConfiguration(configurationOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.putCorsConfiguration({ enableCors: true, origins: ['https://example.com'] }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.put_cors_configuration( enable_cors=True, origins=['https://example.com'] ).get_result() print(response)
Response
Schema for an OK result.
ok
Schema for an OK result.
ok.
Schema for an OK result.
ok.
Schema for an OK result.
ok.
Schema for an OK result.
ok.
Status Code
HTTP response for Ok operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example Ok response.
{ "ok": true }
Example Ok response.
{ "ok": true }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Delete a design document attachment
This operation deletes the attachment with filename {attachment_name}
of the specified doc. You must supply the rev
query parameter or If-Match
parameter with the current revision to delete the attachment.
DELETE /{db}/_design/{ddoc}/{attachment_name}
Request
Custom Headers
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
^"[A-Za-z0-9+\/]{2,24}={0,3}"$|^"[1-9]\d{0,9}-[\da-f]{32}"$|^"[0-9A-Z]{25}"$
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Path parameter to specify the attachment name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].*$
Query Parameters
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X DELETE "$SERVICE_URL/products/_design/example/attachment.txt?rev=2-1a0d1cd6f40472509e9aac646183736c"
This example requires the
attachment.txt
attachment in_design/appliances
document to exist. To create the attachment, see Create or modify an attachment.
Response
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
ok
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Status Code
HTTP response for Document modification operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for conflict.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for a document update conflict.
{ "error": "conflict", "reason": "Document update conflict." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve a design document attachment
Returns the file attachment associated with the document. The raw data of the associated attachment is returned (just as if you were accessing a static file). The returned Content-Type is the same as the content type set when the document attachment was submitted to the database.
GET /{db}/_design/{ddoc}/{attachment_name}
Request
Custom Headers
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
^"[A-Za-z0-9+\/]{2,24}={0,3}"$|^"[1-9]\d{0,9}-[\da-f]{32}"$|^"[0-9A-Z]{25}"$
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
^"[A-Za-z0-9+\/]{2,24}={0,3}"$|^"[1-9]\d{0,9}-[\da-f]{32}"$|^"[0-9A-Z]{25}"$
Header parameter to specify the byte range for a request. This allows the implementation of resumable downloads and skippable streams. This is available for all attachments inside CouchDB.
Possible values: 7 ≤ length ≤ 23, Value must match regular expression
^bytes=(?:-\d+)|(?:\d+-)|(?:\d+-\d+)(?:,\d+-\d+)*$
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Path parameter to specify the attachment name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].*$
Query Parameters
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/products/_design/example/attachment.txt"
This example requires the
attachment.txt
attachment in_design/appliances
document to exist. To create the attachment, see Create or modify an attachment.
Response
Schema for the data in an attachment.
Status Code
HTTP response for Attachment.
HTTP response for Attachment.
HTTP response for not modified client redirect.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example AttachmentContent request and response.
This appliance includes...
Example AttachmentContent request and response.
This appliance includes...
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve the HTTP headers for a design document attachment
Returns the HTTP headers that contain a minimal amount of information about the specified attachment. The method supports the same query arguments as the GET /{db}/{doc_id}/{attachment_name}
method, but only the header information (including attachment size, encoding, and the MD5 hash as an ETag), is returned.
HEAD /{db}/_design/{ddoc}/{attachment_name}
Request
Custom Headers
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
^"[A-Za-z0-9+\/]{2,24}={0,3}"$|^"[1-9]\d{0,9}-[\da-f]{32}"$|^"[0-9A-Z]{25}"$
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
^"[A-Za-z0-9+\/]{2,24}={0,3}"$|^"[1-9]\d{0,9}-[\da-f]{32}"$|^"[0-9A-Z]{25}"$
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Path parameter to specify the attachment name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].*$
Query Parameters
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
curl -H "Authorization: Bearer $API_BEARER_TOKEN" --head "$SERVICE_URL/products/_design/example/attachment.txt"
This example requires the
attachment.txt
attachment in_design/appliances
document to exist. To create the attachment, see Create or modify an attachment.
Response
Response Headers
Header returning the range information for making range requests with application/octet-stream attachments.
Possible values: 4 ≤ length ≤ 5, Value must match regular expression
^(bytes|none)$
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the MD5 digest value of the message body. Can be used for message-integrity check.
Possible values: length = 24, Value must match regular expression
^[-A-Za-z0-9+\/]{22}={2}$
Response header in the form of
bytes <range>/<total content length>
returning the bytes requested by theRange
header supplied on the request and the total range.Possible values: 9 ≤ length ≤ 23, Value must match regular expression
^.+$
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the ETag for a resource.
Examples:Double quoted base64 encoded attachment digest.
"MEHlNHhicVt9efOzyvsz0Q=="
Double quoted document revision identifier.
"2-240fc93fad07083c338c7e0ea55791b3"
Double quoted local document tag.
"6APCCGX4B76OFFD5972MSBFHD"
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for Attachment.
HTTP response for Attachment.
HTTP response for not modified client redirect.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Create or modify a design document attachment
This operation uploads the supplied content as an attachment to the specified document. The attachment name provided must be a URL encoded string. You must supply the Content-Type header, and for an existing document, you must also supply either the rev
query argument or the If-Match
HTTP header. If the revision is omitted, a new, otherwise empty, document is created with the provided attachment, or a conflict occurs. If the uploaded attachment uses an existing attachment name in the remote database, it updates the corresponding stored content of the database. Since you must supply the revision information to add an attachment to the document, this serves as validation to update the existing attachment.
PUT /{db}/_design/{ddoc}/{attachment_name}
Request
Custom Headers
Content-Type of the attachment.
Allowable values: [
*/*
]Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
^"[A-Za-z0-9+\/]{2,24}={0,3}"$|^"[1-9]\d{0,9}-[\da-f]{32}"$|^"[0-9A-Z]{25}"$
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the design document name. The design document name is the design document ID excluding the
_design/
prefix.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Path parameter to specify the attachment name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].*$
Query Parameters
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
HTTP request body for attachment operations.
Example: This appliance includes...
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X PUT "$SERVICE_URL/products/_design/example/attachment.txt" -H "Content-Type: text/plain" --data 'New text attachment'
Response
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
ok
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Status Code
HTTP response for Document modification operations.
HTTP response for Document modification operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for conflict.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for a document update conflict.
{ "error": "conflict", "reason": "Document update conflict." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request with an attachment size that exceeds the allowable limit.
{ "error": "attachment_too_large", "reason": "attachment_name" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Delete an attachment
Deletes the attachment with the filename, {attachment_name}
, from the specified doc. You must supply the rev
query parameter or If-Match
header with the current revision to delete the attachment.
Deletes the attachment with the filename, {attachment_name}
, from the specified doc. You must supply the rev
query parameter or If-Match
header with the current revision to delete the attachment.
Deletes the attachment with the filename, {attachment_name}
, from the specified doc. You must supply the rev
query parameter or If-Match
header with the current revision to delete the attachment.
Deletes the attachment with the filename, {attachment_name}
, from the specified doc. You must supply the rev
query parameter or If-Match
header with the current revision to delete the attachment.
Deletes the attachment with the filename, {attachment_name}
, from the specified doc. You must supply the rev
query parameter or If-Match
header with the current revision to delete the attachment.
DELETE /{db}/{doc_id}/{attachment_name}
(cloudant *CloudantV1) DeleteAttachment(deleteAttachmentOptions *DeleteAttachmentOptions) (result *DocumentResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) DeleteAttachmentWithContext(ctx context.Context, deleteAttachmentOptions *DeleteAttachmentOptions) (result *DocumentResult, response *core.DetailedResponse, err error)
ServiceCall<DocumentResult> deleteAttachment(DeleteAttachmentOptions deleteAttachmentOptions)
deleteAttachment(params)
delete_attachment(
self,
db: str,
doc_id: str,
attachment_name: str,
*,
if_match: Optional[str] = None,
rev: Optional[str] = None,
batch: Optional[str] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the DeleteAttachmentOptions
struct and set the fields to provide parameter values for the DeleteAttachment
method.
Use the DeleteAttachmentOptions.Builder
to create a DeleteAttachmentOptions
object that contains the parameter values for the deleteAttachment
method.
Custom Headers
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
^"[A-Za-z0-9+\/]{2,24}={0,3}"$|^"[1-9]\d{0,9}-[\da-f]{32}"$|^"[0-9A-Z]{25}"$
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Path parameter to specify the attachment name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].*$
Query Parameters
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The DeleteAttachment options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the attachment name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]
The deleteAttachment options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the attachment name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the attachment name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the attachment name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X DELETE "$SERVICE_URL/products/small-appliances:100001/product_details.txt?rev=4-1a0d1cd6f40472509e9aac646183736a"
This example requires the
product_details.txt
attachment insmall-appliances:100001
document to exist. To create the attachment, see Create or modify an attachment.
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } deleteAttachmentOptions := service.NewDeleteAttachmentOptions( "products", "1000042", "product_details.txt", ) deleteAttachmentOptions.SetRev("4-1a0d1cd6f40472509e9aac646183736a") documentResult, response, err := service.DeleteAttachment(deleteAttachmentOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(documentResult, "", " ") fmt.Println(string(b))
This example requires the
product_details.txt
attachment in1000042
document to exist. To create the attachment, see Create or modify an attachment.
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.DeleteAttachmentOptions; import com.ibm.cloud.cloudant.v1.model.DocumentResult;
Cloudant service = Cloudant.newInstance(); DeleteAttachmentOptions attachmentOptions = new DeleteAttachmentOptions.Builder() .db("products") .docId("1000042") .attachmentName("product_details.txt") .rev("4-1a0d1cd6f40472509e9aac646183736a") .build(); DocumentResult response = service.deleteAttachment(attachmentOptions).execute() .getResult(); System.out.println(response);
This example requires the
product_details.txt
attachment in1000042
document to exist. To create the attachment, see Create or modify an attachment.
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.deleteAttachment({ db: 'products', docId: '1000042', attachmentName: 'product_details.txt', rev: '4-1a0d1cd6f40472509e9aac646183736a' }).then(response => { console.log(response.result); });
This example requires the
product_details.txt
attachment in1000042
document to exist. To create the attachment, see Create or modify an attachment.
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.delete_attachment( db='products', doc_id='1000042', attachment_name='product_details.txt', rev='4-1a0d1cd6f40472509e9aac646183736a' ).get_result() print(response)
This example requires the
product_details.txt
attachment in1000042
document to exist. To create the attachment, see Create or modify an attachment.
Response
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
ok
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Status Code
HTTP response for Document modification operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for conflict.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for a document update conflict.
{ "error": "conflict", "reason": "Document update conflict." }
Example error response for a document update conflict.
{ "error": "conflict", "reason": "Document update conflict." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve an attachment
Returns the file attachment that is associated with the document. The raw data of the associated attachment is returned, just as if you were accessing a static file. The returned Content-Type header is the same as the content type set when the document attachment was submitted to the database.
Returns the file attachment that is associated with the document. The raw data of the associated attachment is returned, just as if you were accessing a static file. The returned Content-Type header is the same as the content type set when the document attachment was submitted to the database.
Returns the file attachment that is associated with the document. The raw data of the associated attachment is returned, just as if you were accessing a static file. The returned Content-Type header is the same as the content type set when the document attachment was submitted to the database.
Returns the file attachment that is associated with the document. The raw data of the associated attachment is returned, just as if you were accessing a static file. The returned Content-Type header is the same as the content type set when the document attachment was submitted to the database.
Returns the file attachment that is associated with the document. The raw data of the associated attachment is returned, just as if you were accessing a static file. The returned Content-Type header is the same as the content type set when the document attachment was submitted to the database.
GET /{db}/{doc_id}/{attachment_name}
(cloudant *CloudantV1) GetAttachment(getAttachmentOptions *GetAttachmentOptions) (result io.ReadCloser, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) GetAttachmentWithContext(ctx context.Context, getAttachmentOptions *GetAttachmentOptions) (result io.ReadCloser, response *core.DetailedResponse, err error)
ServiceCall<InputStream> getAttachment(GetAttachmentOptions getAttachmentOptions)
getAttachment(params)
get_attachment(
self,
db: str,
doc_id: str,
attachment_name: str,
*,
if_match: Optional[str] = None,
if_none_match: Optional[str] = None,
range: Optional[str] = None,
rev: Optional[str] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the GetAttachmentOptions
struct and set the fields to provide parameter values for the GetAttachment
method.
Use the GetAttachmentOptions.Builder
to create a GetAttachmentOptions
object that contains the parameter values for the getAttachment
method.
Custom Headers
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
^"[A-Za-z0-9+\/]{2,24}={0,3}"$|^"[1-9]\d{0,9}-[\da-f]{32}"$|^"[0-9A-Z]{25}"$
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
^"[A-Za-z0-9+\/]{2,24}={0,3}"$|^"[1-9]\d{0,9}-[\da-f]{32}"$|^"[0-9A-Z]{25}"$
Header parameter to specify the byte range for a request. This allows the implementation of resumable downloads and skippable streams. This is available for all attachments inside CouchDB.
Possible values: 7 ≤ length ≤ 23, Value must match regular expression
^bytes=(?:-\d+)|(?:\d+-)|(?:\d+-\d+)(?:,\d+-\d+)*$
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Path parameter to specify the attachment name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].*$
Query Parameters
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The GetAttachment options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the attachment name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
The type of the response: /.
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Header parameter to specify the byte range for a request. This allows the implementation of resumable downloads and skippable streams. This is available for all attachments inside CouchDB.
Possible values: 7 ≤ length ≤ 23, Value must match regular expression
/^bytes=(?:-\\d+)|(?:\\d+-)|(?:\\d+-\\d+)(?:,\\d+-\\d+)*$/
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
The getAttachment options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the attachment name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
The type of the response: /.
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Header parameter to specify the byte range for a request. This allows the implementation of resumable downloads and skippable streams. This is available for all attachments inside CouchDB.
Possible values: 7 ≤ length ≤ 23, Value must match regular expression
/^bytes=(?:-\\d+)|(?:\\d+-)|(?:\\d+-\\d+)(?:,\\d+-\\d+)*$/
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the attachment name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
The type of the response: /.
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Header parameter to specify the byte range for a request. This allows the implementation of resumable downloads and skippable streams. This is available for all attachments inside CouchDB.
Possible values: 7 ≤ length ≤ 23, Value must match regular expression
/^bytes=(?:-\\d+)|(?:\\d+-)|(?:\\d+-\\d+)(?:,\\d+-\\d+)*$/
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the attachment name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Header parameter to specify the byte range for a request. This allows the implementation of resumable downloads and skippable streams. This is available for all attachments inside CouchDB.
Possible values: 7 ≤ length ≤ 23, Value must match regular expression
/^bytes=(?:-\\d+)|(?:\\d+-)|(?:\\d+-\\d+)(?:,\\d+-\\d+)*$/
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/products/small-appliances:100001/product_details.txt"
This example requires the
product_details.txt
attachment insmall-appliances:100001
document to exist. To create the attachment, see Create or modify an attachment.
import ( "encoding/json" "fmt" "io" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } getAttachmentOptions := service.NewGetAttachmentOptions( "products", "1000042", "product_details.txt", ) result, response, err := service.GetAttachment(getAttachmentOptions) if err != nil { panic(err) } data, _ := io.ReadAll(result) fmt.Println("\n", string(data))
This example requires the
product_details.txt
attachment in1000042
document to exist. To create the attachment, see Create or modify an attachment.
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.GetAttachmentOptions; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.util.stream.Collectors;
Cloudant service = Cloudant.newInstance(); GetAttachmentOptions attachmentOptions = new GetAttachmentOptions.Builder() .db("products") .docId("1000042") .attachmentName("product_details.txt") .build(); try(InputStream streamResult = service.getAttachment(attachmentOptions).execute() .getResult()) { String response = new BufferedReader(new InputStreamReader(streamResult)) .lines().collect(Collectors.joining("\n")); System.out.println(response); }
This example requires the
product_details.txt
attachment in1000042
document to exist. To create the attachment, see Create or modify an attachment.
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.getAttachment({ db: 'products', docId: '1000042', attachmentName: 'product_details.txt' }).then(response => { let attachment = response.result as Readable; attachment.pipe(process.stdout); });
This example requires the
product_details.txt
attachment in1000042
document to exist. To create the attachment, see Create or modify an attachment.
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response_attachment = service.get_attachment( db='products', doc_id='1000042', attachment_name='product_details.txt' ).get_result().content print(response_attachment)
This example requires the
product_details.txt
attachment in1000042
document to exist. To create the attachment, see Create or modify an attachment.
Response
Response type: io.ReadCloser
Response type: InputStream
Response type: NodeJS.ReadableStream
Response type: BinaryIO
Schema for the data in an attachment.
Status Code
HTTP response for Attachment.
HTTP response for Attachment.
HTTP response for not modified client redirect.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for range not satisfiable.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example AttachmentContent request and response.
This appliance includes...
Example AttachmentContent request and response.
This appliance includes...
Example AttachmentContent request and response.
This appliance includes...
Example AttachmentContent request and response.
This appliance includes...
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for requested range not satisfiable.
{ "error": "requested_range_not_satisfiable", "reason": "Requested range not satisfiable" }
Example error response for requested range not satisfiable.
{ "error": "requested_range_not_satisfiable", "reason": "Requested range not satisfiable" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve the HTTP headers for an attachment
Returns the HTTP headers that contain a minimal amount of information about the specified attachment. This method supports the same query arguments as the GET /{db}/{doc_id}/{attachment_name}
method, but only the header information (including attachment size, encoding, and the MD5 hash as an ETag), is returned.
Returns the HTTP headers that contain a minimal amount of information about the specified attachment. This method supports the same query arguments as the GET /{db}/{doc_id}/{attachment_name}
method, but only the header information (including attachment size, encoding, and the MD5 hash as an ETag), is returned.
Returns the HTTP headers that contain a minimal amount of information about the specified attachment. This method supports the same query arguments as the GET /{db}/{doc_id}/{attachment_name}
method, but only the header information (including attachment size, encoding, and the MD5 hash as an ETag), is returned.
Returns the HTTP headers that contain a minimal amount of information about the specified attachment. This method supports the same query arguments as the GET /{db}/{doc_id}/{attachment_name}
method, but only the header information (including attachment size, encoding, and the MD5 hash as an ETag), is returned.
Returns the HTTP headers that contain a minimal amount of information about the specified attachment. This method supports the same query arguments as the GET /{db}/{doc_id}/{attachment_name}
method, but only the header information (including attachment size, encoding, and the MD5 hash as an ETag), is returned.
HEAD /{db}/{doc_id}/{attachment_name}
(cloudant *CloudantV1) HeadAttachment(headAttachmentOptions *HeadAttachmentOptions) (response *core.DetailedResponse, err error)
(cloudant *CloudantV1) HeadAttachmentWithContext(ctx context.Context, headAttachmentOptions *HeadAttachmentOptions) (response *core.DetailedResponse, err error)
ServiceCall<Void> headAttachment(HeadAttachmentOptions headAttachmentOptions)
headAttachment(params)
head_attachment(
self,
db: str,
doc_id: str,
attachment_name: str,
*,
if_match: Optional[str] = None,
if_none_match: Optional[str] = None,
rev: Optional[str] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the HeadAttachmentOptions
struct and set the fields to provide parameter values for the HeadAttachment
method.
Use the HeadAttachmentOptions.Builder
to create a HeadAttachmentOptions
object that contains the parameter values for the headAttachment
method.
Custom Headers
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
^"[A-Za-z0-9+\/]{2,24}={0,3}"$|^"[1-9]\d{0,9}-[\da-f]{32}"$|^"[0-9A-Z]{25}"$
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
^"[A-Za-z0-9+\/]{2,24}={0,3}"$|^"[1-9]\d{0,9}-[\da-f]{32}"$|^"[0-9A-Z]{25}"$
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Path parameter to specify the attachment name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].*$
Query Parameters
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The HeadAttachment options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the attachment name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
The headAttachment options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the attachment name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the attachment name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the attachment name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
curl -H "Authorization: Bearer $API_BEARER_TOKEN" --head "$SERVICE_URL/products/small-appliances:100001/product_details.txt"
This example requires the
product_details.txt
attachment insmall-appliances:100001
document to exist. To create the attachment, see Create or modify an attachment.
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } headAttachmentOptions := service.NewHeadAttachmentOptions( "products", "1000042", "product_details.txt", ) response, err := service.HeadAttachment(headAttachmentOptions) if err != nil { panic(err) } fmt.Println(response.StatusCode) fmt.Println(response.Headers["Content-Length"]) fmt.Println(response.Headers["Content-Type"])
This example requires the
product_details.txt
attachment in1000042
document to exist. To create the attachment, see Create or modify an attachment.
import com.ibm.cloud.sdk.core.http.Headers; import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.HeadAttachmentOptions;
Cloudant service = Cloudant.newInstance(); HeadAttachmentOptions attachmentOptions = new HeadAttachmentOptions.Builder() .db("products") .docId("1000042") .attachmentName("product_details.txt") .build(); int statusCode = service.headAttachment(attachmentOptions).execute() .getStatusCode(); Headers headers = service.headAttachment(attachmentOptions).execute() .getHeaders(); System.out.println(statusCode); System.out.println(headers.values("Content-Length")); System.out.println(headers.values("Content-Type"));
This example requires the
product_details.txt
attachment in1000042
document to exist. To create the attachment, see Create or modify an attachment.
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.headAttachment({ db: 'products', docId: '1000042', attachmentName: 'product_details.txt' }).then(response => { console.log(response.status); console.log(response.headers['Content-Length']); console.log(response.headers['Content-Type']); });
This example requires the
product_details.txt
attachment in1000042
document to exist. To create the attachment, see Create or modify an attachment.
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.head_attachment( db='products', doc_id='1000042', attachment_name='product_details.txt' ) print(response.get_status_code()) print(response.get_headers()['Content-Length']) print(response.get_headers()['Content-Type'])
This example requires the
product_details.txt
attachment in1000042
document to exist. To create the attachment, see Create or modify an attachment.
Response
Response Headers
Header returning the range information for making range requests with application/octet-stream attachments.
Possible values: 4 ≤ length ≤ 5, Value must match regular expression
^(bytes|none)$
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the MD5 digest value of the message body. Can be used for message-integrity check.
Possible values: length = 24, Value must match regular expression
^[-A-Za-z0-9+\/]{22}={2}$
Response header in the form of
bytes <range>/<total content length>
returning the bytes requested by theRange
header supplied on the request and the total range.Possible values: 9 ≤ length ≤ 23, Value must match regular expression
^.+$
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the ETag for a resource.
Examples:Double quoted base64 encoded attachment digest.
"MEHlNHhicVt9efOzyvsz0Q=="
Double quoted document revision identifier.
"2-240fc93fad07083c338c7e0ea55791b3"
Double quoted local document tag.
"6APCCGX4B76OFFD5972MSBFHD"
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for Attachment.
HTTP response for Attachment.
HTTP response for not modified client redirect.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for range not satisfiable.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Create or modify an attachment
Uploads the supplied content as an attachment to the specified document. The attachment name that you provide must be a URL encoded string. You must supply the Content-Type header, and for an existing document, you must also supply either the rev
query argument or the If-Match
HTTP header. If you omit the revision, a new, otherwise empty, document is created with the provided attachment, or a conflict occurs. If the uploaded attachment uses an existing attachment name in the remote database, it updates the corresponding stored content of the database. Since you must supply the revision information to add an attachment to the document, this serves as validation to update the existing attachment.
Uploads the supplied content as an attachment to the specified document. The attachment name that you provide must be a URL encoded string. You must supply the Content-Type header, and for an existing document, you must also supply either the rev
query argument or the If-Match
HTTP header. If you omit the revision, a new, otherwise empty, document is created with the provided attachment, or a conflict occurs. If the uploaded attachment uses an existing attachment name in the remote database, it updates the corresponding stored content of the database. Since you must supply the revision information to add an attachment to the document, this serves as validation to update the existing attachment.
Uploads the supplied content as an attachment to the specified document. The attachment name that you provide must be a URL encoded string. You must supply the Content-Type header, and for an existing document, you must also supply either the rev
query argument or the If-Match
HTTP header. If you omit the revision, a new, otherwise empty, document is created with the provided attachment, or a conflict occurs. If the uploaded attachment uses an existing attachment name in the remote database, it updates the corresponding stored content of the database. Since you must supply the revision information to add an attachment to the document, this serves as validation to update the existing attachment.
Uploads the supplied content as an attachment to the specified document. The attachment name that you provide must be a URL encoded string. You must supply the Content-Type header, and for an existing document, you must also supply either the rev
query argument or the If-Match
HTTP header. If you omit the revision, a new, otherwise empty, document is created with the provided attachment, or a conflict occurs. If the uploaded attachment uses an existing attachment name in the remote database, it updates the corresponding stored content of the database. Since you must supply the revision information to add an attachment to the document, this serves as validation to update the existing attachment.
Uploads the supplied content as an attachment to the specified document. The attachment name that you provide must be a URL encoded string. You must supply the Content-Type header, and for an existing document, you must also supply either the rev
query argument or the If-Match
HTTP header. If you omit the revision, a new, otherwise empty, document is created with the provided attachment, or a conflict occurs. If the uploaded attachment uses an existing attachment name in the remote database, it updates the corresponding stored content of the database. Since you must supply the revision information to add an attachment to the document, this serves as validation to update the existing attachment.
PUT /{db}/{doc_id}/{attachment_name}
(cloudant *CloudantV1) PutAttachment(putAttachmentOptions *PutAttachmentOptions) (result *DocumentResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PutAttachmentWithContext(ctx context.Context, putAttachmentOptions *PutAttachmentOptions) (result *DocumentResult, response *core.DetailedResponse, err error)
ServiceCall<DocumentResult> putAttachment(PutAttachmentOptions putAttachmentOptions)
putAttachment(params)
put_attachment(
self,
db: str,
doc_id: str,
attachment_name: str,
attachment: BinaryIO,
content_type: str,
*,
if_match: Optional[str] = None,
rev: Optional[str] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the PutAttachmentOptions
struct and set the fields to provide parameter values for the PutAttachment
method.
Use the PutAttachmentOptions.Builder
to create a PutAttachmentOptions
object that contains the parameter values for the putAttachment
method.
Custom Headers
Content-Type of the attachment.
Allowable values: [
*/*
]Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
^"[A-Za-z0-9+\/]{2,24}={0,3}"$|^"[1-9]\d{0,9}-[\da-f]{32}"$|^"[0-9A-Z]{25}"$
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Path parameter to specify the attachment name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].*$
Query Parameters
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
HTTP request body for attachment operations.
Example: This appliance includes...
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The PutAttachment options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the attachment name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
HTTP request body for attachment operations.
Examples:This appliance includes...
Content-Type of the attachment.
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
The putAttachment options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the attachment name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
HTTP request body for attachment operations.
Examples:This appliance includes...
Content-Type of the attachment.
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the attachment name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
HTTP request body for attachment operations.
Examples:Content-Type of the attachment.
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Path parameter to specify the attachment name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].*$/
HTTP request body for attachment operations.
Examples:Content-Type of the attachment.
Header parameter for a conditional HTTP request matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify a document revision.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X PUT "$SERVICE_URL/products/small-appliances:100001/product_details.txt" -H "Content-Type: text/plain" --data 'This appliance includes...'
import ( "bytes" "encoding/json" "fmt" "io" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } putAttachmentOptions := service.NewPutAttachmentOptions( "products", "1000042", "product_details.txt", io.NopCloser( bytes.NewReader([]byte("This appliance includes...")), ), "text/plain", ) documentResult, response, err := service.PutAttachment(putAttachmentOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(documentResult, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.DocumentResult; import com.ibm.cloud.cloudant.v1.model.PutAttachmentOptions; import java.io.ByteArrayInputStream; import java.io.InputStream; import java.nio.charset.StandardCharsets;
Cloudant service = Cloudant.newInstance(); String detailedDescription = "This appliance includes..."; InputStream detailedDescriptionStream = new ByteArrayInputStream(detailedDescription .getBytes(StandardCharsets.UTF_8)); PutAttachmentOptions attachmentOptions = new PutAttachmentOptions.Builder() .db("products") .docId("1000042") .attachmentName("product_details.txt") .attachment(detailedDescriptionStream) .contentType("text/plain") .build(); DocumentResult response = service.putAttachment(attachmentOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); const stream = new Readable(); stream.push('This appliance includes...'); stream.push(null); service.putAttachment({ db: 'products', docId: '1000042', attachmentName: 'product_details.txt', attachment: stream, contentType: 'text/plain' }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() detailed_description = "This appliance includes..." response = service.put_attachment( db='products', doc_id='1000042', attachment_name='product_details.txt', attachment=detailed_description, content_type='text/plain' ).get_result() print(response)
Response
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
ok
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Status Code
HTTP response for Document modification operations.
HTTP response for Document modification operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for conflict.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for a document update conflict.
{ "error": "conflict", "reason": "Document update conflict." }
Example error response for a document update conflict.
{ "error": "conflict", "reason": "Document update conflict." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request with an attachment size that exceeds the allowable limit.
{ "error": "attachment_too_large", "reason": "attachment_name" }
Example error response for a request with an attachment size that exceeds the allowable limit.
{ "error": "attachment_too_large", "reason": "attachment_name" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Delete a local document
Deletes the specified local document. The semantics are identical to deleting a standard document in the specified database, except that the document is not replicated.
Deletes the specified local document. The semantics are identical to deleting a standard document in the specified database, except that the document is not replicated.
Deletes the specified local document. The semantics are identical to deleting a standard document in the specified database, except that the document is not replicated.
Deletes the specified local document. The semantics are identical to deleting a standard document in the specified database, except that the document is not replicated.
Deletes the specified local document. The semantics are identical to deleting a standard document in the specified database, except that the document is not replicated.
DELETE /{db}/_local/{doc_id}
(cloudant *CloudantV1) DeleteLocalDocument(deleteLocalDocumentOptions *DeleteLocalDocumentOptions) (result *DocumentResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) DeleteLocalDocumentWithContext(ctx context.Context, deleteLocalDocumentOptions *DeleteLocalDocumentOptions) (result *DocumentResult, response *core.DetailedResponse, err error)
ServiceCall<DocumentResult> deleteLocalDocument(DeleteLocalDocumentOptions deleteLocalDocumentOptions)
deleteLocalDocument(params)
delete_local_document(
self,
db: str,
doc_id: str,
*,
batch: Optional[str] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the DeleteLocalDocumentOptions
struct and set the fields to provide parameter values for the DeleteLocalDocument
method.
Use the DeleteLocalDocumentOptions.Builder
to create a DeleteLocalDocumentOptions
object that contains the parameter values for the deleteLocalDocument
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Query Parameters
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The DeleteLocalDocument options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]
The deleteLocalDocument options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X DELETE "$SERVICE_URL/orders/_local/local-0007741142412418284"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } deleteLocalDocumentOptions := service.NewDeleteLocalDocumentOptions( "orders", "local-0007741142412418284", ) documentResult, response, err := service.DeleteLocalDocument(deleteLocalDocumentOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(documentResult, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.DeleteLocalDocumentOptions; import com.ibm.cloud.cloudant.v1.model.DocumentResult;
Cloudant service = Cloudant.newInstance(); DeleteLocalDocumentOptions documentOptions = new DeleteLocalDocumentOptions.Builder() .db("orders") .docId("local-0007741142412418284") .build(); DocumentResult response = service.deleteLocalDocument(documentOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.deleteLocalDocument({ db: 'orders', docId: 'local-0007741142412418284' }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.delete_local_document( db='orders', doc_id='local-0007741142412418284' ).get_result() print(response)
Response
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
ok
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Status Code
HTTP response for Document modification operations.
HTTP response for Document modification operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve a local document
Retrieves the specified local document. The semantics are identical to accessing a standard document in the specified database, except that the document is not replicated.
Retrieves the specified local document. The semantics are identical to accessing a standard document in the specified database, except that the document is not replicated.
Retrieves the specified local document. The semantics are identical to accessing a standard document in the specified database, except that the document is not replicated.
Retrieves the specified local document. The semantics are identical to accessing a standard document in the specified database, except that the document is not replicated.
Retrieves the specified local document. The semantics are identical to accessing a standard document in the specified database, except that the document is not replicated.
GET /{db}/_local/{doc_id}
(cloudant *CloudantV1) GetLocalDocument(getLocalDocumentOptions *GetLocalDocumentOptions) (result *Document, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) GetLocalDocumentWithContext(ctx context.Context, getLocalDocumentOptions *GetLocalDocumentOptions) (result *Document, response *core.DetailedResponse, err error)
ServiceCall<Document> getLocalDocument(GetLocalDocumentOptions getLocalDocumentOptions)
getLocalDocument(params)
get_local_document(
self,
db: str,
doc_id: str,
*,
accept: Optional[str] = None,
if_none_match: Optional[str] = None,
attachments: Optional[bool] = None,
att_encoding_info: Optional[bool] = None,
local_seq: Optional[bool] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the GetLocalDocumentOptions
struct and set the fields to provide parameter values for the GetLocalDocument
method.
Use the GetLocalDocumentOptions.Builder
to create a GetLocalDocumentOptions
object that contains the parameter values for the getLocalDocument
method.
Custom Headers
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
^"[A-Za-z0-9+\/]{2,24}={0,3}"$|^"[1-9]\d{0,9}-[\da-f]{32}"$|^"[0-9A-Z]{25}"$
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Allowable values: [
application/json
,multipart/mixed
,multipart/related
]
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Query Parameters
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to include attachments only since specified revisions. Note this does not include the attachments for the specified revisions.
Possible values: 1 ≤ number of items ≤ 4294967295, 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Examples:[ "1-99b02e08da151943c2dcb40090160bb8" ]
Query parameter to specify whether to include the last update sequence for the document.
Default:
false
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The GetLocalDocument options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
The type of the response: application/json, multipart/mixed, multipart/related, or application/octet-stream.
Allowable values: [
application/json
,multipart/mixed
,multipart/related
,application/octet-stream
]Default:
application/json
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to include the last update sequence for the document.
Default:
false
The getLocalDocument options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
The type of the response: application/json, multipart/mixed, multipart/related, or application/octet-stream.
Allowable values: [
application/json
,multipart/mixed
,multipart/related
,application/octet-stream
]Default:
application/json
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to include the last update sequence for the document.
Default:
false
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
The type of the response: application/json, multipart/mixed, multipart/related, or application/octet-stream.
Allowable values: [
application/json
,multipart/mixed
,multipart/related
,application/octet-stream
]Default:
application/json
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to include the last update sequence for the document.
Default:
false
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
The type of the response: application/json, multipart/mixed, multipart/related, or application/octet-stream.
Allowable values: [
application/json
,multipart/mixed
,multipart/related
,application/octet-stream
]Default:
application/json
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Query parameter to specify whether to include attachments bodies in a response.
Default:
false
Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Query parameter to specify whether to include the last update sequence for the document.
Default:
false
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/orders/_local/local-0007741142412418284"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } getLocalDocumentOptions := service.NewGetLocalDocumentOptions( "orders", "local-0007741142412418284", ) document, response, err := service.GetLocalDocument(getLocalDocumentOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(document, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.Document; import com.ibm.cloud.cloudant.v1.model.GetLocalDocumentOptions;
Cloudant service = Cloudant.newInstance(); GetLocalDocumentOptions documentOptions = new GetLocalDocumentOptions.Builder() .db("orders") .docId("local-0007741142412418284") .build(); Document response = service.getLocalDocument(documentOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.getLocalDocument({ db: 'orders', docId: 'local-0007741142412418284' }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.get_local_document( db='orders', doc_id='local-0007741142412418284' ).get_result() print(response)
Response
Schema for a document.
Schema for a map of attachment name to attachment metadata.
- _attachments
Schema for an attachment.
Schema for a list of document revision identifiers.
Possible values: 0 ≤ number of items ≤ 4294967295, 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Deletion flag. Available if document was removed
Schema for a list of document revision identifiers.
Possible values: 0 ≤ number of items ≤ 4294967295, 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Document's update sequence in current database. Available if requested with local_seq=true query parameter
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Schema for list of revision information.
Schema for a list of objects with information about local revisions and their status.
Possible values: 1 ≤ number of items ≤ 4294967295
Schema for a document.
Schema for a map of attachment name to attachment metadata.
- Attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- Revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- RevsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document.
Schema for a map of attachment name to attachment metadata.
- attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- revsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document.
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Schema for a document.
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Possible values: [
available
,missing
,deleted
]
Status Code
HTTP response for Document.
HTTP response for not modified client redirect.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example Document.
{ "_id": "exampleid", "brand": "Foo", "colours": [ "red", "green", "black", "blue" ], "description": "Slim Colourful Design Electronic Cooking Appliance for ...", "image": "assets/img/0gmsnghhew.jpg", "keywords": [ "Foo", "Scales", "Weight", "Digital", "Kitchen" ], "name": "Digital Kitchen Scales", "price": 14.99, "productid": "1000042", "taxonomy": [ "Home", "Kitchen", "Small Appliances" ], "type": "product" }
Example Document.
{ "_id": "exampleid", "brand": "Foo", "colours": [ "red", "green", "black", "blue" ], "description": "Slim Colourful Design Electronic Cooking Appliance for ...", "image": "assets/img/0gmsnghhew.jpg", "keywords": [ "Foo", "Scales", "Weight", "Digital", "Kitchen" ], "name": "Digital Kitchen Scales", "price": 14.99, "productid": "1000042", "taxonomy": [ "Home", "Kitchen", "Small Appliances" ], "type": "product" }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve HTTP headers for a local document
Retrieves the HTTP headers containing minimal amount of information about the specified local document. Since the response body is empty, using the HEAD method is a lightweight way to check if the local document exists or not.
Retrieves the HTTP headers containing minimal amount of information about the specified local document. Since the response body is empty, using the HEAD method is a lightweight way to check if the local document exists or not.
Retrieves the HTTP headers containing minimal amount of information about the specified local document. Since the response body is empty, using the HEAD method is a lightweight way to check if the local document exists or not.
Retrieves the HTTP headers containing minimal amount of information about the specified local document. Since the response body is empty, using the HEAD method is a lightweight way to check if the local document exists or not.
Retrieves the HTTP headers containing minimal amount of information about the specified local document. Since the response body is empty, using the HEAD method is a lightweight way to check if the local document exists or not.
HEAD /{db}/_local/{doc_id}
(cloudant *CloudantV1) HeadLocalDocument(headLocalDocumentOptions *HeadLocalDocumentOptions) (response *core.DetailedResponse, err error)
(cloudant *CloudantV1) HeadLocalDocumentWithContext(ctx context.Context, headLocalDocumentOptions *HeadLocalDocumentOptions) (response *core.DetailedResponse, err error)
ServiceCall<Void> headLocalDocument(HeadLocalDocumentOptions headLocalDocumentOptions)
headLocalDocument(params)
head_local_document(
self,
db: str,
doc_id: str,
*,
if_none_match: Optional[str] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the HeadLocalDocumentOptions
struct and set the fields to provide parameter values for the HeadLocalDocument
method.
Use the HeadLocalDocumentOptions.Builder
to create a HeadLocalDocumentOptions
object that contains the parameter values for the headLocalDocument
method.
Custom Headers
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
^"[A-Za-z0-9+\/]{2,24}={0,3}"$|^"[1-9]\d{0,9}-[\da-f]{32}"$|^"[0-9A-Z]{25}"$
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The HeadLocalDocument options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
The headLocalDocument options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Header parameter for a conditional HTTP request not matching an ETag.
Possible values: 26 ≤ length ≤ 45, Value must match regular expression
/^\"[A-Za-z0-9+\/]{2,24}={0,3}\"$|^\"[1-9]\\d{0,9}-[\\da-f]{32}\"$|^\"[0-9A-Z]{25}\"$/
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the ETag for a resource.
Examples:Double quoted base64 encoded attachment digest.
"MEHlNHhicVt9efOzyvsz0Q=="
Double quoted document revision identifier.
"2-240fc93fad07083c338c7e0ea55791b3"
Double quoted local document tag.
"6APCCGX4B76OFFD5972MSBFHD"
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for Document.
HTTP response for not modified client redirect.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Create or modify a local document
Stores the specified local document. The semantics are identical to storing a standard document in the specified database, except that the document is not replicated.
Stores the specified local document. The semantics are identical to storing a standard document in the specified database, except that the document is not replicated.
Stores the specified local document. The semantics are identical to storing a standard document in the specified database, except that the document is not replicated.
Stores the specified local document. The semantics are identical to storing a standard document in the specified database, except that the document is not replicated.
Stores the specified local document. The semantics are identical to storing a standard document in the specified database, except that the document is not replicated.
PUT /{db}/_local/{doc_id}
(cloudant *CloudantV1) PutLocalDocument(putLocalDocumentOptions *PutLocalDocumentOptions) (result *DocumentResult, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PutLocalDocumentWithContext(ctx context.Context, putLocalDocumentOptions *PutLocalDocumentOptions) (result *DocumentResult, response *core.DetailedResponse, err error)
ServiceCall<DocumentResult> putLocalDocument(PutLocalDocumentOptions putLocalDocumentOptions)
putLocalDocument(params)
put_local_document(
self,
db: str,
doc_id: str,
document: Union['Document', BinaryIO],
*,
content_type: Optional[str] = None,
batch: Optional[str] = None,
**kwargs,
) -> DetailedResponse
Request
Instantiate the PutLocalDocumentOptions
struct and set the fields to provide parameter values for the PutLocalDocument
method.
Use the PutLocalDocumentOptions.Builder
to create a PutLocalDocumentOptions
object that contains the parameter values for the putLocalDocument
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Allowable values: [
application/json
,multipart/mixed
,multipart/related
]
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Query Parameters
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]
HTTP request body for Document operations.
Example Document.
{
"_id": "exampleid",
"brand": "Foo",
"colours": [
"red",
"green",
"black",
"blue"
],
"description": "Slim Colourful Design Electronic Cooking Appliance for ...",
"image": "assets/img/0gmsnghhew.jpg",
"keywords": [
"Foo",
"Scales",
"Weight",
"Digital",
"Kitchen"
],
"name": "Digital Kitchen Scales",
"price": 14.99,
"productid": "1000042",
"taxonomy": [
"Home",
"Kitchen",
"Small Appliances"
],
"type": "product"
}
Schema for a map of attachment name to attachment metadata.
- _attachments
Schema for an attachment.
Schema for a list of document revision identifiers.
Possible values: 0 ≤ number of items ≤ 4294967295, 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Deletion flag. Available if document was removed
Schema for a list of document revision identifiers.
Possible values: 0 ≤ number of items ≤ 4294967295, 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Document's update sequence in current database. Available if requested with local_seq=true query parameter
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Schema for list of revision information.
Schema for a list of objects with information about local revisions and their status.
Possible values: 1 ≤ number of items ≤ 4294967295
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The PutLocalDocument options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
HTTP request body for Document operations.
Examples:{ "_id": "exampleid", "brand": "Foo", "colours": [ "red", "green", "black", "blue" ], "description": "Slim Colourful Design Electronic Cooking Appliance for ...", "image": "assets/img/0gmsnghhew.jpg", "keywords": [ "Foo", "Scales", "Weight", "Digital", "Kitchen" ], "name": "Digital Kitchen Scales", "price": 14.99, "productid": "1000042", "taxonomy": [ "Home", "Kitchen", "Small Appliances" ], "type": "product" }
- Document
Schema for a map of attachment name to attachment metadata.
- Attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- Revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- RevsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Allowable values: [
available
,missing
,deleted
]
HTTP request body for Document operations.
The type of the input.
Allowable values: [
application/json
,multipart/mixed
,multipart/related
,application/octet-stream
]Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]
The putLocalDocument options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
HTTP request body for Document operations.
Examples:{ "_id": "exampleid", "brand": "Foo", "colours": [ "red", "green", "black", "blue" ], "description": "Slim Colourful Design Electronic Cooking Appliance for ...", "image": "assets/img/0gmsnghhew.jpg", "keywords": [ "Foo", "Scales", "Weight", "Digital", "Kitchen" ], "name": "Digital Kitchen Scales", "price": 14.99, "productid": "1000042", "taxonomy": [ "Home", "Kitchen", "Small Appliances" ], "type": "product" }
- document
Schema for a map of attachment name to attachment metadata.
- attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- revsInfo
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Allowable values: [
available
,missing
,deleted
]
HTTP request body for Document operations.
The type of the input.
Allowable values: [
application/json
,multipart/mixed
,multipart/related
,application/octet-stream
]Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
HTTP request body for Document operations.
Examples:- document
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Allowable values: [
available
,missing
,deleted
]
The type of the input.
Allowable values: [
application/json
,multipart/mixed
,multipart/related
,application/octet-stream
]Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
Schema for a document.
- document
Schema for a map of attachment name to attachment metadata.
- _attachments
Attachment MIME type.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+\/.+(?:;.+=.+)*$/
Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/
Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.Possible values: 28 ≤ length ≤ 7168, Value must match regular expression
/^[\\w\\d]+-[A-Za-z0-9+\/]{2,}={0,3}$/
Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter
att_encoding_info
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
True if the attachment follows in a multipart request or response.
Real attachment size in bytes. Not available if inline attachment content requested.
Possible values: 0 ≤ value ≤ 10485760
Revision number when attachment was added.
Possible values: 1 ≤ value ≤ 4294967295
Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Deletion flag. Available if document was removed.
Schema for a list of document revision identifiers.
Possible values: number of items ≥ 0, 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Document's update sequence in current database. Available if requested with local_seq=true query parameter.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Schema for list of revision information.
- _revisions
Array of valid revision IDs, in reverse order (latest first).
Possible values: number of items ≥ 1, 1 ≤ length ≤ 7168, Value must match regular expression
/^[0-9a-fA-F]{32}$/
Prefix number for the latest revision.
Possible values: 1 ≤ value ≤ 4294967295
Schema for a list of objects with information about local revisions and their status.
Possible values: number of items ≥ 1
- _revs_info
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
Status of the revision. May be one of: -
available
: Revision is available for retrieving with rev query parameter -missing
: Revision is not available -deleted
: Revision belongs to deleted document.Allowable values: [
available
,missing
,deleted
]
The type of the input.
Allowable values: [
application/json
,multipart/mixed
,multipart/related
,application/octet-stream
]Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Allowable values: [
ok
]
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X PUT "$SERVICE_URL/orders/_local/local-0007741142412418284" -H "Content-Type: application/json" --data '{ "type": "order", "user": "Bob Smith", "orderid": "0007741142412418284", "userid": "abc123", "basket": [ { "name": "Salter - Digital Kitchen Scales", "price": 14.99 }, { "name": "Kenwood - Stand Mixer", "price": 199.99 } ], "total": 214.98, "deliveryAddress": "19 Front Street, Darlington, DL5 1TY", "delivered": "true", "courier": "UPS", "courierid": "15125425151261289", "date": "2019-01-28T10:44:22.000Z" }'
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } localDocument := cloudantv1.Document{} properties := map[string]interface{}{ "type": "order", "user": "Bob Smith", "orderId": "0007741142412418284", "userId": "abc123", "total": 214.98, "deliveryAddress": "19 Front Street, Darlington, DL5 1TY", "delivered": true, "courier": "UPS", "courierId": "15125425151261289", "date": "2019-01-28T10:44:22.000Z", } for key, value := range properties { localDocument.SetProperty(key, value) } putLocalDocumentOptions := service.NewPutLocalDocumentOptions( "orders", "local-0007741142412418284", ) putLocalDocumentOptions.SetDocument(&localDocument) documentResult, response, err := service.PutLocalDocument(putLocalDocumentOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(documentResult, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.Document; import com.ibm.cloud.cloudant.v1.model.DocumentResult; import com.ibm.cloud.cloudant.v1.model.PutLocalDocumentOptions;
Cloudant service = Cloudant.newInstance(); Document orderDocument = new Document(); orderDocument.put("type", "order"); orderDocument.put("user", "Bob Smith"); orderDocument.put("orderId", "0007741142412418284"); orderDocument.put("userId", "abc123"); orderDocument.put("total", 214.98); orderDocument.put("deliveryAddress", "19 Front Street, Darlington, DL5 1TY"); orderDocument.put("delivered", true); orderDocument.put("courier", "UPS"); orderDocument.put("courierId", "15125425151261289"); orderDocument.put("date", "2019-01-28T10:44:22.000Z"); PutLocalDocumentOptions documentOptions = new PutLocalDocumentOptions.Builder() .db("orders") .docId("local-0007741142412418284") .document(orderDocument) .build(); DocumentResult response = service.putLocalDocument(documentOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); const localDocument: CloudantV1.Document = { type: 'order', user: 'Bob Smith', orderId: '0007741142412418284', userId: 'abc123', total: 214.98, deliveryAddress: '19 Front Street, Darlington, DL5 1TY', delivered: 'true', courier: 'UPS', courierId: '15125425151261289', date: '2019-01-28T10:44:22.000Z' } service.putLocalDocument({ db: 'orders', docId: 'local-0007741142412418284', document: localDocument }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import Document, CloudantV1 service = CloudantV1.new_instance() local_document = Document( type='order', user='Bob Smith', orderId='0007741142412418284', userId='abc123', total=214.98, deliveryAddress='19 Front Street, Darlington, DL5 1TY', delivered='true', courier='UPS', courierId='15125425151261289', date='2019-01-28T10:44:22.000Z' ) response = service.put_local_document( db='orders', doc_id='local-0007741142412418284', document=local_document, ).get_result() print(response)
Response
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
ok
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Schema for the result of a document modification.
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([^_]|_(design|local)\/).+$/
Schema for a document revision identifier.
Possible values: 34 ≤ length ≤ 43, Value must match regular expression
/^[1-9]\\d{0,9}-[\\da-f]{32}$/
ok.
The cause of the error (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The name of the error.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
The reason the error occurred (if available).
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
An internal error reference (if available).
Possible values: 0 ≤ value ≤ 9007199254740992
Status Code
HTTP response for Document modification operations.
HTTP response for Document modification operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a creation.
{ "id": "exampleid", "ok": true, "rev": "2-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for a deletion.
{ "id": "exampleid", "ok": true, "rev": "3-056f5f44046ecafc08a2bc2b9c229e20" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example DocumentResult for an update.
{ "id": "exampleid", "ok": true, "rev": "2-9c65296036141e575d32ba9c034dd3ee" }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request with a document size that exceeds the allowable limit.
{ "error": "document_too_large", "reason": "doc_id" }
Example error response for a request with a document size that exceeds the allowable limit.
{ "error": "document_too_large", "reason": "doc_id" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Query a list of all local documents in a database (GET)
Queries the list of all local document IDs. The results matching the query parameters are returned in a JSON object, including a list of matching local documents with basic contents, such as the ID. When no query parameters are specified, results for all local documents in the database are returned. Optionally, document content or additional metadata can be included in the response.
GET /{db}/_local_docs
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Query Parameters
Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Query parameter to specify whether to return the documents in descending by key order.
Default:
false
Query parameter to specify to stop returning records when the specified key is reached. String representation of any JSON type that matches the key type emitted by the view function.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query parameter to specify to stop returning records when the specified document ID is reached.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].*$
Query parameter to specify whether to include the full content of the documents in the response.
Default:
false
Query parameter to specify whether the specified end key should be included in the result.
Default:
true
Query parameter to specify to return only documents that match the specified key. String representation of any JSON type that matches the key type emitted by the view function.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query parameter to specify returning only documents that match any of the specified keys. String representation of a JSON array of keys that match the key type emitted by the view function. Must be URL encoded.
Possible values: 2 ≤ length ≤ 7168, Value must match regular expression
^\[(".*")*\]$
Query parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Query parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Query parameter to specify to start returning records from the specified key. String representation of any JSON type that matches the key type emitted by the view function.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Query parameter to specify to start returning records from the specified document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].*$
Query parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Response
Schema for the result of an all documents operation.
Offset where the list started.
Possible values: 0 ≤ value ≤ 9007199254740992
Total number of document results.
Possible values: 0 ≤ value ≤ 4294967295
List of doc results.
Possible values: 0 ≤ number of items ≤ 4294967295
Current update sequence for the database
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Status Code
HTTP response for getLocalDocs and postLocalDocs.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example AllDocsResult response for local documents.
{ "offset": null, "rows": [ { "id": "_local/0011a1cdda315e7dce2978ee157e4f5d", "key": "_local/0011a1cdda315e7dce2978ee157e4f5d", "value": { "rev": "0-1" } } ], "total_rows": null }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve HTTP headers for a list of all local documents in a database (GET)
Retrieves the HTTP headers for a list of all local documents in a database (GET).
HEAD /{db}/_local_docs
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for
/_all_docs
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Query a list of all local documents in a database
Queries the list of all local document IDs. The results matching the request body parameters are returned in a JSON object, including a list of matching local documents with basic contents, such as the ID. When no request body parameters are specified, results for all local documents in the database are returned. Optionally, document content or additional metadata can be included in the response.
POST /{db}/_local_docs
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
HTTP request body for postAllDocs and postPartitionAllDocs.
Example AllDocs request.
{
"limit": 10,
"start_key": "0007741142412418284"
}
Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
Default:
false
Parameter to specify whether to include attachments bodies in a response.
Default:
false
Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when
include_docs
istrue
.Default:
false
Parameter to specify whether to return the documents in descending by key order.
Default:
false
Parameter to specify whether to include the full content of the documents in the response.
Default:
false
Parameter to specify whether the specified end key should be included in the result.
Default:
true
Parameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740992
Default:
0
Query parameter to specify whether to sort the returned rows. Setting this to false offers a performance boost. The total_rows and offset fields are not available when this is set to false.
Default:
true
Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
false
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Schema for a list of document IDs.
Possible values: 0 ≤ number of items ≤ 65535, 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Schema for a document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Response
Schema for the result of an all documents operation.
Offset where the list started.
Possible values: 0 ≤ value ≤ 9007199254740992
Total number of document results.
Possible values: 0 ≤ value ≤ 4294967295
List of doc results.
Possible values: 0 ≤ number of items ≤ 4294967295
Current update sequence for the database
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Status Code
HTTP response for getLocalDocs and postLocalDocs.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example AllDocsResult response for local documents.
{ "offset": null, "rows": [ { "id": "_local/0011a1cdda315e7dce2978ee157e4f5d", "key": "_local/0011a1cdda315e7dce2978ee157e4f5d", "value": { "rev": "0-1" } } ], "total_rows": null }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Multi-query the list of all local documents in a database
Runs multiple view queries of all local documents in this database. This operation enables you to request multiple queries in a single request, in place of multiple POST /{db}/_local_docs
requests.
POST /{db}/_local_docs/queries
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
HTTP request body for allDocsQueriesQuery, designDocsQueriesQuery and localDocsQueriesQuery.
Example AllDocsQueriesQuery request.
{
"queries": [
{
"keys": [
"small-appliances:1000042",
"small-appliances:1000043"
]
},
{
"limit": 3,
"skip": 2
}
]
}
An array of query objects with fields for the parameters of each individual view query to be executed. The field names and their meaning are the same as the query parameters of a regular
/_all_docs
request.Possible values: 1 ≤ number of items ≤ 65535
Response
Schema for the result of an all documents queries operation.
An array of result objects - one for each query. Each result object contains the same fields as the response to a regular
/_all_docs
request.Possible values: 1 ≤ number of items ≤ 65535
Status Code
HTTP response for
/_all_docs/queries
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example AllDocsQueriesResult response.
{ "results": [ { "offset": 0, "rows": [ { "id": "exampleid", "key": "exampleid", "value": { "rev": "1-5005d65514fe9e90f8eccf174af5dd64" } }, { "id": "exampleid2", "key": "exampleid2", "value": { "rev": "1-2d7810b054babeda4812b3924428d6d6" } } ], "total_rows": 5 }, { "offset": 2, "rows": [ { "id": "exampleid3", "key": "exampleid3", "value": { "rev": "1-5005d65514fe9e90f8eccf174af5dd64" } }, { "id": "exampleid4", "key": "exampleid4", "value": { "rev": "1-2d7810b054babeda4812b3924428d6d6" } } ], "total_rows": 5 } ] }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Commit any recent changes to the specified database to disk
Commits any recent changes to the specified database to disk. You must make a request to this endpoint if you want to ensure that recent changes have been flushed. This function is likely not required, assuming you have the recommended configuration setting, delayed_commits=false
. This setting requires that changes are written to disk before a 200 or similar result is returned.
POST /{db}/_ensure_full_commit
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Response
Schema for the status of a commit operation.
Timestamp of when the database was opened, expressed in microseconds since the epoch.
Possible values: 1 ≤ length ≤ 10, Value must match regular expression
^\d+$
Operation status.
Status Code
HTTP response for postEnsureFullCommit.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example EnsureFullCommitInformation response.
{ "instance_start_time": "0", "ok": true }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Query which document revisions are missing from the database
Given a list of document revisions, returns the document revisions that do not exist in the database.
POST /{db}/_missing_revs
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
HTTP request body for operations with Document revisions.
Example DocumentRevisions request.
{
"order00077": [
"3-b06fcd1c1c9e0ec7c480ee8aa467bf3b",
"3-0e871ef78849b0c206091f1a7af6ec41"
]
}
Schema for a document revision identifier.
Possible values: 0 ≤ number of items ≤ 65535, 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X POST "$SERVICE_URL/events/_missing_revs" -H "Content-Type: application/json" --data '{ "order00077": [ "1-abcdefg", "2-hijklmn" ] }'
This example requires the example revisions in the POST body to be replaced with valid revisions.
Response
Schema for mapping document IDs to lists of missing revisions.
Schema for mapping document IDs to lists of revisions.
- missing_revs
Schema for a document revision identifier.
Possible values: 0 ≤ number of items ≤ 65535, 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Status Code
HTTP response for postMissingRevs.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example MissingRevsResult response.
{ "missing_revs": { "order00077": [ "2-b06fcd1c1c9e0ec7c480ee8aa467bf3b" ] } }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Query the document revisions and possible ancestors missing from the database
The replicator is the primary user of this operation. After receiving a set of new revision IDs from the source database, the replicator sends this set to the destination database's _revs_diff
to find out which of them already exists there. It can then avoid fetching and sending already-known document bodies.
The replicator is the primary user of this operation. After receiving a set of new revision IDs from the source database, the replicator sends this set to the destination database's _revs_diff
to find out which of them already exists there. It can then avoid fetching and sending already-known document bodies.
The replicator is the primary user of this operation. After receiving a set of new revision IDs from the source database, the replicator sends this set to the destination database's _revs_diff
to find out which of them already exists there. It can then avoid fetching and sending already-known document bodies.
The replicator is the primary user of this operation. After receiving a set of new revision IDs from the source database, the replicator sends this set to the destination database's _revs_diff
to find out which of them already exists there. It can then avoid fetching and sending already-known document bodies.
The replicator is the primary user of this operation. After receiving a set of new revision IDs from the source database, the replicator sends this set to the destination database's _revs_diff
to find out which of them already exists there. It can then avoid fetching and sending already-known document bodies.
POST /{db}/_revs_diff
(cloudant *CloudantV1) PostRevsDiff(postRevsDiffOptions *PostRevsDiffOptions) (result map[string]RevsDiff, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostRevsDiffWithContext(ctx context.Context, postRevsDiffOptions *PostRevsDiffOptions) (result map[string]RevsDiff, response *core.DetailedResponse, err error)
ServiceCall<Map<String, RevsDiff>> postRevsDiff(PostRevsDiffOptions postRevsDiffOptions)
postRevsDiff(params)
post_revs_diff(
self,
db: str,
document_revisions: dict,
**kwargs,
) -> DetailedResponse
Request
Instantiate the PostRevsDiffOptions
struct and set the fields to provide parameter values for the PostRevsDiff
method.
Use the PostRevsDiffOptions.Builder
to create a PostRevsDiffOptions
object that contains the parameter values for the postRevsDiff
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
HTTP request body for operations with Document revisions.
Example DocumentRevisions request.
{
"order00077": [
"3-b06fcd1c1c9e0ec7c480ee8aa467bf3b",
"3-0e871ef78849b0c206091f1a7af6ec41"
]
}
Schema for a document revision identifier.
Possible values: 0 ≤ number of items ≤ 65535, 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The PostRevsDiff options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
HTTP request body for operations with Document revisions.
Possible values: 0 ≤ number of items ≤ 65535
Examples:{ "order00077": [ "3-b06fcd1c1c9e0ec7c480ee8aa467bf3b", "3-0e871ef78849b0c206091f1a7af6ec41" ] }
The postRevsDiff options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
HTTP request body for operations with Document revisions.
Possible values: 0 ≤ number of items ≤ 65535
Examples:{ "order00077": [ "3-b06fcd1c1c9e0ec7c480ee8aa467bf3b", "3-0e871ef78849b0c206091f1a7af6ec41" ] }
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
HTTP request body for operations with Document revisions.
Possible values: 0 ≤ number of items ≤ 65535
Examples:
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
HTTP request body for operations with Document revisions.
Possible values: 0 ≤ number of items ≤ 65535
Examples:
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X POST "$SERVICE_URL/orders/_revs_diff" -H "Content-Type: application/json" -d '{ "order00077": [ "1-abcdefg", "2-hijklmn", "3-opqrstu" ] }'
This example requires the example revisions in the POST body to be replaced with valid revisions.
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } postRevsDiffOptions := service.NewPostRevsDiffOptions( "orders", map[string][]string{ "order00077": { "<1-missing-revision>", "<2-missing-revision>", "<3-possible-ancestor-revision>", }, }, ) mapStringRevsDiff, response, err := service.PostRevsDiff(postRevsDiffOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(mapStringRevsDiff, "", " ") fmt.Println(string(b))
This example requires the example revisions in the POST body to be replaced with valid revisions.
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.PostRevsDiffOptions; import com.ibm.cloud.cloudant.v1.model.RevsDiff; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Arrays;
Cloudant service = Cloudant.newInstance(); Map<String, List<String>> docRevisions = Collections.singletonMap("order00077", Arrays.asList("<1-missing-revision>", "<2-missing-revision>", "<3-possible-ancestor-revision>")); PostRevsDiffOptions revsDiffOptions = new PostRevsDiffOptions.Builder() .db("orders") .documentRevisions(docRevisions) .build(); Map<String,RevsDiff> response = service.postRevsDiff(revsDiffOptions).execute() .getResult(); System.out.println(response);
This example requires the example revisions in the POST body to be replaced with valid revisions.
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); const revsDiff: CloudantV1.DocumentRevisions = { order00077: [ "<1-missing-revision>", "<2-missing-revision>", "<3-possible-ancestor-revision>" ] } service.postRevsDiff({ db: 'orders', revsDiffRequest: revsDiff }).then(response => { console.log(response.result); });
This example requires the example revisions in the POST body to be replaced with valid revisions.
from ibmcloudant.cloudant_v1 import DocumentRevisions, CloudantV1 service = CloudantV1.new_instance() revs_diff = DocumentRevisions( order00077=[ "<1-missing-revision>", "<2-missing-revision>", "<3-possible-ancestor-revision>" ] ) response = service.post_revs_diff( db='orders', revs_diff_request=revs_diff.to_dict() ).get_result() print(response) // section: markdown // This example requires the example revisions in the POST body to be replaced with valid revisions.
Response
Response type: map[string]RevsDiff
Response type: Map<String, RevsDiff>
Response type: JsonObject
Response type: dict
Schema for mapping document IDs to RevsDiff information.
Schema for information about missing revs and possible ancestors.
- any property
List of missing revisions.
Possible values: 0 ≤ number of items ≤ 4294967295, 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
List of possible ancestor revisions.
Possible values: 0 ≤ number of items ≤ 4294967295, 34 ≤ length ≤ 43, Value must match regular expression
^[1-9]\d{0,9}-[\da-f]{32}$
Status Code
HTTP response for postRevsDiff.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example RevsDiffResult response.
{ "order00077": { "missing": [ "3-bb72a7682290f94a985f7afac8b27137", "5-067a00dff5e02add41819138abb3284d" ], "possible_ancestors": [ "4-10265e5a26d807a3cfa459cf1a82ef2e" ] } }
Example RevsDiffResult response.
{ "order00077": { "missing": [ "3-bb72a7682290f94a985f7afac8b27137", "5-067a00dff5e02add41819138abb3284d" ], "possible_ancestors": [ "4-10265e5a26d807a3cfa459cf1a82ef2e" ] } }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve the current revision limit
Retrieve the value of the server's current revision limit.
GET /{db}/_revs_limit
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Response
Schema for the revision limit.
Status Code
HTTP response for
/{db}/_revs_limit
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example RevsLimit response.
1000
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve HTTP headers of the current revision limit
Retrieve HTTP headers for the revs limit endpoint.
HEAD /{db}/_revs_limit
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for
/{db}/_revs_limit
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Set the revision limit
Sets the maximum number of document revisions tracked, even after compaction occurs. You can set the revision limit on a database with a scalar integer for the limit that you want to set as the request body.
PUT /{db}/_revs_limit
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
HTTP request body for putRevsLimit.
Example: 1000
Response
Schema for an OK result.
ok
Status Code
HTTP response for Ok operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for payload too large.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example Ok response.
{ "ok": true }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for a request size that exceeds the limit.
{ "error": "too_large", "reason": "the request entity is too large" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve shard information
List each shard range and the corresponding replicas for a specified database.
List each shard range and the corresponding replicas for a specified database.
List each shard range and the corresponding replicas for a specified database.
List each shard range and the corresponding replicas for a specified database.
List each shard range and the corresponding replicas for a specified database.
GET /{db}/_shards
(cloudant *CloudantV1) GetShardsInformation(getShardsInformationOptions *GetShardsInformationOptions) (result *ShardsInformation, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) GetShardsInformationWithContext(ctx context.Context, getShardsInformationOptions *GetShardsInformationOptions) (result *ShardsInformation, response *core.DetailedResponse, err error)
ServiceCall<ShardsInformation> getShardsInformation(GetShardsInformationOptions getShardsInformationOptions)
getShardsInformation(params)
get_shards_information(
self,
db: str,
**kwargs,
) -> DetailedResponse
Request
Instantiate the GetShardsInformationOptions
struct and set the fields to provide parameter values for the GetShardsInformation
method.
Use the GetShardsInformationOptions.Builder
to create a GetShardsInformationOptions
object that contains the parameter values for the getShardsInformation
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The GetShardsInformation options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
The getShardsInformation options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/products/_shards"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } getShardsInformationOptions := service.NewGetShardsInformationOptions( "products", ) shardsInformation, response, err := service.GetShardsInformation(getShardsInformationOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(shardsInformation, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.GetShardsInformationOptions; import com.ibm.cloud.cloudant.v1.model.ShardsInformation;
Cloudant service = Cloudant.newInstance(); GetShardsInformationOptions shardsInformationOptions = new GetShardsInformationOptions.Builder() .db("products") .build(); ShardsInformation response = service.getShardsInformation(shardsInformationOptions) .execute().getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.getShardsInformation({ db: 'products' }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.get_shards_information( db='products' ).get_result() print(response)
Response
Schema for a shards object that maps the hash value range for each shard to the array of nodes that contain a copy of that shard.
Mapping of shard hash value range to a list of nodes.
- shards
List of node names.
Possible values: 1 ≤ number of items ≤ 3, 1 ≤ length ≤ 255, Value must match regular expression
^.+$
Schema for a shards object that maps the hash value range for each shard to the array of nodes that contain a copy of that shard.
Mapping of shard hash value range to a list of nodes.
Possible values: 1 ≤ number of items ≤ 3
Schema for a shards object that maps the hash value range for each shard to the array of nodes that contain a copy of that shard.
Mapping of shard hash value range to a list of nodes.
Possible values: 1 ≤ number of items ≤ 3
Schema for a shards object that maps the hash value range for each shard to the array of nodes that contain a copy of that shard.
Mapping of shard hash value range to a list of nodes.
Possible values: 1 ≤ number of items ≤ 3
Schema for a shards object that maps the hash value range for each shard to the array of nodes that contain a copy of that shard.
Mapping of shard hash value range to a list of nodes.
Possible values: 1 ≤ number of items ≤ 3
Status Code
HTTP response for
/{db}/_shards
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example ShardsInformation response.
{ "shards": { "00000000-3fffffff": [ "node1@xxx.xxx.xxx.xxx", "node2@xxx.xxx.xxx.xxx", "node3@xxx.xxx.xxx.xxx" ], "40000000-7fffffff": [ "node1@xxx.xxx.xxx.xxx", "node2@xxx.xxx.xxx.xxx", "node3@xxx.xxx.xxx.xxx" ], "80000000-bfffffff": [ "node1@xxx.xxx.xxx.xxx", "node2@xxx.xxx.xxx.xxx", "node3@xxx.xxx.xxx.xxx" ], "c0000000-ffffffff": [ "node1@xxx.xxx.xxx.xxx", "node2@xxx.xxx.xxx.xxx", "node3@xxx.xxx.xxx.xxx" ] } }
Example ShardsInformation response.
{ "shards": { "00000000-3fffffff": [ "node1@xxx.xxx.xxx.xxx", "node2@xxx.xxx.xxx.xxx", "node3@xxx.xxx.xxx.xxx" ], "40000000-7fffffff": [ "node1@xxx.xxx.xxx.xxx", "node2@xxx.xxx.xxx.xxx", "node3@xxx.xxx.xxx.xxx" ], "80000000-bfffffff": [ "node1@xxx.xxx.xxx.xxx", "node2@xxx.xxx.xxx.xxx", "node3@xxx.xxx.xxx.xxx" ], "c0000000-ffffffff": [ "node1@xxx.xxx.xxx.xxx", "node2@xxx.xxx.xxx.xxx", "node3@xxx.xxx.xxx.xxx" ] } }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve HTTP headers for shard information
Retrieves the HTTP headers for shard information.
HEAD /{db}/_shards
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for
/{db}/_shards
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Retrieve shard information for a specific document
Retrieves information about a specific shard where a particular document is stored, along with information about the nodes where that shard has a replica.
Retrieves information about a specific shard where a particular document is stored, along with information about the nodes where that shard has a replica.
Retrieves information about a specific shard where a particular document is stored, along with information about the nodes where that shard has a replica.
Retrieves information about a specific shard where a particular document is stored, along with information about the nodes where that shard has a replica.
Retrieves information about a specific shard where a particular document is stored, along with information about the nodes where that shard has a replica.
GET /{db}/_shards/{doc_id}
(cloudant *CloudantV1) GetDocumentShardsInfo(getDocumentShardsInfoOptions *GetDocumentShardsInfoOptions) (result *DocumentShardInfo, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) GetDocumentShardsInfoWithContext(ctx context.Context, getDocumentShardsInfoOptions *GetDocumentShardsInfoOptions) (result *DocumentShardInfo, response *core.DetailedResponse, err error)
ServiceCall<DocumentShardInfo> getDocumentShardsInfo(GetDocumentShardsInfoOptions getDocumentShardsInfoOptions)
getDocumentShardsInfo(params)
get_document_shards_info(
self,
db: str,
doc_id: str,
**kwargs,
) -> DetailedResponse
Request
Instantiate the GetDocumentShardsInfoOptions
struct and set the fields to provide parameter values for the GetDocumentShardsInfo
method.
Use the GetDocumentShardsInfoOptions.Builder
to create a GetDocumentShardsInfoOptions
object that contains the parameter values for the getDocumentShardsInfo
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The GetDocumentShardsInfo options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
The getDocumentShardsInfo options.
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
/^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+\/-]*$/
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/products/_shards/small-appliances:1000042"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } getDocumentShardsInfoOptions := service.NewGetDocumentShardsInfoOptions( "products", "1000042", ) documentShardInfo, response, err := service.GetDocumentShardsInfo(getDocumentShardsInfoOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(documentShardInfo, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.DocumentShardInfo; import com.ibm.cloud.cloudant.v1.model.GetDocumentShardsInfoOptions;
Cloudant service = Cloudant.newInstance(); GetDocumentShardsInfoOptions shardsInfoOptions = new GetDocumentShardsInfoOptions.Builder() .db("products") .docId("1000042") .build(); DocumentShardInfo response = service.getDocumentShardsInfo(shardsInfoOptions).execute() .getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.getDocumentShardsInfo({ db: 'products', docId: '1000042' }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.get_document_shards_info( db='products', doc_id='1000042' ).get_result() print(response)
Response
Schema for document shard information.
List of nodes serving a replica of the shard.
Possible values: 1 ≤ number of items ≤ 3, 1 ≤ length ≤ 255, Value must match regular expression
^.+$
The shard range in which the document is stored.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Schema for document shard information.
List of nodes serving a replica of the shard.
Possible values: 1 ≤ number of items ≤ 3, 1 ≤ length ≤ 255, Value must match regular expression
/^.+$/
The shard range in which the document is stored.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for document shard information.
List of nodes serving a replica of the shard.
Possible values: 1 ≤ number of items ≤ 3, 1 ≤ length ≤ 255, Value must match regular expression
/^.+$/
The shard range in which the document is stored.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for document shard information.
List of nodes serving a replica of the shard.
Possible values: 1 ≤ number of items ≤ 3, 1 ≤ length ≤ 255, Value must match regular expression
/^.+$/
The shard range in which the document is stored.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Schema for document shard information.
List of nodes serving a replica of the shard.
Possible values: 1 ≤ number of items ≤ 3, 1 ≤ length ≤ 255, Value must match regular expression
/^.+$/
The shard range in which the document is stored.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/
Status Code
HTTP response for
/{db}/_shards/{doc_id}
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example document shard information response.
{ "nodes": [ "dbcore@db1.example", "dbcore@db2.example", "dbcore@db3.example" ], "range": "d0000000-dfffffff" }
Example document shard information response.
{ "nodes": [ "dbcore@db1.example", "dbcore@db2.example", "dbcore@db3.example" ], "range": "d0000000-dfffffff" }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve HTTP headers on shard information for a specific document
Retrieves the HTTP headers for the shard information of a specific document. Since the response body is empty, using the HEAD method is a lightweight way to check if the specific shard exists or not.
HEAD /{db}/_shards/{doc_id}
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the database name.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Path parameter to specify the document ID.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for
/{db}/_shards/{doc_id}
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Retrieve list of running tasks
Lists running tasks, including the task type, name, status, and process ID. The result includes a JSON array of the currently running tasks, with each task described as a single object. Depending on the operation type, the set of response object fields might be different.
Lists running tasks, including the task type, name, status, and process ID. The result includes a JSON array of the currently running tasks, with each task described as a single object. Depending on the operation type, the set of response object fields might be different.
Lists running tasks, including the task type, name, status, and process ID. The result includes a JSON array of the currently running tasks, with each task described as a single object. Depending on the operation type, the set of response object fields might be different.
Lists running tasks, including the task type, name, status, and process ID. The result includes a JSON array of the currently running tasks, with each task described as a single object. Depending on the operation type, the set of response object fields might be different.
Lists running tasks, including the task type, name, status, and process ID. The result includes a JSON array of the currently running tasks, with each task described as a single object. Depending on the operation type, the set of response object fields might be different.
GET /_active_tasks
(cloudant *CloudantV1) GetActiveTasks(getActiveTasksOptions *GetActiveTasksOptions) (result []ActiveTask, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) GetActiveTasksWithContext(ctx context.Context, getActiveTasksOptions *GetActiveTasksOptions) (result []ActiveTask, response *core.DetailedResponse, err error)
ServiceCall<List<ActiveTask>> getActiveTasks()
getActiveTasks(params)
get_active_tasks(
self,
**kwargs,
) -> DetailedResponse
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
No Request Parameters
No Request Parameters
No Request Parameters
No Request Parameters
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/_active_tasks"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } getActiveTasksOptions := service.NewGetActiveTasksOptions() activeTask, response, err := service.GetActiveTasks(getActiveTasksOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(activeTask, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.ActiveTask;
Cloudant service = Cloudant.newInstance(); List<ActiveTask> response = service.getActiveTasks().execute().getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.getActiveTasks().then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.get_active_tasks().get_result() print(response)
Response
Response type: []ActiveTask
Response type: List<ActiveTask>
Response type: ActiveTask[]
Response type: List[ActiveTask]
Schema for a list of ActiveTask elements.
Source database.
Possible values: 1 ≤ length ≤ 238, Value must match regular expression
^_dbs$|^_global_changes$|^_metadata$|^_nodes$|^_replicator$|^_users$|^[a-z][a-z0-9_$()+/-]*$
Cluster node where the task is running.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Process ID.
Possible values: 1 ≤ length ≤ 34, Value must match regular expression
^.+$
Schema for a Unix epoch timestamp.
Possible values: 0 ≤ value ≤ 2147483647
Operation type.
Possible values: [
database_compaction
,indexer
,replication
,search_indexer
,view_compaction
]Schema for a Unix epoch timestamp.
Possible values: 0 ≤ value ≤ 2147483647
The total count of attempted doc revisions fetched with
_bulk_get
. Available forreplication
type tasks.Possible values: 0 ≤ value ≤ 9007199254740992
The total count of successful docs fetched with
_bulk_get
. Available forreplication
type tasks.Possible values: 0 ≤ value ≤ 9007199254740992
Processed changes. Available for
database_compaction
,indexer
,search_indexer
,view_compaction
type tasks.Possible values: 0 ≤ value ≤ 9007199254740992
The count of changes not yet replicated. Available for
replication
type tasks.Possible values: 0 ≤ value ≤ 9007199254740992
Specifies the checkpoint interval in ms. Available for
replication
type tasks.Possible values: 0 ≤ value ≤ 2147483647
The source sequence id which was last successfully replicated. Available for
replication
type tasks.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
The replication configured to be continuous. Available for
replication
type tasks.The design document that belongs to this task. Available for
indexer
,search_indexer
,view_compaction
type tasks.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
^_design\/.+$
Replication document ID. Available for
replication
type tasks.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$
Number of document write failures. Available for
replication
type tasks.Possible values: 0 ≤ value ≤ 9007199254740992
Number of documents read. Available for
replication
type tasks.Possible values: 0 ≤ value ≤ 9007199254740992
Number of documents written to target. Available for
replication
type tasks.Possible values: 0 ≤ value ≤ 9007199254740992
The search index that belongs to this task. Available for
search_indexer
type tasks.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].*$|^_all_docs$
Indexer process ID. Available for
indexer
type tasks.Possible values: 1 ≤ length ≤ 34, Value must match regular expression
^.+$
The count of docs which have been read from the source. Available for
replication
type tasks.Possible values: 0 ≤ value ≤ 9007199254740992
The phase the active task is in.
docid_sort
,docid_copy
,document_copy
phases are available fordatabase_compaction
, whileids
andview
phases are available forview_compaction
type tasks.Possible values: [
docid_sort
,docid_copy
,document_copy
,ids
,view
]Process status.
Possible values: [
exiting
,garbage_collecting
,runnable
,running
,suspended
,waiting
]Current percentage progress. Available for
database_compaction
,indexer
,search_indexer
,view_compaction
type tasks.Possible values: 0 ≤ value ≤ 100
Replication ID. Available for
replication
type tasks.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Indicates whether a compaction retry is currently running on the database. Available for
database_compaction
type tasks.The count of revisions which have been checked since this replication began. Available for
replication
type tasks.Possible values: 0 ≤ value ≤ 9007199254740992
Replication source. Available for
replication
type tasks.Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
^https:\/\/.*$
The last sequence number obtained from the source database changes feed. Available for
replication
type tasks.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Replication target. Available for
replication
type tasks.Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
^https:\/\/.*$
The last sequence number processed by the replicator. Available for
replication
type tasks.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$
Total changes to process. Available for
database_compaction
,indexer
,search_indexer
,view_compaction
type tasks.Possible values: 0 ≤ value ≤ 9007199254740992
Name of user running the process.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$
Number of view indexes. Available for
view_compaction
type tasks.Possible values: 0 ≤ value ≤ 4294967295
Status Code
HTTP response for
/_active_tasks
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example ActiveTasks response.
[ { "changes_done": 64438, "database": "products", "node": "nonode@nohost", "pid": "<0.12986.1>", "progress": 84, "started_on": 1376116576, "total_changes": 76215, "type": "database_compaction", "updated_on": 1376116619 }, { "changes_done": 14443, "database": "users", "design_document": "_design/c9753817b3ba7c674d92361f24f59b9f", "node": "nonode@nohost", "pid": "<0.10461.3>", "progress": 18, "started_on": 1376116621, "total_changes": 76215, "type": "indexer", "updated_on": 1376116650 } ]
Example ActiveTasks response.
[ { "changes_done": 64438, "database": "products", "node": "nonode@nohost", "pid": "<0.12986.1>", "progress": 84, "started_on": 1376116576, "total_changes": 76215, "type": "database_compaction", "updated_on": 1376116619 }, { "changes_done": 14443, "database": "users", "design_document": "_design/c9753817b3ba7c674d92361f24f59b9f", "node": "nonode@nohost", "pid": "<0.10461.3>", "progress": 18, "started_on": 1376116621, "total_changes": 76215, "type": "indexer", "updated_on": 1376116650 } ]
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve the HTTP headers for running tasks
Retrieves the HTTP headers for running tasks.
HEAD /_active_tasks
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for
/_active_tasks
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Query the data usage for the current user
Provides the user data usage information for the current month up to the current time in requested granularity. If no granularity specified it defaults for 12 hours period. Results are provided in time-based blocks.
GET /_api/v2/usage/data_volume
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Query Parameters
Query parameter to specify the granularity of report interval for data usage.
Allowable values: [
1
,2
,3
,4
,6
,8
,12
,24
]Possible values: 1 ≤ value ≤ 24
Default:
12
Response
Schema for UsageDataVolume.
An object representing data points for an average amount of data stored over the granularity period.
- data_vol
Schema for UsageDataVolumeDataPoint.
The timestamp of an endpoint for the usage report.
Possible values: 1 ≤ length ≤ 26
The granularity is the period for each record in the 'data_vol' object. By default it is 12h, but the user may add a query string option with a different granularity between 1 and 24 which evenly divides 24.
Possible values: 2 ≤ length ≤ 3, Value must match regular expression
^([123468]|12|24)h$
The timestamp of a start point for the usage report.
Possible values: 1 ≤ length ≤ 26
Status Code
HTTP response for getUsageDataVolume.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example getUsageDataVolume response.
{ "data_vol": { "2023-07-01T00:00:00+00:00": { "dbs": 1303887, "search": 2040705, "views": 259119 }, "2023-07-01T12:00:00+00:00": { "dbs": 1303887, "search": 2058488, "views": 259119 }, "2023-07-02T00:00:00+00:00": { "dbs": 1303887, "search": 2054713, "views": 259119 }, "2023-07-02T12:00:00+00:00": { "dbs": 1303887, "search": 2042348, "views": 259119 } }, "end": "2023-07-02T00:00:00+00:00", "granularity": "12h", "start": "2023-07-01T00:00:00+00:00" }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Query the data usage for the current user in given time period
Provides the user data usage information for a given time period in requested granularity. If no granularity is specified it defaults for 12 hours period. Results are provided in time-based blocks.
GET /_api/v2/usage/data_volume/{year}/{month}
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the year.
Possible values: length = 4, Value must match regular expression
^\d{3}[1-9]$
Path parameter to specify the month.
Possible values: length = 2, Value must match regular expression
^0?[1-9]|1[012]$
Query Parameters
Query parameter to specify the granularity of report interval for data usage.
Allowable values: [
1
,2
,3
,4
,6
,8
,12
,24
]Possible values: 1 ≤ value ≤ 24
Default:
12
Response
Schema for UsageDataVolume.
An object representing data points for an average amount of data stored over the granularity period.
- data_vol
Schema for UsageDataVolumeDataPoint.
The timestamp of an endpoint for the usage report.
Possible values: 1 ≤ length ≤ 26
The granularity is the period for each record in the 'data_vol' object. By default it is 12h, but the user may add a query string option with a different granularity between 1 and 24 which evenly divides 24.
Possible values: 2 ≤ length ≤ 3, Value must match regular expression
^([123468]|12|24)h$
The timestamp of a start point for the usage report.
Possible values: 1 ≤ length ≤ 26
Status Code
HTTP response for getUsageDataVolume.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example getUsageDataVolume response.
{ "data_vol": { "2023-07-01T00:00:00+00:00": { "dbs": 1303887, "search": 2040705, "views": 259119 }, "2023-07-01T12:00:00+00:00": { "dbs": 1303887, "search": 2058488, "views": 259119 }, "2023-07-02T00:00:00+00:00": { "dbs": 1303887, "search": 2054713, "views": 259119 }, "2023-07-02T12:00:00+00:00": { "dbs": 1303887, "search": 2042348, "views": 259119 } }, "end": "2023-07-02T00:00:00+00:00", "granularity": "12h", "start": "2023-07-01T00:00:00+00:00" }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve the user information
Provides the user document that includes both user's personal information and technical details of the account.
GET /_api/v2/user
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Response
Schema for UserInformation.
Status Code
HTTP response for getUserInformation.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example getUserInformation response.
{ "activity_tracker_event_types": [ "management" ], "admin": false, "admin_clusters": [], "cluster": "bm-cc-us-east-01", "cluster_type": "multitenant", "company": null, "cross_cloud_connector": false, "date": "2023-02-24 19:15:37", "disabled": {}, "domains": [ { "domain": "5lll032-dd12-536e-09b3-432fg9f07e78-bluemix.cloudant.com", "preferred": false, "type": "external" }, { "domain": "5lll032-dd12-536e-09b3-432fg9f07e78-bluemix.cloudantnosqldb.appdomain.cloud", "preferred": true, "type": "external" } ], "email": "dev@us.ibm.com", "features": {}, "first_name": "Bluemix", "last_name": "User", "last_pw_change": "2023-02-24 19:15:37", "over_quota": false, "partners": { "bluemix": { "bss_account_id": "167e0247e28648128b4a30db9238c2d1 crn: 'crn:v1:bluemix:public:cloudantnosqldb:us-south:a/167e0247e28648128b4a30db9238c2d1:4cdba765-34ee-4517-9c6a-11d342f13dbf::'", "iam_enabled": true, "legacy_credentials": true, "name": "example-cloudant", "resource_group_crn": "crn:v1:bluemix:public:resource-controller::a/167e0247e28648128b4a30db9238c2d1::resource-group:856cfc09382f45e9a86604fa8908b9e9", "root_credential_status": "active" } }, "plan": "billing.tiered.bluemix.lite", "plan_multiple": null, "shared_databases": [], "stripe_enabled": false, "support_level": "basic", "target_plan_multiple": null, "target_throughput": null, "throughput": null, "username": "5lll032-dd12-536e-09b3-432fg9f07e78-bluemix" }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve activity tracking events information
Check event types sent to IBM Cloud Activity Tracker Event Routing for the IBM Cloudant instance.
Check event types sent to IBM Cloud Activity Tracker Event Routing for the IBM Cloudant instance.
Check event types sent to IBM Cloud Activity Tracker Event Routing for the IBM Cloudant instance.
Check event types sent to IBM Cloud Activity Tracker Event Routing for the IBM Cloudant instance.
Check event types sent to IBM Cloud Activity Tracker Event Routing for the IBM Cloudant instance.
GET /_api/v2/user/activity_tracker/events
(cloudant *CloudantV1) GetActivityTrackerEvents(getActivityTrackerEventsOptions *GetActivityTrackerEventsOptions) (result *ActivityTrackerEvents, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) GetActivityTrackerEventsWithContext(ctx context.Context, getActivityTrackerEventsOptions *GetActivityTrackerEventsOptions) (result *ActivityTrackerEvents, response *core.DetailedResponse, err error)
ServiceCall<ActivityTrackerEvents> getActivityTrackerEvents()
getActivityTrackerEvents(params)
get_activity_tracker_events(
self,
**kwargs,
) -> DetailedResponse
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
No Request Parameters
No Request Parameters
No Request Parameters
No Request Parameters
ibmcloud cloudant events-config
curl -H "Authorization: Bearer $API_BEARER_TOKEN" "$SERVICE_URL/_api/v2/user/activity_tracker/events"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } getActivityTrackerEventsOptions := service.NewGetActivityTrackerEventsOptions() activityTrackerEvents, response, err := service.GetActivityTrackerEvents(getActivityTrackerEventsOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(activityTrackerEvents, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.ActivityTrackerEvents;
Cloudant service = Cloudant.newInstance(); ActivityTrackerEvents response = service.getActivityTrackerEvents().execute().getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.getActivityTrackerEvents().then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.get_activity_tracker_events().get_result() print(response)
Response
Schema for activity tracking events.
An array of event types sent to IBM Cloud Activity Tracker Event Routing for the IBM Cloudant instance. "management" is a required element of this array.
Possible values: [
management
,data
]Possible values: 1 ≤ number of items ≤ 2, contains only unique items
Schema for activity tracking events.
An array of event types sent to IBM Cloud Activity Tracker Event Routing for the IBM Cloudant instance. "management" is a required element of this array.
Possible values: [
management
,data
]Possible values: 1 ≤ number of items ≤ 2
Schema for activity tracking events.
An array of event types sent to IBM Cloud Activity Tracker Event Routing for the IBM Cloudant instance. "management" is a required element of this array.
Possible values: [
management
,data
]Possible values: 1 ≤ number of items ≤ 2
Schema for activity tracking events.
An array of event types sent to IBM Cloud Activity Tracker Event Routing for the IBM Cloudant instance. "management" is a required element of this array.
Possible values: [
management
,data
]Possible values: 1 ≤ number of items ≤ 2
Schema for activity tracking events.
An array of event types sent to IBM Cloud Activity Tracker Event Routing for the IBM Cloudant instance. "management" is a required element of this array.
Possible values: [
management
,data
]Possible values: 1 ≤ number of items ≤ 2
Status Code
HTTP response for getActivityTrackerEvents.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example ActivityTrackerEvents request and response.
{ "types": [ "management", "data" ] }
Example ActivityTrackerEvents request and response.
{ "types": [ "management", "data" ] }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Modify activity tracking events configuration
Configure event types sent to IBM Cloud Activity Tracker Event Routing for the IBM Cloudant instance.
Configure event types sent to IBM Cloud Activity Tracker Event Routing for the IBM Cloudant instance.
Configure event types sent to IBM Cloud Activity Tracker Event Routing for the IBM Cloudant instance.
Configure event types sent to IBM Cloud Activity Tracker Event Routing for the IBM Cloudant instance.
Configure event types sent to IBM Cloud Activity Tracker Event Routing for the IBM Cloudant instance.
POST /_api/v2/user/activity_tracker/events
(cloudant *CloudantV1) PostActivityTrackerEvents(postActivityTrackerEventsOptions *PostActivityTrackerEventsOptions) (result *Ok, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) PostActivityTrackerEventsWithContext(ctx context.Context, postActivityTrackerEventsOptions *PostActivityTrackerEventsOptions) (result *Ok, response *core.DetailedResponse, err error)
ServiceCall<Ok> postActivityTrackerEvents(PostActivityTrackerEventsOptions postActivityTrackerEventsOptions)
postActivityTrackerEvents(params)
post_activity_tracker_events(
self,
types: List[str],
**kwargs,
) -> DetailedResponse
Request
Instantiate the PostActivityTrackerEventsOptions
struct and set the fields to provide parameter values for the PostActivityTrackerEvents
method.
Use the PostActivityTrackerEventsOptions.Builder
to create a PostActivityTrackerEventsOptions
object that contains the parameter values for the postActivityTrackerEvents
method.
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
HTTP request body for postActivityTrackerEvents.
Example ActivityTrackerEvents request and response.
{
"types": [
"management",
"data"
]
}
An array of event types sent to IBM Cloud Activity Tracker Event Routing for the IBM Cloudant instance. "management" is a required element of this array.
Allowable values: [
management
,data
]Possible values: 1 ≤ number of items ≤ 2, contains only unique items
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The PostActivityTrackerEvents options.
An array of event types sent to IBM Cloud Activity Tracker Event Routing for the IBM Cloudant instance. "management" is a required element of this array.
Allowable values: [
management
,data
]Possible values: 1 ≤ number of items ≤ 2
Examples:[ "management", "data" ]
The postActivityTrackerEvents options.
An array of event types sent to IBM Cloud Activity Tracker Event Routing for the IBM Cloudant instance. "management" is a required element of this array.
Allowable values: [
management
,data
]Possible values: 1 ≤ number of items ≤ 2
Examples:[ "management", "data" ]
parameters
An array of event types sent to IBM Cloud Activity Tracker Event Routing for the IBM Cloudant instance. "management" is a required element of this array.
Allowable values: [
management
,data
]Possible values: 1 ≤ number of items ≤ 2
Examples:
parameters
An array of event types sent to IBM Cloud Activity Tracker Event Routing for the IBM Cloudant instance. "management" is a required element of this array.
Allowable values: [
management
,data
]Possible values: 1 ≤ number of items ≤ 2
Examples:
ibmcloud cloudant events-config-update --types management,data
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X POST "$SERVICE_URL/_api/v2/user/activity_tracker/events" --data '{"types": ["data", "management"]}'
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } postActivityTrackerEventsOptions := service.NewPostActivityTrackerEventsOptions( []string{"management"}, ) activityTrackerEvents, response, err := service.PostActivityTrackerEvents(postActivityTrackerEventsOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(activityTrackerEvents, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.Ok; import com.ibm.cloud.cloudant.v1.model.PostActivityTrackerEventsOptions;
Cloudant service = Cloudant.newInstance(); PostActivityTrackerEventsOptions options = new PostActivityTrackerEventsOptions.Builder() .addTypes("management") .build(); Ok response = service.postActivityTrackerEvents(options).execute().getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.postActivityTrackerEvents({ types: ['management'], }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.post_activity_tracker_events( types=['management'] ).get_result() print(response)
Response
Schema for an OK result.
ok
Schema for an OK result.
ok.
Schema for an OK result.
ok.
Schema for an OK result.
ok.
Schema for an OK result.
ok.
Status Code
HTTP response for Ok operations.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for unsupported media type.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example Ok response.
{ "ok": true }
Example Ok response.
{ "ok": true }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for unsupported media type.
{ "error": "bad_content_type", "reason": "Content-Type must be application/json" }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve maximum allowed database count
Retrieves the maximum number of databases currently allowed in the instance.
Retrieves the maximum number of databases currently allowed in the instance.
Retrieves the maximum number of databases currently allowed in the instance.
Retrieves the maximum number of databases currently allowed in the instance.
Retrieves the maximum number of databases currently allowed in the instance.
GET /_api/v2/user/capacity/databases
(cloudant *CloudantV1) GetCapacityDatabasesInformation(getCapacityDatabasesInformationOptions *GetCapacityDatabasesInformationOptions) (result *CapacityDatabasesInformation, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) GetCapacityDatabasesInformationWithContext(ctx context.Context, getCapacityDatabasesInformationOptions *GetCapacityDatabasesInformationOptions) (result *CapacityDatabasesInformation, response *core.DetailedResponse, err error)
ServiceCall<CapacityDatabasesInformation> getCapacityDatabasesInformation()
getCapacityDatabasesInformation(params)
get_capacity_databases_information(
self,
**kwargs,
) -> DetailedResponse
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
No Request Parameters
No Request Parameters
No Request Parameters
No Request Parameters
Response
Schema for information about maximum total database count.
Schema for information about the current database capacity.
Schema for information about maximum total database count.
Schema for information about the current database capacity.
- Current
Schema for databases count.
- Databases
The total number of databases.
Possible values: 0 ≤ value ≤ 4294967295
Schema for information about maximum total database count.
Schema for information about the current database capacity.
- current
Schema for databases count.
- databases
The total number of databases.
Possible values: 0 ≤ value ≤ 4294967295
Schema for information about maximum total database count.
Schema for information about the current database capacity.
- current
Schema for databases count.
- databases
The total number of databases.
Possible values: 0 ≤ value ≤ 4294967295
Schema for information about maximum total database count.
Schema for information about the current database capacity.
- current
Schema for databases count.
- databases
The total number of databases.
Possible values: 0 ≤ value ≤ 4294967295
Status Code
HTTP response for maximum number of databases allowed in an instance.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
{ "current": { "databases": { "total": 200 } } }
{ "current": { "databases": { "total": 200 } } }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieves CCM diagnostics for the user
This endpoint is an authentication pass-through to retrieve the CCM diagnostics from HAProxy for a given user which requires the specific user be authenticated.
GET /_api/v2/user/ccm_diagnostics
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Response
Schema for CcmDiagnostics.
Schema for a history of requests.
Possible values: 0 ≤ number of items ≤ 5
Schema for a history of requests.
Possible values: 0 ≤ number of items ≤ 5
The account name for the authenticated user.
Possible values: 1 ≤ length ≤ 63, Value must match regular expression
^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$
Lookup count from HAProxy for the user.
Possible values: 0 ≤ value ≤ 21689584840
Query count from HAProxy for the user.
Possible values: 0 ≤ value ≤ 21474836475
Schema for a Unix epoch timestamp.
Possible values: 0 ≤ value ≤ 2147483647
Write count from HAProxy for the user.
Possible values: 0 ≤ value ≤ 21474836475
Status Code
HTTP response for getCcmDiagnostics.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example getCcmDiagnostics response.
{ "account": "5lll032-dd12-536e-09b3-432fg9f07e78-bluemix", "deny429History": [ { "lookup": 0, "query": 0, "ts": 1688993801, "write": 0 } ], "lookup": 0, "operationHistory": [ { "lookup": 0, "query": 0, "ts": 1688993801, "write": 0 } ], "query": 0, "ts": 1688993805, "write": 0 }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve current database count
Retrieves the current number of databases that exist in the instance.
Retrieves the current number of databases that exist in the instance.
Retrieves the current number of databases that exist in the instance.
Retrieves the current number of databases that exist in the instance.
Retrieves the current number of databases that exist in the instance.
GET /_api/v2/user/current/databases
(cloudant *CloudantV1) GetCurrentDatabasesInformation(getCurrentDatabasesInformationOptions *GetCurrentDatabasesInformationOptions) (result *CurrentDatabasesInformation, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) GetCurrentDatabasesInformationWithContext(ctx context.Context, getCurrentDatabasesInformationOptions *GetCurrentDatabasesInformationOptions) (result *CurrentDatabasesInformation, response *core.DetailedResponse, err error)
ServiceCall<CurrentDatabasesInformation> getCurrentDatabasesInformation()
getCurrentDatabasesInformation(params)
get_current_databases_information(
self,
**kwargs,
) -> DetailedResponse
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
No Request Parameters
No Request Parameters
No Request Parameters
No Request Parameters
Response
Schema for information about the current database counts.
Schema for databases count.
Schema for information about the current database counts.
Schema for databases count.
- Databases
The total number of databases.
Possible values: 0 ≤ value ≤ 4294967295
Schema for information about the current database counts.
Schema for databases count.
- databases
The total number of databases.
Possible values: 0 ≤ value ≤ 4294967295
Schema for information about the current database counts.
Schema for databases count.
- databases
The total number of databases.
Possible values: 0 ≤ value ≤ 4294967295
Schema for information about the current database counts.
Schema for databases count.
- databases
The total number of databases.
Possible values: 0 ≤ value ≤ 4294967295
Status Code
HTTP response for current database count.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
{ "databases": { "total": 42 } }
{ "databases": { "total": 42 } }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve the current provisioned throughput capacity consumption
View the current consumption of provisioned throughput capacity for an IBM Cloudant instance. The current consumption shows the quantities of reads, writes, and global queries conducted against the instance for a given second.
View the current consumption of provisioned throughput capacity for an IBM Cloudant instance. The current consumption shows the quantities of reads, writes, and global queries conducted against the instance for a given second.
View the current consumption of provisioned throughput capacity for an IBM Cloudant instance. The current consumption shows the quantities of reads, writes, and global queries conducted against the instance for a given second.
View the current consumption of provisioned throughput capacity for an IBM Cloudant instance. The current consumption shows the quantities of reads, writes, and global queries conducted against the instance for a given second.
View the current consumption of provisioned throughput capacity for an IBM Cloudant instance. The current consumption shows the quantities of reads, writes, and global queries conducted against the instance for a given second.
GET /_api/v2/user/current/throughput
(cloudant *CloudantV1) GetCurrentThroughputInformation(getCurrentThroughputInformationOptions *GetCurrentThroughputInformationOptions) (result *CurrentThroughputInformation, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) GetCurrentThroughputInformationWithContext(ctx context.Context, getCurrentThroughputInformationOptions *GetCurrentThroughputInformationOptions) (result *CurrentThroughputInformation, response *core.DetailedResponse, err error)
ServiceCall<CurrentThroughputInformation> getCurrentThroughputInformation()
getCurrentThroughputInformation(params)
get_current_throughput_information(
self,
**kwargs,
) -> DetailedResponse
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
No Request Parameters
No Request Parameters
No Request Parameters
No Request Parameters
ibmcloud cloudant throughput
curl -H "Authorization: Bearer $API_BEARER_TOKEN" "$SERVICE_URL/_api/v2/user/current/throughput"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } getCurrentThroughputInformationOptions := service.NewGetCurrentThroughputInformationOptions() currentThroughputInformation, response, err := service.GetCurrentThroughputInformation(getCurrentThroughputInformationOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(currentThroughputInformation, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.CurrentThroughputInformation;
Cloudant service = Cloudant.newInstance(); CurrentThroughputInformation response = service.getCurrentThroughputInformation().execute().getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.getCurrentThroughputInformation().then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.get_current_throughput_information().get_result() print(response)
Response
Schema for information about current consumption of a provisioned throughput capacity.
Detailed information about current consumption.
Schema for information about current consumption of a provisioned throughput capacity.
Detailed information about current consumption.
- Throughput
Number of global queries conducted against the instance for a given second.
Possible values: 0 ≤ value ≤ 4294967295
Number of reads conducted against the instance for a given second.
Possible values: 0 ≤ value ≤ 4337916968
Number of writes conducted against the instance for a given second.
Possible values: 0 ≤ value ≤ 4294967295
Schema for information about current consumption of a provisioned throughput capacity.
Detailed information about current consumption.
- throughput
Number of global queries conducted against the instance for a given second.
Possible values: 0 ≤ value ≤ 4294967295
Number of reads conducted against the instance for a given second.
Possible values: 0 ≤ value ≤ 4337916968
Number of writes conducted against the instance for a given second.
Possible values: 0 ≤ value ≤ 4294967295
Schema for information about current consumption of a provisioned throughput capacity.
Detailed information about current consumption.
- throughput
Number of global queries conducted against the instance for a given second.
Possible values: 0 ≤ value ≤ 4294967295
Number of reads conducted against the instance for a given second.
Possible values: 0 ≤ value ≤ 4337916968
Number of writes conducted against the instance for a given second.
Possible values: 0 ≤ value ≤ 4294967295
Schema for information about current consumption of a provisioned throughput capacity.
Detailed information about current consumption.
- throughput
Number of global queries conducted against the instance for a given second.
Possible values: 0 ≤ value ≤ 4294967295
Number of reads conducted against the instance for a given second.
Possible values: 0 ≤ value ≤ 4337916968
Number of writes conducted against the instance for a given second.
Possible values: 0 ≤ value ≤ 4294967295
Status Code
HTTP response for getCurrentThroughputInformation.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example CurrentThroughputInformation response.
{ "throughput": { "query": 13, "read": 133, "write": 42 } }
Example CurrentThroughputInformation response.
{ "throughput": { "query": 13, "read": 133, "write": 42 } }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieves a user's plan and plan history
Returns a user's plan, optionally plan history, and plan information.
GET /_api/v2/user/plan
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Query Parameters
Return user's plan history if true.
Default:
true
Earliest date from which to include plan changes in history
Possible values: 1 ≤ length ≤ 26
Response
Schema for UserPlan.
The history of plan changes for the authenticated user.
Possible values: number of items = 2
The data charging model for the authenticated user.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The data quota for the authenticated user.
Possible values: 3 ≤ length ≤ 7168, Value must match regular expression
^[1-9][0-9]*(K|M|G)B$
The plan for the authenticated user.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
The plan for the authenticated user.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Schema for CcmDiagnostics version of throughput information.
Status Code
HTTP response for putUserPlan.
HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example getUserPlan response.
{ "data_charging_model": "capped", "data_quota": "1GB", "history": [ [ "2023-01-16T19:01:03.000Z", "metered" ], [ "2016-03-14T20:56:00.000Z", "billing.tiered.standard.1" ] ], "name": "Bluemix Lite Plan", "throughput": { "lookup": 20, "query": 5, "write": 10 } }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve cluster membership information
Displays the nodes that are part of the cluster as cluster_nodes
. The field, all_nodes
, displays all nodes this node knows about, including the ones that are part of the cluster. This endpoint is useful when you set up a cluster.
Displays the nodes that are part of the cluster as cluster_nodes
. The field, all_nodes
, displays all nodes this node knows about, including the ones that are part of the cluster. This endpoint is useful when you set up a cluster.
Displays the nodes that are part of the cluster as cluster_nodes
. The field, all_nodes
, displays all nodes this node knows about, including the ones that are part of the cluster. This endpoint is useful when you set up a cluster.
Displays the nodes that are part of the cluster as cluster_nodes
. The field, all_nodes
, displays all nodes this node knows about, including the ones that are part of the cluster. This endpoint is useful when you set up a cluster.
Displays the nodes that are part of the cluster as cluster_nodes
. The field, all_nodes
, displays all nodes this node knows about, including the ones that are part of the cluster. This endpoint is useful when you set up a cluster.
GET /_membership
(cloudant *CloudantV1) GetMembershipInformation(getMembershipInformationOptions *GetMembershipInformationOptions) (result *MembershipInformation, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) GetMembershipInformationWithContext(ctx context.Context, getMembershipInformationOptions *GetMembershipInformationOptions) (result *MembershipInformation, response *core.DetailedResponse, err error)
ServiceCall<MembershipInformation> getMembershipInformation()
getMembershipInformation(params)
get_membership_information(
self,
**kwargs,
) -> DetailedResponse
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
No Request Parameters
No Request Parameters
No Request Parameters
No Request Parameters
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/_membership"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } getMembershipInformationOptions := service.NewGetMembershipInformationOptions() membershipInformation, response, err := service.GetMembershipInformation(getMembershipInformationOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(membershipInformation, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.MembershipInformation;
Cloudant service = Cloudant.newInstance(); MembershipInformation response = service.getMembershipInformation().execute().getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.getMembershipInformation().then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.get_membership_information().get_result() print(response)
Response
Schema for information about known nodes and cluster membership.
List of nodes this node knows about, including the ones that are part of the cluster.
Possible values: 1 ≤ number of items ≤ 64, 1 ≤ length ≤ 255, Value must match regular expression
^.+$
All cluster nodes.
Possible values: 1 ≤ number of items ≤ 64, 1 ≤ length ≤ 255, Value must match regular expression
^.+$
Schema for information about known nodes and cluster membership.
List of nodes this node knows about, including the ones that are part of the cluster.
Possible values: 1 ≤ number of items ≤ 64, 1 ≤ length ≤ 255, Value must match regular expression
/^.+$/
All cluster nodes.
Possible values: 1 ≤ number of items ≤ 64, 1 ≤ length ≤ 255, Value must match regular expression
/^.+$/
Schema for information about known nodes and cluster membership.
List of nodes this node knows about, including the ones that are part of the cluster.
Possible values: 1 ≤ number of items ≤ 64, 1 ≤ length ≤ 255, Value must match regular expression
/^.+$/
All cluster nodes.
Possible values: 1 ≤ number of items ≤ 64, 1 ≤ length ≤ 255, Value must match regular expression
/^.+$/
Schema for information about known nodes and cluster membership.
List of nodes this node knows about, including the ones that are part of the cluster.
Possible values: 1 ≤ number of items ≤ 64, 1 ≤ length ≤ 255, Value must match regular expression
/^.+$/
All cluster nodes.
Possible values: 1 ≤ number of items ≤ 64, 1 ≤ length ≤ 255, Value must match regular expression
/^.+$/
Schema for information about known nodes and cluster membership.
List of nodes this node knows about, including the ones that are part of the cluster.
Possible values: 1 ≤ number of items ≤ 64, 1 ≤ length ≤ 255, Value must match regular expression
/^.+$/
All cluster nodes.
Possible values: 1 ≤ number of items ≤ 64, 1 ≤ length ≤ 255, Value must match regular expression
/^.+$/
Status Code
HTTP response for
/_membership
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example MembershipInformation response.
{ "all_nodes": [ "node1@127.0.0.1", "node2@127.0.0.1", "node3@127.0.0.1" ], "cluster_nodes": [ "node1@127.0.0.1", "node2@127.0.0.1", "node3@127.0.0.1" ] }
Example MembershipInformation response.
{ "all_nodes": [ "node1@127.0.0.1", "node2@127.0.0.1", "node3@127.0.0.1" ], "cluster_nodes": [ "node1@127.0.0.1", "node2@127.0.0.1", "node3@127.0.0.1" ] }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve the HTTP headers for cluster membership
Retrieves the HTTP headers for cluster membership.
HEAD /_membership
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for
/_membership
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Retrieve running server statistics
Returns a JSON object that contains the statistics for the running server. The object is structured with top-level sections collating the statistics for a range of entries, with each individual statistic being easily identified. The content of each statistic is self-describing. The literal string, _local
, serves as an alias for the local node name. For any URL, {node-name}/_stats
can be replaced with _local/_stats
to interact with the local node's statistics.
GET /_node/{node_name}/_stats
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the node name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^\w+@.+$
Response
Schema for node statistics.
couch_log alert: Number of logged alert messages. critical: Number of logged critical messages. debug: Number of logged debug messages. emergency: Number of logged emergency messages. error: Number of logged error messages. info: Number of logged info messages. notice: Number of logged notice messages. warning: Number of logged warning messages.
couch_replicator changes_manager_deaths: Number of failed replicator changes managers. changes_queue_deaths: Number of failed replicator changes work queues. changes_read_failures: Number of failed replicator changes read failures. changes_reader_deaths: Number of failed replicator changes readers. checkpoints: checkpoint statistics cluster_is_stable: 1 if cluster is stable, 0 if unstable. connection: connection statistics db_scans: Number of times replicator db scans have been started. docs: doc statistics failed_starts: Number of replications that have failed to start. jobs: job statistics requests: Number of http requests made by the replicator. responses: response statistics stream_responses: stream response statistics worker_deaths: Number of failed replicator workers. workers_started: Number of replicator workers started.
couchdb auth_cache_hits: Number of authentication cache hits. auth_cache_misses: Number of authentication cache misses. collect_results_time: Microsecond latency for calls to couch_db:collect_results/3. couch_server: server statistics database_reads: Number of times a document was read from a database. database_purges: Number of times a database was purged. database_writes: Number of times a database was changed. db_open_time: Milliseconds required to open a database. dbinfo: Distribution of latencies for calls to retrieve db info. document_inserts: Number of documents inserted. document_purges: Number of document purge operations. document_writes: Number of document write operations. httpd: httpd statistics httpd_request_methods: HTTP request method statistics httpd_status_codes: HTTP status code statistics io_queue: IO queue statistics io_queue2: IO queue2 statistics io_queue_bypassed: IO queue bypass statistics local_document_writes: Number of _local document write operations. mrview: mrview statistics open_databases: Number of open databases. open_os_files: Number of file descriptors couchdb has open. query_server: Query server statistics request_time: Length of a request inside couchdb without mochiweb.
ddoc_cache hit: Number of design doc cache hits. miss: Number of design doc cache misses. recovery: Number of design doc cache recoveries.
dreyfus httpd: httpd statistics index: index statistics rpc: rpc statistics
fabric doc_update: doc_update statistics open_shard: open_shard statistics read_repairs: read_repairs statistics worker: worker statistics
global_changes db_writes: Number of db writes performed by global changes. event_doc_conflict: Number of conflicted event docs encountered by global changes. listener_pending_updates: Number of global changes updates pending writes in global_changes_listener. rpcs: Number of rpc operations performed by global_changes. server_pending_updates: Number of global changes updates pending writes in global_changes_server.
mango docs_examined: number of documents examined by mango queries coordinated by this node evaluate_selector: number of mango selector evaluations query_invalid_index: number of mango queries that generated an invalid index warning query_time: length of time processing a mango query quorum_docs_examined: number of documents examined by mango queries, using cluster quorum results_returned: number of rows returned by mango queries too_many_docs_scanned: number of mango queries that generated an index scan warning unindexed_queries: number of mango queries that could not use an index
mem3 shard_cache: shard_cache statistics
pread exceed_eof: Number of the attempts to read beyond end of db file. exceed_limit: Number of the attempts to read beyond set limit.
rexi buffered: Number of rexi messages buffered. down: Number of rexi_down messages handled. dropped: Number of rexi messages dropped from buffers. streams: Stream statistics
cassim
couch_audit event: Number of audit events. failures: Number of failed tcp audit transmissions. success: Number of successful tcp audit transmissions. tcp_send_latency: Tcp transmission latency.
dbcopy acquire_lock: Number of lock acquisitions performed by dbcopy. noop: Number of dbcopy writes skipped. update_doc: Number of dbcopy write operations attempted. update_error: Number of failed dbcopy writes.
epep access_token_latency: Distribution of latencies for calls to acquire access tokens. authz_latency: Distribution of latencies for calls to retrieve pdp decisions. authz_service_available: IAM PDP is currently available. decision_cache: decision_cache statistics keystore_service_available: IAM keystore service is currently available. replicator_token: replicator_token statistics replicator_token_latency: Distribution of latencies for replicator access token requests. token_service_available: IAM token service is currently available.
Status Code
HTTP response for
/_node/{node_name}/_stats
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example NodeStatsInformation response.
{ "couch_log": {}, "couch_replicator": {}, "couchdb": {}, "dbcopy": {}, "ddoc_cache": {}, "dreyfus": {}, "fabric": {}, "global_changes": { "db_writes": { "desc": "number of db writes performed by global changes", "type": "counter", "value": 95100 }, "event_doc_conflict": { "desc": "number of conflicted event docs encountered by global changes", "type": "counter", "value": 0 }, "listener_pending_updates": { "desc": "number of global changes updates pending writes in global_changes_listener", "type": "gauge", "value": 0 }, "rpcs": { "desc": "number of rpc operations performed by global_changes", "type": "counter", "value": 340161 }, "server_pending_updates": { "desc": "number of global changes updates pending writes in global_changes_server", "type": "gauge", "value": 0 } }, "mango": { "docs_examined": { "desc": "number of documents examined by mango queries coordinated by this node", "type": "counter", "value": 0 }, "evaluate_selector": { "desc": "number of mango selector evaluations", "type": "counter", "value": 0 }, "query_invalid_index": { "desc": "number of mango queries that generated an invalid index warning", "type": "counter", "value": 0 }, "query_time": { "desc": "length of time processing a mango query", "type": "histogram", "value": {} }, "quorum_docs_examined": { "desc": "number of documents examined by mango queries, using cluster quorum", "type": "counter", "value": 0 }, "results_returned": { "desc": "number of rows returned by mango queries", "type": "counter", "value": 0 }, "too_many_docs_scanned": { "desc": "number of mango queries that generated an index scan warning", "type": "counter", "value": 0 }, "unindexed_queries": { "desc": "number of mango queries that could not use an index", "type": "counter", "value": 0 } }, "mem3": { "shard_cache": { "eviction": { "desc": "number of shard cache evictions", "type": "counter", "value": 58040 }, "hit": { "desc": "number of shard cache hits", "type": "counter", "value": 209241424 }, "miss": { "desc": "number of shard cache misses", "type": "counter", "value": 105016 } } }, "pread": {}, "rexi": {} }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve HTTP headers for running server statistics
Retrieves the HTTP headers for running server statistics.
HEAD /_node/{node_name}/_stats
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the node name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^\w+@.+$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for
/_node/{node_name}/_stats
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Retrieve system-level statistics for the running server
Returns a JSON object that contains various system-level statistics for the running server. The object is structured with top-level sections that collate the statistics for a range of entries, with each individual statistic being easily identified. The content of each statistic is self-describing. The literal string, _local
, serves as an alias for the local node name. For any URL, {node-name}/_stats
can be replaced with _local/_stats
to interact with the local node's statistics.
GET /_node/{node_name}/_system
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the node name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^\w+@.+$
Response
Schema for system-level statistics for the running server.
Status Code
HTTP response for
/_node/{node_name}/_system
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example NodeSystemInformation response.
{ "context_switches": 62570, "distribution": { "clouseau@192.0.2.3": { "recv_avg": 59, "recv_cnt": 201145, "recv_dvi": 3, "recv_max": 1092, "recv_oct": 11915505, "send_avg": 150, "send_cnt": 517599, "send_max": 645, "send_oct": 78061898, "send_pend": 0 }, "node1@192.0.2.1": { "recv_avg": 2368, "recv_cnt": 153463822, "recv_dvi": 47, "recv_max": 3829916, "recv_oct": 363548809101, "send_avg": 2538, "send_cnt": 141966830, "send_max": 3829916, "send_oct": 360332607798, "send_pend": 0 }, "node2@192.0.2.2": { "recv_avg": 2368, "recv_cnt": 153463822, "recv_dvi": 47, "recv_max": 3829916, "recv_oct": 363548809101, "send_avg": 2538, "send_cnt": 141966830, "send_max": 3829916, "send_oct": 360332607798, "send_pend": 0 } }, "ets_table_count": 177, "garbage_collection_count": 5897, "internal_replication_jobs": 0, "io_input": 244, "io_output": 6582, "memory": { "atom": 590033, "atom_used": 579683, "binary": 132304, "code": 12953030, "ets": 1893128, "other": 14750185, "processes": 9127336, "processes_used": 9125960 }, "message_queues": { "alarm_handler": 0, "application_controller": 0, "chttpd": 0, "chttpd_auth_cache": 0, "chttpd_auth_cache_lru": 0, "chttpd_sup": 0, "code_server": 0, "config": 0, "config_event": 0, "config_sup": 0, "couch_db_updater": { "50": 0, "90": 0, "99": 0, "count": 40, "max": 0, "min": 0 }, "couch_epi_data_gen_dreyfus_black_list": 0, "couch_epi_data_gen_flags_config": 0, "couch_epi_functions_gen_chttpd": 0, "couch_epi_functions_gen_chttpd_auth": 0, "couch_epi_functions_gen_chttpd_handlers": 0, "couch_epi_functions_gen_couch_db": 0, "couch_epi_functions_gen_couch_index": 0, "couch_epi_functions_gen_feature_flags": 0, "couch_epi_functions_gen_global_changes": 0, "couch_epi_sup": 0, "couch_event_server": 0, "couch_event_sup2": 0, "couch_file": { "50": 0, "90": 0, "99": 0, "count": 43, "max": 0, "min": 0 }, "couch_httpd_vhost": 0, "couch_index_sup": 0, "couch_log_server": 0, "couch_log_sup": 0, "couch_password_hasher": 0, "couch_peruser": 0, "couch_peruser_sup": 0, "couch_plugin": 0, "couch_primary_services": 0, "couch_proc_manager": 0, "couch_prometheus_server": 0, "couch_prometheus_sup": 0, "couch_replication": 0, "couch_replicator_clustering": 0, "couch_replicator_connection": 0, "couch_replicator_doc_processor": 0, "couch_replicator_pg": 0, "couch_replicator_rate_limiter": 0, "couch_replicator_scheduler": 0, "couch_replicator_scheduler_sup": 0, "couch_replicator_sup": 0, "couch_secondary_services": 0, "couch_server": 0, "couch_server_1": 0, "couch_server_2": 0, "couch_server_3": 0, "couch_server_4": 0, "couch_server_5": 0, "couch_server_6": 0, "couch_server_7": 0, "couch_server_8": 0, "couch_stats_aggregator": 0, "couch_stats_process_tracker": 0, "couch_stats_sup": 0, "couch_sup": 0, "couch_task_status": 0, "couch_uuids": 0, "custodian_db_checker": 0, "custodian_server": 0, "custodian_sup": 0, "ddoc_cache_lru": 0, "ddoc_cache_sup": 0, "dreyfus_index_manager": 0, "dreyfus_sup": 0, "dtls_connection_sup": 0, "dtls_listener_sup": 0, "dtls_server_session_cache_sup": 0, "dtls_server_sup": 0, "dtls_sup": 0, "erl_prim_loader": 0, "erl_signal_server": 0, "error_logger": 0, "erts_code_purger": 0, "file_server_2": 0, "folsom_meter_timer_server": 0, "folsom_metrics_histogram_ets": 0, "folsom_sample_slide_sup": 0, "folsom_sup": 0, "global_changes_server": 0, "global_changes_sup": 0, "global_group": 0, "global_name_server": 0, "httpc_handler_sup": 0, "httpc_manager": 0, "httpc_profile_sup": 0, "httpc_sup": 0, "httpd_sup": 0, "ibrowse": 0, "ibrowse_sup": 0, "index_server": 0, "index_server_1": 0, "index_server_2": 0, "index_server_3": 0, "index_server_4": 0, "index_server_5": 0, "index_server_6": 0, "index_server_7": 0, "index_server_8": 0, "inet_db": 0, "inets_sup": 0, "init": 0, "ioq": 0, "ioq_sup": 0, "jwtf_keystore": 0, "jwtf_sup": 0, "ken_server": 0, "ken_sup": 0, "kernel_refc": 0, "kernel_safe_sup": 0, "kernel_sup": 0, "logger": 0, "logger_handler_watcher": 0, "logger_proxy": 0, "logger_std_h_ssl_handler": 0, "logger_sup": 0, "mango_sup": 0, "mem3_distribution": 0, "mem3_events": 0, "mem3_nodes": 0, "mem3_reshard": 0, "mem3_reshard_dbdoc": 0, "mem3_reshard_job_sup": 0, "mem3_reshard_sup": 0, "mem3_seeds": 0, "mem3_shards": 0, "mem3_sup": 0, "mem3_sync": 0, "mem3_sync_nodes": 0, "mochiweb_clock": 0, "release_handler": 0, "rex": 0, "rexi_buffer_mon": 0, "rexi_buffer_nonode@nohost": 0, "rexi_buffer_sup": 0, "rexi_server": 0, "rexi_server_mon": 0, "rexi_server_nonode@nohost": 0, "rexi_server_sup": 0, "rexi_sup": 0, "runtime_tools_sup": 0, "sasl_safe_sup": 0, "sasl_sup": 0, "setup_sup": 0, "smoosh_server": 0, "smoosh_sup": 0, "socket_registry": 0, "ssl_admin_sup": 0, "ssl_connection_sup": 0, "ssl_listen_tracker_sup": 0, "ssl_manager": 0, "ssl_pem_cache": 0, "ssl_server_session_cache_sup": 0, "ssl_sup": 0, "ssl_upgrade_server_session_cache_sup": 0, "standard_error": 0, "standard_error_sup": 0, "timer_server": 0, "tls_client_ticket_store": 0, "tls_connection_sup": 0, "tls_server_session_ticket_sup": 0, "tls_server_sup": 0, "tls_sup": 0, "user": 0 }, "os_proc_count": 0, "process_count": 374, "process_limit": 262144, "reductions": 23271197, "run_queue": 0, "run_queue_dirty_cpu": 0, "stale_proc_count": 0, "uptime": 42, "words_reclaimed": 20305358 }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for a not found request.
{ "error": "not_found", "reason": "missing" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve HTTP headers for system-level statistics for the running server
Retrieves the HTTP headers for system-level statistics for the running server.
HEAD /_node/{node_name}/_system
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Path Parameters
Path parameter to specify the node name.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^\w+@.+$
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header returning the server information.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for
/_node/{node_name}/_system
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP error for not found.
HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Retrieve information about whether the server is up
Confirms that the server is up, running, and ready to respond to
requests. If maintenance_mode
is true
or nolb
, the endpoint
returns a 404 response.
Tip: The authentication for this endpoint is only enforced when using IAM.
Confirms that the server is up, running, and ready to respond to requests. If maintenance_mode
is true
or nolb
, the endpoint returns a 404 response.
Tip: The authentication for this endpoint is only enforced when using IAM.
Confirms that the server is up, running, and ready to respond to requests. If maintenance_mode
is true
or nolb
, the endpoint returns a 404 response.
Tip: The authentication for this endpoint is only enforced when using IAM.
Confirms that the server is up, running, and ready to respond to requests. If maintenance_mode
is true
or nolb
, the endpoint returns a 404 response.
Tip: The authentication for this endpoint is only enforced when using IAM.
Confirms that the server is up, running, and ready to respond to requests. If maintenance_mode
is true
or nolb
, the endpoint returns a 404 response.
Tip: The authentication for this endpoint is only enforced when using IAM.
GET /_up
(cloudant *CloudantV1) GetUpInformation(getUpInformationOptions *GetUpInformationOptions) (result *UpInformation, response *core.DetailedResponse, err error)
(cloudant *CloudantV1) GetUpInformationWithContext(ctx context.Context, getUpInformationOptions *GetUpInformationOptions) (result *UpInformation, response *core.DetailedResponse, err error)
ServiceCall<UpInformation> getUpInformation()
getUpInformation(params)
get_up_information(
self,
**kwargs,
) -> DetailedResponse
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
No Request Parameters
No Request Parameters
No Request Parameters
No Request Parameters
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/_up"
import ( "encoding/json" "fmt" "github.com/IBM/cloudant-go-sdk/cloudantv1" )
service, err := cloudantv1.NewCloudantV1( &cloudantv1.CloudantV1Options{}, ) if err != nil { panic(err) } getUpInformationOptions := service.NewGetUpInformationOptions() upInformation, response, err := service.GetUpInformation(getUpInformationOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(upInformation, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.UpInformation;
Cloudant service = Cloudant.newInstance(); UpInformation response = service.getUpInformation().execute().getResult(); System.out.println(response);
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.getUpInformation().then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.get_up_information().get_result() print(response)
Response
Schema for information about the up state of the server.
status
Possible values: [
maintenance_mode
,nolb
,ok
]seeds
Schema for information about the up state of the server.
seeds.
status.
Possible values: [
maintenance_mode
,nolb
,ok
]
Schema for information about the up state of the server.
seeds.
status.
Possible values: [
maintenance_mode
,nolb
,ok
]
Schema for information about the up state of the server.
seeds.
status.
Possible values: [
maintenance_mode
,nolb
,ok
]
Schema for information about the up state of the server.
seeds.
status.
Possible values: [
maintenance_mode
,nolb
,ok
]
Status Code
HTTP response for
/_up
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP response for
/_up
style operations.HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.
Example UpInformation response.
{ "seeds": {}, "status": "ok" }
Example UpInformation response.
{ "seeds": {}, "status": "ok" }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for a bad request.
{ "error": "bad_request", "reason": "Bad request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for reader access is required for this request.
{ "error": "unauthorized", "reason": "_reader access is required for this request." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response for incorrect credentials.
{ "error": "unauthorized", "reason": "Name or password is incorrect." }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response when payment is required. For example, if the data quota of the plan is exceeded.
{ "error": "payment_required", "reason": "Payment required" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for a forbidden request.
{ "error": "forbidden", "reason": "server_admin access is required for this request" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example error response for an account temporarily locked out.
{ "error": "forbidden", "reason": "Account is temporarily locked due to multiple authentication failures" }
Example UpInformation response for maintenance mode.
{ "seeds": {}, "status": "maintenance_mode" }
Example UpInformation response for maintenance mode.
{ "seeds": {}, "status": "maintenance_mode" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for timeout reading client request.
{ "error": "request_timeout", "reason": "Request timeout" }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for gone.
{ "error": "gone", "reason": "The requested resource is no longer located here, verify your DNS settings." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for too many requests.
{ "error": "too_many_requests", "reason": "You've exceeded your rate limit allowance. Please try again later." }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for an unknown server error.
{ "error": "unknown_error", "reason": "function_clause", "ref": 2632214382 }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for bad gateway.
{ "error": "bad_gateway", "reason": "Bad gateway" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for service unavailable.
{ "error": "service_unavailable", "reason": "Service unavailable" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Example error response for gateway timeout.
{ "error": "gateway_timeout", "reason": "Gateway timeout" }
Retrieve HTTP headers about whether the server is up
Retrieves the HTTP headers about whether the server is up.
Retrieves the HTTP headers about whether the server is up.
Retrieves the HTTP headers about whether the server is up.
Retrieves the HTTP headers about whether the server is up.
Retrieves the HTTP headers about whether the server is up.
HEAD /_up
(cloudant *CloudantV1) HeadUpInformation(headUpInformationOptions *HeadUpInformationOptions) (response *core.DetailedResponse, err error)
(cloudant *CloudantV1) HeadUpInformationWithContext(ctx context.Context, headUpInformationOptions *HeadUpInformationOptions) (response *core.DetailedResponse, err error)
ServiceCall<Void> headUpInformation()
headUpInformation(params)
head_up_information(
self,
**kwargs,
) -> DetailedResponse
Request
Custom Headers
Set a unique identifier to trace a request.
Possible values: length = 36, Value must match regular expression
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
No Request Parameters
No Request Parameters
No Request Parameters
No Request Parameters
Response
Response Headers
Header for returning the compression codec used if an attachment's content_type is in list of compressible types.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the attachment size. If a compression codec is used, this value is the compressed size.
Possible values: 0 ≤ value ≤ 10485760
Header returning the server response date-time.
Possible values: 28 ≤ length ≤ 31, Value must match regular expression
^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3]\d (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:[0-5]\d:[0-6]\d ([+-]\d{4}|[A-Z]{2,3})$
Header added by proxies through which the response was sent.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant IAM action of the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^cloudantnosqldb\..+$
Header returning the Cloudant backend that handled the request.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Header returning the Cloudant class of the request.
Possible values: [
lookup
,query
,unlimited
,write
]Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$
Status Code
HTTP response for
/_up
style operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP response for
/_up
style operations.HTTP error for timeout reading client request.
HTTP error for gone.
HTTP error for too many requests.
HTTP error for internal server error.
HTTP error for bad gateway.
HTTP error for service unavailable.
HTTP error for gateway timeout.