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
hostfield 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 includes both the name of the service and the specific attribute, combined in a format like 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 operation.
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 error information is available
in the body of the response.
For some HTTP requests, for example bulk operations, a 2xx response may
indicate overall request success, but individual actions may have failed.
For these cases the HTTP status code is insufficient to indicate success
or failure and the caller must inspect the response body contents.
| HTTP Code | Meaning |
|---|---|
200 - OK |
Request completed successfully. |
201 - Created |
Resource created or updated successfully. The resource could be a database or a document, for example. |
202 - Accepted |
Request accepted, but failed to meet the quorum for the operation. |
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 requested content has not changed. The ETag system that identifies the version of information returned uses this code. |
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 account is in arrears or the amount of data exceeds the plan quota. You can delete data, upgrade plan, or bring the account up to date. |
403 - Forbidden |
The server forbids access to the requested item or operation. |
404 - Not Found |
The requested resource does not exist or is not visible. 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 response 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 firstly, trying to update or delete a document without providing a revision and secondly, that the latest revision of the document on the server changed 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 type of the request is not supported by the server. |
416 - Requested Range Not Satisfiable |
The server cannot satisfy the range specified in the request header. |
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 server could not complete the request. It could be due to an internal error or sometimes invalid data in the request. |
502 - Bad Gateway |
The server while acting as a gateway or proxy, received an invalid response from the upstream server. |
503 - Service Unavailable |
The service is not available for the request. 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. |
IBM Cloudant HTTP API requests may also fail due to external factors, for example, network errors. These kinds of errors may prevent the server receiving the request or the client receiving the HTTP response. As a result the error format is different in these cases.
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 |
| Name | Description |
|---|---|
code integer |
HTTP error code |
error string |
a more detailed description about the cause of the failure code |
| Name | Description |
|---|---|
message string |
detailed description about the cause of the failure |
The HTTP response headers may contain additional information useful for tracing errors.
curl -H "Authorization: Bearer A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET 'https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/products'
Error response
{
"error": "not_found",
"reason": "Database does not exist."
}
Error Responses specific to /_api/v2/ endpoints
curl -H "Authorization: Bearer A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" 'https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/_api/v2/db/products/_security'
{
"code": 400,
"error": "No DB products belonging to 00000000-0000-0000-0000-000000000000-bluemix"
}
curl -H "Authorization: Bearer A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -d '' 'https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/_api/v2/user/capacity/throughput'
{
"message": "The method is not allowed for the requested URL."
}
Error response
When the Go SDK receives an error response from the server endpoint it returns a
standard Go error.
The Error() function of the error returns either the HTTP response error message
or a generic error message.
In addition to an error SDK operations may also return a DetailedResponse with
methods to retrieve additional information.
| Field | Method | Description |
|---|---|---|
| StatusCode | GetStatusCode | HTTP response status code. |
| Result | GetResultAsMap | JSON error response object unmarshalled as map[string]interface{}. |
| RawResult | GetRawResult | Raw error response body as []byte. |
| Key | Value description |
|---|---|
| message | Human readable and printable error message of error and reason. |
| error | Error type, for example not_found. |
| reason | Error reason, for example Database does not exist. |
| caused_by | Additional error cause information if available. |
| trace | Trace UUID from the X-Request-ID or X-Couch-Request-ID response header. |
Other errors
HTTP API requests may also fail with other error conditions, for example, validation or networking issues.
For errors unrelated to the HTTP status code the SDK still returns a
standard Go error. However, the DetailedResponse information is absent or limited.
An example would be an HTTP request that the server terminates when it exceeds a timeout.
In this case the request returns a DetailedResponse with only a StatusCode.
The Result and RawResult elements are nil.
Argument validation prevents some invalid values and the SDK does not send the request.
This results in Result and RawResult being nil, and a returned
error message with no status code or reason.
In all other cases, DetailedResponse is nil because there is no JSON error
response from the IBM Cloudant Service.
Example error handling
import (
"encoding/json"
"fmt"
"github.com/IBM/cloudant-go-sdk/cloudantv1"
"github.com/IBM/go-sdk-core/v5/core"
)
func errorHandlingExample() {
service, err := cloudantv1.NewCloudantV1(
&cloudantv1.CloudantV1Options{},
)
if err != nil {
panic(err)
}
getDatabaseInformationOptions := service.NewGetDatabaseInformationOptions(
"products",
)
var response core.DetailedResponse
databaseInformation, response, err := service.GetDatabaseInformation(getDatabaseInformationOptions)
if err != nil {
// Use the DetailedResponse to check the HTTP status code
if response.StatusCode == 404 {
// Handle database not existing, maybe create it
} else {
fmt.Println("Error: ", err.Error())
fmt.Println("Error status code: ", response.StatusCode)
// Handle other errors
errorMap, ok := response.GetResultAsMap()
if ok {
// Get the request UUID for what went wrong
fmt.Println("Trace request UUID: ", errorMap["trace"])
} else {
// For example to handle non-JSON response bodies
fmt.Println("Raw error response: ", response.RawResult)
}
}
}
b, _ := json.MarshalIndent(databaseInformation, "", " ")
fmt.Println(string(b))
}
Error response
When the Java SDK receives an error response from the server endpoint it throws a
RuntimeException. Specifically a subclass of ServiceResponseException from the
com.ibm.cloud.sdk.core.service.exception package. The specific subclass depends
on the error encountered.
| Exception class | Description including HTTP status code where applicable |
|---|---|
| ServiceResponseException | Super class for all service response exceptions. |
| BadRequestException | 400 Bad Request. |
| UnauthorizedException | 401 Unauthorized. |
| ForbiddenException | 403 Forbidden. |
| NotFoundException | 404 Not Found. |
| NotAcceptableException | 406 Not Acceptable. |
| ConflictException | 409 Conflict. |
| RequestTooLargeException | 413 Request Entity Too Large. |
| UnsupportedException | 415 Unsupported media type. |
| TooManyRequestsException | 429 Too Many Requests. |
| InternalServerErrorException | 500 Internal server error. |
| ServiceUnavailableException | 503 Service Unavailable. |
| InvalidServiceResponseException | Could not process the response body. Most commonly caused when the server truncates a long running query that exceeded the time limit. |
All ServiceResponseException types have methods to retrieve additional error information.
| Method | Description |
|---|---|
| getStatusCode() | HTTP response status code. |
| getMessage() | Human readable and printable error message. |
| getDebuggingInfo() | JSON error response body as a Map<String, Object> |
| getHeaders() | HTTP response headers. |
| getResponseBody() | Raw error response body as String. |
| Key | Value description |
|---|---|
| message | Human readable and printable error message of error and reason. |
| error | Error type, for example not_found. |
| reason | Error reason, for example Database does not exist. |
| caused_by | Additional error cause information if available. |
| trace | Trace UUID from the X-Request-ID or X-Couch-Request-ID response header. |
Other errors
HTTP API requests may also fail with other error conditions, for example, validation or networking issues.
For errors unrelated to the HTTP status code the SDK throws other RuntimeException types.
For example for many networking errors the SDK throws an IOException wrapped in a RuntimeException.
Argument validation prevents some invalid values and the SDK does not send the request.
For these cases the SDK throws an IllegalArgumentException.
| Exception class | Description |
|---|---|
| RuntimeException | Use getCause() to identify the underlying cause. Typically an IOException caused by networking issues. |
| IllegalArgumentException | Invalid argument passed to the method. |
| IllegalStateException | The operation cannot be performed, for example starting a changes follower that is already started. |
Example error handling
import com.ibm.cloud.cloudant.v1.Cloudant;
import com.ibm.cloud.cloudant.v1.model.DatabaseInformation;
import com.ibm.cloud.cloudant.v1.model.GetDatabaseInformationOptions;
import com.ibm.cloud.sdk.core.service.exception.NotFoundException;
import com.ibm.cloud.sdk.core.service.exception.ServiceResponseException;
public class ErrorHandlingExample {
public static void main() {
Cloudant service = Cloudant.newInstance();
GetDatabaseInformationOptions databaseInfoOptions =
new GetDatabaseInformationOptions.Builder().db("products").build();
try {
DatabaseInformation response =
service.getDatabaseInformation(databaseInfoOptions).execute().getResult();
System.out.println(response);
} catch (NotFoundException e) {
// Handle database not existing, maybe create it
} catch (ServiceResponseException e) {
System.out.println("Error: " + e.getMessage());
System.out.println("Error status code: " + e.getStatusCode());
System.out.println("Trace UUID: " + e.getDebuggingInfo().getOrDefault("trace", "No trace available"));
} catch (RuntimeException e) {
e.printStackTrace();
}
}
}
Error response
When the Node SDK receives an error response from the server endpoint it creates
an Error that contains either the HTTP response error message or a generic error message.
The Promise returned from the SDK operation rejects with this Error.
For HTTP response errors the properties of the of Error include additional information.
| Property | Description |
|---|---|
| status | HTTP response status code. |
| statusText | Text description of the status code. |
| message | Human readable and printable error message. |
| result | Error JSON response body as an object. |
| body | Raw error response body as a string. |
| Key | Value description |
|---|---|
| error | Error type, for example not_found. |
| reason | Error reason, for example Database does not exist. |
| caused_by | Additional error cause information if available. |
| trace | Trace UUID from the X-Request-ID or X-Couch-Request-ID response header. |
Other errors
HTTP API requests may also fail with other error conditions, for example, validation or networking issues.
For errors unrelated to the HTTP status code the SDK still rejects with an
Error. However, the available error properties may be more limited.
For these errors message still provides a summary of the problem.
There is no status defined since there is no HTTP response status code.
The statusText or body contain additional information.
When an error prevents the request reaching the service the Error
code property may be useful.
An example is argument validation that prevents some invalid values
and the SDK does not send the request. Invalid argument values reject
with an Error object containing a code field with the value
ERR_INVALID_ARG_VALUE.
| Property | Description |
|---|---|
| message | Human readable and printable error message. |
| statusText | Text description of the status code. |
| body | Raw error response body as a string. |
| code | Code for some errors that occur before sending a request. |
Example error handling
import { CloudantV1 } from '@ibm-cloud/cloudant';
function errorHandlingExample() {
const service = CloudantV1.newInstance({});
return service.getDatabaseInformation({ db: "products"})
.then(response => {
console.log(response.result);
}).catch((error) => {
console.log(`Error message: ${error.message}`);
console.log(`Error status text: ${error.statusText}`);
if (error.status) {
if (error.status === 404) {
// Handle database not existing, maybe create it
} else {
console.log(`Error status code: ${error.status}`);
console.log(`Trace request UUID: ${error?.result?.trace}`);
}
} else if (error.code) {
console.log(`Error code: ${error.code}`);
} else {
console.log(`Error body: ${error.body}`);
}
});
}
await errorHandlingExample();
Error response
When the Python SDK receives an error response from the server endpoint it raises
a standard Python Exception. For HTTP response errors the subclass is ApiException
from the ibm_cloud_sdk_core module. The ApiException includes more information about
the cause of the failure.
| Attribute | Description |
|---|---|
| code | HTTP response status code |
| message | Human readable and printable error message. |
| http_response | Raw requests.response object for the HTTP response body. |
Use the json() method of the http_response attribute to obtain even more
detailed error information.
| Key | Value description |
|---|---|
| error | Error type, for example not_found. |
| reason | Error reason, for example Database does not exist. |
| caused_by | Additional error cause information if available. |
| trace | Trace UUID from the X-Request-ID or X-Couch-Request-ID response header. |
Other errors
HTTP API requests may also fail with other error conditions, for example, validation or networking issues.
For errors unrelated to the HTTP status code the SDK still raises an Exception.
However, the available error properties are different.
Networking errors and issues like timeouts raise a requests.RequestException.
Consult the requests documentation for details of the available subclasses for
specific connection related error conditions.
Argument validation prevents some invalid values and the request is not sent.
Invalid argument values raise a ValueError exception.
Example error handling
from ibmcloudant.cloudant_v1 import CloudantV1
from ibm_cloud_sdk_core import ApiException
from requests import RequestException
service = CloudantV1.new_instance()
try:
response = service.get_database_information(db="products").get_result()
print(response)
except ApiException as ae:
print("Error message: " + ae.message)
if ae.status_code == 404:
# Handle database not existing, maybe create it
pass
else:
print(f'Error status code: {ae.status_code}')
if 'trace' in (debugInfo := ae.http_response.json()):
print(f'Trace request UUID: {debugInfo["trace"]}')
except (RequestException, ValueError) as err:
print(err)
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
IBM Cloudant uses HTTP. Set the correct HTTP request headers and process the response headers inline with the HTTP specification. 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, be as specific as possible for your client environment.
IBM Cloudant SDKs handle required headers automatically. The SDKs also allow for setting some headers as part of the request options without needing to use custom header code.
You can pass additional request header parameters in all requests or in a single request to the service.
To pass header parameters in a single curl request, use the -H option.
To pass header parameters with every request, use the SetDefaultHeaders method of the service object.
To pass header parameters in a single request, use SetHeaders to include the headers in the options struct before calling the operation.
You can pass request header parameters in all requests or in a single request to the service.
To pass header parameters with every request, use the setDefaultHeaders method of the service object.
To pass header parameters in a single request, use the addHeader method as a modifier before you execute the request.
You can pass request header parameters in all requests or in a single request to the service.
To pass header parameters with every request, specify the set_default_headers method of the service object.
To pass header parameters in a single request, include headers as a dict in the request.
You can pass request header parameters in all requests or in a single request to the service.
To pass header parameters with every request, specify the set_default_headers method of the service object.
To pass header parameters in a single request, include headers as a dict in the request.
Example header parameter in a request
curl -H 'Custom-Header:custom_value' -H "Authorization: Bearer A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud
Example header parameter in all requests
customHeaders := http.Header{}
customHeaders.Add("Custom-Header", "custom_value")
service.SetDefaultHeaders(customHeaders)
Example header parameter in a request
options := service.NewGetServerInformationOptions()
customHeaders := make(map[string]string)
customHeaders["Custom-Header"] = "custom_value"
options.SetHeaders(customHeaders)
serverInformation, response, err := service.GetServerInformation(options)
Example header parameter in all requests
Map<String, String> headers = new HashMap<String, String>();
headers.put("Customer-Header", "custom_value");
service.setDefaultHeaders(headers);
Example header parameter in a request
ServerInformation response = service.getServerInformation()
.addHeader("Custom-Header", "custom_value")
.execute();
Example header parameter in all requests
const service = CloudantV1.newInstance({
headers: {
'Custom-Header': 'custom_value',
},
});
Example header parameter in a request
service.getServerInformation({
headers: {
'Custom-Header': 'custom_value'
}
}).then(response => {
console.log(response.result);
});
Example header parameter in all requests
headers = {
'Custom-Header': 'custom_value'
}
service.set_default_headers(headers)
Example header parameter in a request
response = service.get_server_information(
headers = {
'Custom-Header': 'custom_value'
})
Request headers
Additional supported HTTP request headers are:
AcceptAccept-EncodingContent-TypeContent-EncodingIf-None-MatchRangeX-Request-ID
Accept
The Accept header specifies the list of potential data types returned by the server that
the client accepts.
The format is a list of one or more MIME types, 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 the client accepts any type.
If the Accept header is not supplied,
then the server assumes the */* MIME type,
which means that the client accepts all formats.
The use of Accept in queries to IBM Cloudant is not required,
but is highly recommended as it helps to ensure that the client can process the data returned.
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.
IBM Cloudant SDKs set this header automatically except for requests where the user controls the content type, for example, attachments.
Example of sending a request without an explicit Accept header, or when you specify */*.
GET /recipes HTTP/1.1
Host: username.cloudant.com
Accept: */*
Example of a returned header when the client accepts all formats.
The returned content type is text/plain even though the information 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
Example request that explicitly specifies the Accept header.
GET /recipes HTTP/1.1
Host: username.cloudant.com
Accept: application/json
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
Accept-Encoding
The Accept-Encoding header specifies the server encoding of the response body the client accepts.
The supported values are:
gzipidentity
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.
IBM Cloudant SDKs set this header and compress request bodies automatically.
You can also send compressed request bodies using gzip and curl.
Example creating a gzipped document.
echo '{"foo":"bar"}' | gzip > doc.gzip
Example using the gzipped document in a curl request.
curl "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/db/doc" \
-X PUT \
-T doc.gzip \
-H "Content-Encoding: gzip"
Content-Type
The Content-Type header specifies the content type of the HTTP request body.
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.
If-None-Match
The If-None-Match header is optional.
You might send it to determine whether a document changed 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 changed,
you get a normal 200 response,
provided the document still exists and no other errors occurred.
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.
X-Request-ID
Assign a UUIDv4 (random) to a request for tracing.
If the supplied X-Request-ID header value is a valid UUIDv4 it is also returned in the response X-Request-ID header.
If the X-Request-ID is not set on a request or the supplied value is not a valid UUIDv4 then the server generates a valid value and returns it in the response X-Couch-Request-ID header.
Response headers
The server returns response headers when you receive 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:
Cache-ControlContent-EncodingContent-LengthContent-RangeContent-TypeEtagViaX-Cloudant-ActionX-Cloudant-BackendX-Cloudant-Request-ClassX-Content-Type-OptionsX-Couch-Request-IDX-Frame-OptionsX-Request-ID
You can access response headers returned by IBM Cloudant operations to retrieve metadata such as request IDs for tracing and debugging.
The examples show how to retrieve the X-Couch-Request-ID header from a response.
To view response headers in a curl request, use the -i or --include option.
Access the Headers field of the DetailedResponse returned by operations.
Access the Headers object from the Response returned by operations.
Access the headers field of the response object returned by operations.
Access headers using the get_headers() method of the DetailedResponse returned by operations.
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-Encoding
Indicates the encoding of the response body as negotiated by the Accept-Encoding request header.
Content-Length
The Content-Length header reports the length in bytes of the returned content.
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.
Content-Type
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.
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-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 toward the instance's throughput capacity's budget.
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 generated by the server if the request did not have a valid X-Request-ID header.
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.
X-Request-ID
This header contains a UUIDv4 value matching the one supplied on the request.
If a value was not supplied then the server assigns a UUIDv4 in the X-Couch-Request-ID response header.
Example showing response headers
curl -i -H "Authorization: Bearer A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/products/1000042
The response includes headers such as X-Couch-Request-ID:
HTTP/1.1 200 OK
X-Couch-Request-ID: 00000000-0000-0000-0000-000000000000
Content-Type: application/json
...
Example retrieving response headers
getDocumentOptions := service.NewGetDocumentOptions(
"products",
"1000042",
)
document, response, err := service.GetDocument(getDocumentOptions)
if err != nil {
panic(err)
}
// Access response headers
responseHeaders := response.GetHeaders()
couchRequestID := responseHeaders.Get("X-Couch-Request-ID")
fmt.Printf("X-Couch-Request-ID: %s\n", couchRequestID)
Example retrieving response headers
GetDocumentOptions getDocumentOptions = new GetDocumentOptions.Builder()
.db("products")
.docId("1000042")
.build();
Response<Document> response = service.getDocument(getDocumentOptions).execute();
// Access response headers
Headers responseHeaders = response.getHeaders();
String couchRequestId = responseHeaders.values("X-Couch-Request-ID").get(0);
System.out.println("X-Couch-Request-ID: " + couchRequestId);
Example retrieving response headers
service.getDocument({
db: 'products',
docId: '1000042'
}).then(response => {
// Access response headers
const couchRequestId = response.headers['x-couch-request-id'];
console.log('X-Couch-Request-ID: ' + couchRequestId);
});
Example retrieving response headers
response = service.get_document(
db='products',
doc_id='1000042'
)
# Access response headers
response_headers = response.get_headers()
couch_request_id = response_headers.get('X-Couch-Request-ID')
print(f'X-Couch-Request-ID: {couch_request_id}')
Pagination
Pagination is a best-practice to break apart large queries into multiple server requests. For performance reasons, if you are displaying large amounts of data, you must consider using pagination. It is essential when dealing with large result sets or API endpoints that impose a limit on results returned. Advantages of using pagination include:
- Keeps requests within server imposed limits, for example
- 200 max results for text search
- 2000 max results for partitioned queries
- Fetches only the necessary data, for example
- User finds required result on first page, no need to continue fetching results
- Reduces the duration of any individual query
- Reduces the risk of a query running for longer than the server timeout limit
- Reduces the risk of network request timeouts
Different request types in IBM Cloudant use
different pagination approaches. In all cases use the limit parameter to control number of results returned, which is the page size. The chosen page size for an application depends on service limits, document size, latency demands, memory consumption, and other tradeoffs.
The IBM Cloudant SDKs provide built-in pagination to correctly paginate different request types.
Do not use the skip parameter or offset value to paginate.
It is not recommended for two reasons. Firstly, entries added or removed from the index between
requests can result in missed or duplicated results. Secondly, performance will degrade with
increasing skip values. Use the pagination recipes outlined in this section or the built-in
pagination of the SDKs instead.
Index key pagination
The primary (document ID) index and IBM Cloudant Views use the index key from the last entry of the previous page to identify the start position of the next page of the query.
For details of how to paginate these request types visit the sections:
Bookmark pagination
Imagine you're creating a web application that shows a set of search results, whether they be books, actors, or products in your store. As the user scrolls through the search results, another page of matches is appended at the end. This behavior is known as an "infinite scroll" design pattern. It allows the user to endlessly scroll through a large data set with ease, while they fetch only smaller batches of data from the database each time.
It's this sort of access pattern that IBM Cloudant bookmarks are built for. Here's how it works:
- Your application runs a search on an IBM Cloudant database, for example, find me the first 10 cities where the country is "US".
- IBM Cloudant provides an array of 10 documents and a bookmark, an opaque key that represents a pointer to the next documents in the result set.
- When the next set of results is required, the search is repeated. However, the query is sent, with the bookmark from the first response, to IBM Cloudant in the request.
- IBM Cloudant replies with the second set of documents and another bookmark, which can be used to get a third page of results.
- Repeat!
IBM Cloudant Query and IBM Cloudant Search provide a bookmark in the response. When passed to the next request the bookmark identifies the next page of results.
For details of how to paginate these request types visit the sections:
The IBM Cloudant database changes feed is similar, but uses a sequence identifier instead of a bookmark. For details of how to paginate changes visit the section:
The SDK pagination feature accepts options for a single operation and automatically creates the multiple requests to the server necessary to page through the results a fixed number at a time.
SDK pagination is a beta feature available in newer SDK releases.
For simplicity the examples shown here demonstrate only iterating the result rows. The SDK pagination feature provides multiple alternative pagination options, for full details and examples visit the SDK repository pagination documentation SDK repository pagination documentation SDK repository pagination documentation SDK repository pagination documentation
Paging on all documents
The all documents pagination recipe applies to these endpoints:
Primary indexes based on the document ID have unique keys.
To paginate you need to calculate a value of start_key,
which means the next ID after the last _id in the result set.
There are two options to either get or calculate the next start_key.
Option 1 - Fetch one document too many
Instead of fetching five documents limit=5, fetch 5+1 limit=6, but hide the sixth document
from your users. The _id of the sixth document becomes the start_key of your request for
the next page of results.
This option always works, but you end up fetching n+1 documents when only n are required.
Option 2 - The \u0000 trick
If you're determined to fetch only n documents each time, then you need to calculate a value of start_key.
For example, if the last document
in the first page of results is "example", what must the start_key of the next call to _all_docs be?
It can't be "example", otherwise you get the same document ID again. It turns out that you can append
\u0000 to the end of a key string to indicate the "next key" because it is the earliest sorting value.
The \u0000 trick does not work in a descending direction because it is the first sort.
\u0000 is a Unicode null character, which can be placed in a URL as-is or with the percent code %00.
The SDK pagination feature is the recommended method to page results on these endpoints.
- The known limitations:
- Cannot reverse direction during pagination.
- No pagination for key option. There is no need to paginate as IDs are unique and this returns only a single row. This is better achieved with a single document get request.
- No pagination for keys option.
Example of fetch one document too many
curl -H "Authorization: Bearer A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/orders/_all_docs?limit=6"
{
"total_rows": 11,
"offset": 0,
"rows": [
{ "id": "4eee973603bf77f30b1f880ed83df76a" ....},
{ "id": "4eee973603bf77f30b1f880ed83f469a" ....},
{ "id": "65fa623a384648740ec1f39b495d591c" ....},
{ "id": "d7404903579d6d5880514c22ad983529" ....},
{ "id": "example" ....},
{ "id": "mydoc" ....} // <-- This is the 6th result we use as the start_key of the next request
]
}
curl -H "Authorization: Bearer A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/orders/_all_docs?limit=6&start_key=\"mydoc\""
{
"total_rows": 11,
"offset": 5,
"rows": [
{ "id": "mydoc" ....},
{ "id": "order00057" ....},
...
]
}
Example of the \u0000 trick
curl -H "Authorization: Bearer A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/orders/_all_docs?limit=5"
{
"total_rows": 11,
"offset": 0,
"rows": [
{ "id": "4eee973603bf77f30b1f880ed83df76a" ....},
{ "id": "4eee973603bf77f30b1f880ed83f469a" ....},
{ "id": "65fa623a384648740ec1f39b495d591c" ....},
{ "id": "d7404903579d6d5880514c22ad983529" ....},
{ "id": "example" ....} // <-- append \u0000 to this to get the start_key of the next request
]
}
curl -H "Authorization: Bearer A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/orders/_all_docs?limit=5&start_key=\"example\u0000\""
{
"total_rows": 11,
"offset": 5,
"rows": [
{ "id": "mydoc" ....},
{ "id": "order00057" ....},
...
{ "id": "order00067" ....} <-- append \u0000 to this to get the start_key of the next request
]
}
Example of paging on all documents
import java.util.List;
import com.ibm.cloud.cloudant.v1.Cloudant;
import com.ibm.cloud.cloudant.v1.model.DocsResultRow;
import com.ibm.cloud.cloudant.v1.model.PostAllDocsOptions;
import com.ibm.cloud.cloudant.features.pagination.Pager;
import com.ibm.cloud.cloudant.features.pagination.Pagination;
// Initialize service
Cloudant service = Cloudant.newInstance();
// Setup options
PostAllDocsOptions options = new PostAllDocsOptions.Builder()
.db("orders") // example database name
.limit(50) // limit option sets the page size
.startKey("abc") // start from example doc ID abc
.build();
// Create pagination
Pagination<PostAllDocsOptions, DocsResultRow> pagination = Pagination.newPagination(service, options);
// pagination can be reused without side-effects as a factory for iterables, streams or pagers
// options are fixed at pagination creation time
// Option: iterate rows
// Ideal for using an enhanced for loop with each row.
// The Iterable returned from rows() is reusable in that
// calling iterator() returns a new iterator each time.
// The returned iterators, however, are single use.
for (DocsResultRow row : pagination.rows()) {
// Do something with row
}
import { CloudantV1, Pagination, PagerType } from '@ibm-cloud/cloudant';
import { Writable } from 'node:stream';
import { pipeline } from 'node:stream/promises';
// Initialize service
const client = CloudantV1.newInstance();
// Setup params
const paginationParams = {
db: 'orders', // Required: the database name.
limit: 50, // Optional: limit parameter sets the page size. Default and max is 200.
startKey: 'abc', // start from example doc ID abc
};
// Create pagination
// pagination can be reused without side-effects as a factory for async iterables, streams or pagers
const pagination = Pagination.newPagination(
client, // Required: the Cloudant service client instance.
PagerType.POST_ALL_DOCS, // Required: Pager type
paginationParams // Required: pagination configuration params are fixed at pagination creation time
);
// Option: iterate rows with for await...of statement
(async () => {
for await (const row of pagination.rows()) {
// Do something with row
}
})();
// Note: Alternatively to for await....of the iterator protocol functions and properties:
// `next()`, `done`, value`, can be also used on rows().
// As `next(`)` returns with a Promise, make sure using `await` or `.then()` on it.
from ibmcloudant import Pager, Pagination, PagerType
from ibmcloudant.cloudant_v1 import CloudantV1
# Initialize service
service = CloudantV1.new_instance()
# Setup options
opts = {
'db': 'orders', # example database name
'limit': 50, # limit option sets the page size,
'start_key': 'abc' # start from example doc ID abc
}
# Create pagination
pagination = Pagination.new_pagination(
service, PagerType.POST_ALL_DOCS, **opts)
# pagination can be reused without side-effects as a factory for iterables or pagers
# options are fixed at pagination creation time
# Option: iterate rows
# Ideal for using a for loop with each row.
# Each call to rows() returns a fresh iterator that can be traversed once.
for row in pagination.rows():
# Do something with row
pass
import (
"github.com/IBM/cloudant-go-sdk/cloudantv1"
"github.com/IBM/cloudant-go-sdk/features"
)
// Initialize service
service, err := cloudantv1.NewCloudantV1UsingExternalConfig(
&cloudantv1.CloudantV1Options{},
)
if err != nil {
panic(err)
}
// Setup options
opts := service.NewPostAllDocsOptions("orders")
opts.SetLimit(50)
opts.SetStartKey("abc")
// Create pagination
// pagination can be reused without side-effects as a factory for iterators or pagers
// options are fixed at pagination creation time
pagination := features.NewAllDocsPagination(service, opts)
// Option: iterate rows
// Ideal for using a for/range loop with each row.
// The iter.Seq2 returned from Rows() has an error as a second element.
for row, err := range pagination.Rows() {
// Break on err != nil
// Do something with row
}
Paging on view queries
MapReduce views are secondary indexes defined by key-value pairs produced from user-supplied JavaScript functions. This view pagination approach applies to these endpoints:
Querying MapReduce views is similar to all documents and view pagination methods also work for all documents.
However, unlike the primary index, where every _id is unique, the secondary index might have entries with the same key. For example, lots of entries that include the key "fulfilled". This situation makes pagination by using only start_key/end_key tricky, so you can use other parameters to help: start_key_doc_id/end_key_doc_id.
The best way to paginate view is to fetch one result more than necessary and use that extra result to determine the next page start_key and start_key_doc_id.
Instead of fetching five results with limit=5, fetch 5+1 with limit=6, but hide the sixth document
from your users. The key of the sixth result becomes the start_key and the _id becomes the start_key_doc_id of your request for the next page of results.
The start_key_doc_id parameter works only if a start_key is supplied and where all index entries
share a key. If they don't share a key, then pagination can be achieved with manipulation of
start_key/end_key parameters only. Also, the start_key_doc_id parameter is not JSON encoded.
The SDK pagination feature is the recommended method to page results on these endpoints.
- The known limitations:
- Cannot reverse direction during pagination.
- No pagination for key option. Pass the same key as a start and end key instead.
- No pagination for keys option.
- Views that emit multiple identical keys (with the same or different values) from the same document cannot paginate if those key rows with the same ID span a page boundary. The pagination feature detects this condition and an error occurs. It may be possible to workaround using a different page size.
Example of paging on view queries with the \u0000 trick
# get first page of fulfilled orders
curl -H "Authorization: Bearer A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/orders/_design/allClients/_view/getStatus?limit=3&start_key=\"fulfilled\"&end_key=\"fulfilled\""
{
"total_rows": 10,
"offset": 2,
"rows": [
{
"id": "order00057",
"key": "fulfilled",
"value": 1
},
{
"id": "order00058",
"key": "fulfilled",
"value": 1
},
{
"id": "order00067", // <-- append \u0000 to the start_key_doc_id to of the next request
"key": "fulfilled",
"value": 1
}
]
}
# get next page of fulfilled orders
curl -H "Authorization: Bearer A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud//orders/_design/allClients/_view/getStatus?limit=3&start_key=\"fulfilled\"&end_key=\"fulfilled\"&start_key_doc_id=order00067%00"
{
"total_rows": 10,
"offset": 5,
"rows": [
{
"id": "order00077",
"key": "fulfilled",
"value": 1
}
]
}
Example of paging on view queries
import java.util.List;
import com.ibm.cloud.cloudant.v1.Cloudant;
import com.ibm.cloud.cloudant.v1.model.ViewResultRow;
import com.ibm.cloud.cloudant.v1.model.PostViewOptions;
import com.ibm.cloud.cloudant.features.pagination.Pager;
import com.ibm.cloud.cloudant.features.pagination.Pagination;
// Initialize service
Cloudant service = Cloudant.newInstance();
// Setup options
PostViewOptions options = new PostViewOptions.Builder()
.db("shoppers") // example database name
.limit(50) // limit option sets the page size
.ddoc("allUsers") // use the allUsers design document
.view("getVerifiedEmails") // the view to use
.build();
// Create pagination
Pagination<PostViewOptions, ViewResultRow> pagination = Pagination.newPagination(service, options);
// pagination can be reused without side-effects as a factory for iterables, streams or pagers
// options are fixed at pagination creation time
// Option: iterate rows
// Ideal for using an enhanced for loop with each row.
// The Iterable returned from rows() is reusable in that
// calling iterator() returns a new iterator each time.
// The returned iterators, however, are single use.
for (ViewResultRow row : pagination.rows()) {
// Do something with row
}
import { CloudantV1, Pagination, PagerType } from '@ibm-cloud/cloudant';
import { Writable } from 'node:stream';
import { pipeline } from 'node:stream/promises';
// Initialize service
const client = CloudantV1.newInstance();
// Setup params
const paginationParams = {
db: 'shoppers', // Required: the database name.
limit: 50, // Optional: limit parameter sets the page size. Default and max is 200.
ddoc: 'allUsers', // use the allUsers design document
view: 'getVerifiedEmails', // the view to use
};
// Create pagination
// pagination can be reused without side-effects as a factory for async iterables, streams or pagers
const pagination = Pagination.newPagination(
client, // Required: the Cloudant service client instance.
PagerType.POST_VIEW, // Required: Pager type
paginationParams // Required: pagination configuration params are fixed at pagination creation time
);
// Option: iterate rows with for await...of statement
(async () => {
for await (const row of pagination.rows()) {
// Do something with row
}
})();
// Note: Alternatively to for await....of the iterator protocol functions and properties:
// `next()`, `done`, value`, can be also used on rows().
// As `next(`)` returns with a Promise, make sure using `await` or `.then()` on it.
from ibmcloudant import Pager, Pagination, PagerType
from ibmcloudant.cloudant_v1 import CloudantV1
# Initialize service
service = CloudantV1.new_instance()
# Setup options
opts = {
'db': 'shoppers', # example database name
'limit': 50, # limit option sets the page size
'ddoc': 'allUsers', # use the allUsers design document
'view': 'getVerifiedEmails' # the view to use
}
# Create pagination
pagination = Pagination.new_pagination(
service, PagerType.POST_VIEW, **opts)
# pagination can be reused without side-effects as a factory for iterables or pagers
# options are fixed at pagination creation time
# Option: iterate rows
# Ideal for using a for loop with each row.
# Each call to rows() returns a fresh iterator that can be traversed once.
for row in pagination.rows():
# Do something with row
pass
import (
"github.com/IBM/cloudant-go-sdk/cloudantv1"
"github.com/IBM/cloudant-go-sdk/features"
)
// Initialize service
service, err := cloudantv1.NewCloudantV1UsingExternalConfig(
&cloudantv1.CloudantV1Options{},
)
if err != nil {
panic(err)
}
// Setup options
opts := service.NewPostViewOptions("shoppers", "allUsers", "getVerifiedEmails")
opts.SetLimit(50)
// Create pagination
// pagination can be reused without side-effects as a factory for iterators or pagers
// options are fixed at pagination creation time
pagination := features.NewViewPagination(service, opts)
// Option: iterate rows
// Ideal for using a for/range loop with each row.
// The iter.Seq2 returned from Rows() has an error as a second element.
for row, err := range pagination.Rows() {
// Break on err != nil
// Do something with row
}
Paging on selector syntax queries
The following endpoints' responses contain a bookmark - a token that IBM Cloudant uses to determine where to resume from when later queries are made. To get the next set of query results, add the bookmark that was received in the previous response to your next request.
To get the next set of query results for IBM Cloudant Query,
add the bookmark that was received in the previous response to your next request. Remember to keep
the selector and sort the same, otherwise you receive unexpected results.
The presence of a bookmark doesn’t guarantee more results. You can test whether you are at the end of the result set by comparing the number of results that are returned with the page size requested. If the results returned are less than limit, no more results are available in the result set.
When supplied an incorrect bookmark IBM Cloudant responds with
an HTTP 400 Bad Request { error: 'invalid_bookmark'} response.
The SDK pagination feature is the recommended method to page results on these endpoints.
- The known limitations:
- Cannot reverse direction during pagination.
Example of paging on selector syntax queries
curl -X POST -H "Authorization: Bearer A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -H 'Content-type: application/json' -d '{"selector":{"country":{"$eq": "US"}},"limit":5}' "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/cities/_find"
{
"docs":[
{"_id":"10104153","_rev":"1-32aab6258c65c5fc5af044a153f4b994","name":"Silver Lake","latitude":34.08668,"longitude":-118.27023,"country":"US","population":32890,"timezone":"America/Los_Angeles"},
{"_id":"10104154","_rev":"1-125f589bf4e39d8e119b4b7b5b18caf6","name":"Echo Park","latitude":34.07808,"longitude":-118.26066,"country":"US","population":43832,"timezone":"America/Los_Angeles"},
{"_id":"4046704","_rev":"1-2e4b7820872f108c077dab73614067da","name":"Fort Hunt","latitude":38.73289,"longitude":-77.05803,"country":"US","population":16045,"timezone":"America/New_York"},
{"_id":"4048023","_rev":"1-744baaba02218fd84b350e8982c0b783","name":"Bessemer","latitude":33.40178,"longitude":-86.95444,"country":"US","population":27456,"timezone":"America/Chicago"},
{"_id":"4048662","_rev":"1-e95c97013ece566b37583e451c1864ee","name":"Paducah","latitude":37.08339,"longitude":-88.60005,"country":"US","population":25024,"timezone":"America/Chicago"}
],
"bookmark": "g1AAAAA-eJzLYWBgYMpgSmHgKy5JLCrJTq2MT8lPzkzJBYqzmxiYWJiZGYGkOWDSyBJZAPCBD58"
}
curl -X POST -H "Authorization: Bearer A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -H 'Content-type: application/json' -d '{"selector":{"country":{"$eq": "US"}},"limit":5,"bookmark":"g1AAAAA-eJzLYWBgYMpgSmHgKy5JLCrJTq2MT8lPzkzJBYqzmxiYWJiZGYGkOWDSyBJZAPCBD58"}' "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/cities/_find"
{
"docs":[
{"_id":"4049979","_rev":"1-1fa2591477c774a07c230571568aeb66","name":"Birmingham","latitude":33.52066,"longitude":-86.80249,"country":"US","population":212237,"timezone":"America/Chicago"},
{"_id":"4054378","_rev":"1-a750085697685e7bc0e49d103d2de59d","name":"Center Point","latitude":33.64566,"longitude":-86.6836,"country":"US","population":16921,"timezone":"America/Chicago"},
{"_id":"4058219","_rev":"1-9b4eb183c9cdf57c19be660ec600330c","name":"Daphne","latitude":30.60353,"longitude":-87.9036,"country":"US","population":21570,"timezone":"America/Chicago"},
{"_id":"4058553","_rev":"1-56100f7e7742028facfcc50ab6b07a04","name":"Decatur","latitude":34.60593,"longitude":-86.98334,"country":"US","population":55683,"timezone":"America/Chicago"},
{"_id":"4059102","_rev":"1-612ae37d982dc71eeecf332c1e1c16aa","name":"Dothan","latitude":31.22323,"longitude":-85.39049,"country":"US","population":65496,"timezone":"America/Chicago"}
],
"bookmark": "g1AAAAA-eJzLYWBgYMpgSmHgKy5JLCrJTq2MT8lPzkzJBYqzmxiYWhoaGIGkOWDSyBJZAO9qD40"
}
Example of paging on selector syntax queries
import java.util.Collections;
import java.util.List;
import com.ibm.cloud.cloudant.v1.Cloudant;
import com.ibm.cloud.cloudant.v1.model.Document;
import com.ibm.cloud.cloudant.v1.model.PostFindOptions;
import com.ibm.cloud.cloudant.features.pagination.Pager;
import com.ibm.cloud.cloudant.features.pagination.Pagination;
// Initialize service
Cloudant service = Cloudant.newInstance();
// Setup options
PostFindOptions options = new PostFindOptions.Builder()
.db("shoppers") // Database name
.limit(50) // limit option sets the page size
.fields(List.of("_id", "type", "name", "email")) // return these fields
.selector(Collections.singletonMap("email_verified", "true")) // select docs with verified emails
.sort(Collections.singletonList(Collections.singletonMap("email", "desc"))) // sort descending by email
.build();
// Create pagination
Pagination<PostFindOptions, Document> pagination = Pagination.newPagination(service, options);
// pagination can be reused without side-effects as a factory for iterables, streams or pagers
// options are fixed at pagination creation time
// Option: iterate rows
// Ideal for using an enhanced for loop with each row.
// The Iterable returned from rows() is reusable in that
// calling iterator() returns a new iterator each time.
// The returned iterators, however, are single use.
for (Document row : pagination.rows()) {
// Do something with row
}
import { CloudantV1, Pagination, PagerType } from '@ibm-cloud/cloudant';
import { Writable } from 'node:stream';
import { pipeline } from 'node:stream/promises';
// Initialize service
const client = CloudantV1.newInstance();
// Setup params
const paginationParams = {
db: 'shoppers', // Required: the database name.
limit: 50, // Optional: limit parameter sets the page size. Default and max is 200.
fields: ['_id', 'type', 'name', 'email'], // return these fields
selector: { email_verified: { '$eq': true } }, // select docs with verified emails
sort: [{ email: 'desc' }],
};
// Create pagination
// pagination can be reused without side-effects as a factory for async iterables, streams or pagers
const pagination = Pagination.newPagination(
client, // Required: the Cloudant service client instance.
PagerType.POST_FIND, // Required: Pager type
paginationParams // Required: pagination configuration params are fixed at pagination creation time
);
// Option: iterate rows with for await...of statement
(async () => {
for await (const row of pagination.rows()) {
// Do something with row
}
})();
// Note: Alternatively to for await....of the iterator protocol functions and properties:
// `next()`, `done`, value`, can be also used on rows().
// As `next(`)` returns with a Promise, make sure using `await` or `.then()` on it.
from ibmcloudant import Pager, Pagination, PagerType
from ibmcloudant.cloudant_v1 import CloudantV1
# Initialize service
service = CloudantV1.new_instance()
# Setup options
opts = {
'db': 'shoppers', # example database name
'limit': 50, # limit option sets the page size
'fields': ['_id', 'type', 'name', 'email'], # return these fields
'selector': {'email_verified': True}, # select docs with verified emails
'sort': [{'email': 'desc'}] # sort descending by email
}
# Create pagination
pagination = Pagination.new_pagination(
service, PagerType.POST_FIND, **opts)
# pagination can be reused without side-effects as a factory for iterables or pagers
# options are fixed at pagination creation time
# Option: iterate rows
# Ideal for using a for loop with each row.
# Each call to rows() returns a fresh iterator that can be traversed once.
for row in pagination.rows():
# Do something with row
pass
import (
"github.com/IBM/cloudant-go-sdk/cloudantv1"
"github.com/IBM/cloudant-go-sdk/features"
)
// Initialize service
service, err := cloudantv1.NewCloudantV1UsingExternalConfig(
&cloudantv1.CloudantV1Options{},
)
if err != nil {
panic(err)
}
// Setup options
opts := service.NewPostFindOptions("shoppers", map[string]any{"email_verified": true})
opts.SetLimit(50)
opts.SetFields([]string["_id", "type", "name", "email"])
opts.SetSort([]map[string]string{map[string]string{"email": "desc"}})
// Create pagination
// pagination can be reused without side-effects as a factory for iterators or pagers
// options are fixed at pagination creation time
pagination := features.NewFindPagination(service, opts)
// Option: iterate rows
// Ideal for using a for/range loop with each row.
// The iter.Seq2 returned from Rows() has an error as a second element.
for row, err := range pagination.Rows() {
// Break on err != nil
// Do something with row
}
Paging on search index queries
IBM Cloudant Search queries use bookmarks for pagination. Pass the bookmark parameter in the URL for GET requests
or in the JSON body for POST requests. You must keep the same query (the same "q"
in IBM Cloudant Search) to get the next page of results. If you change
the query, you might get an empty result set in reply.
See the documentation about query parameters for further details.
The SDK pagination feature is the recommended method to page results on these endpoints.
- The known limitations:
- Cannot reverse direction during pagination.
- No pagination of grouped results.
- No pagination of faceted counts or ranges results.
Example of paging on search index queries
curl -H "Authorization: Bearer A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/cities/_search/search/_search/freetext?q=country:US&limit=5"
{
"total_rows": 65,
"rows":[
{"_id":"10104153","_rev":"1-32aab6258c65c5fc5af044a153f4b994","name":"Silver Lake","latitude":34.08668,"longitude":-118.27023,"country":"US","population":32890,"timezone":"America/Los_Angeles"},
{"_id":"10104154","_rev":"1-125f589bf4e39d8e119b4b7b5b18caf6","name":"Echo Park","latitude":34.07808,"longitude":-118.26066,"country":"US","population":43832,"timezone":"America/Los_Angeles"},
{"_id":"4046704","_rev":"1-2e4b7820872f108c077dab73614067da","name":"Fort Hunt","latitude":38.73289,"longitude":-77.05803,"country":"US","population":16045,"timezone":"America/New_York"},
{"_id":"4048023","_rev":"1-744baaba02218fd84b350e8982c0b783","name":"Bessemer","latitude":33.40178,"longitude":-86.95444,"country":"US","population":27456,"timezone":"America/Chicago"},
{"_id":"4048662","_rev":"1-e95c97013ece566b37583e451c1864ee","name":"Paducah","latitude":37.08339,"longitude":-88.60005,"country":"US","population":25024,"timezone":"America/Chicago"}
],
"bookmark": "g1AAAAA-eJzLYWBgYMpgSmHgKy5JLCrJTq2MT8lPzkzJBYqzmxiYWJiZGYGkOWDSyBJZAPCBD58"
}
curl -H "Authorization: Bearer A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/cities/_search/search/_search/freetext?q=country:US&limit=5&bookmark=g1AAAAA-eJzLYWBgYMpgSmHgKy5JLCrJTq2MT8lPzkzJBYqzmxiYWJiZGYGkOWDSyBJZAPCBD58"
{
"total_rows": 65,
"rows":[
{"_id":"4049979","_rev":"1-1fa2591477c774a07c230571568aeb66","name":"Birmingham","latitude":33.52066,"longitude":-86.80249,"country":"US","population":212237,"timezone":"America/Chicago"},
{"_id":"4054378","_rev":"1-a750085697685e7bc0e49d103d2de59d","name":"Center Point","latitude":33.64566,"longitude":-86.6836,"country":"US","population":16921,"timezone":"America/Chicago"},
{"_id":"4058219","_rev":"1-9b4eb183c9cdf57c19be660ec600330c","name":"Daphne","latitude":30.60353,"longitude":-87.9036,"country":"US","population":21570,"timezone":"America/Chicago"},
{"_id":"4058553","_rev":"1-56100f7e7742028facfcc50ab6b07a04","name":"Decatur","latitude":34.60593,"longitude":-86.98334,"country":"US","population":55683,"timezone":"America/Chicago"},
{"_id":"4059102","_rev":"1-612ae37d982dc71eeecf332c1e1c16aa","name":"Dothan","latitude":31.22323,"longitude":-85.39049,"country":"US","population":65496,"timezone":"America/Chicago"}
],
"bookmark": "g1AAAAA-eJzLYWBgYMpgSmHgKy5JLCrJTq2MT8lPzkzJBYqzmxiYWhoaGIGkOWDSyBJZAO9qD40",
}
Example of paging on search index queries
import java.util.List;
import com.ibm.cloud.cloudant.v1.Cloudant;
import com.ibm.cloud.cloudant.v1.model.SearchResultRow;
import com.ibm.cloud.cloudant.v1.model.PostSearchOptions;
import com.ibm.cloud.cloudant.features.pagination.Pager;
import com.ibm.cloud.cloudant.features.pagination.Pagination;
// Initialize service
Cloudant service = Cloudant.newInstance();
// Setup options
PostSearchOptions options = new PostSearchOptions.Builder()
.db("shoppers") // example database name
.limit(50) // limit option sets the page size
.ddoc("allUsers") // use the allUsers design document
.index("activeUsers") // search in this index
.query("name:Jane* AND active:True") // Lucene search query
.build();
// Create pagination
Pagination<PostSearchOptions, SearchResultRow> pagination = Pagination.newPagination(service, options);
// pagination can be reused without side-effects as a factory for iterables, streams or pagers
// options are fixed at pagination creation time
// Option: iterate rows
// Ideal for using an enhanced for loop with each row.
// The Iterable returned from rows() is reusable in that
// calling iterator() returns a new iterator each time.
// The returned iterators, however, are single use.
for (SearchResultRow row : pagination.rows()) {
// Do something with row
}
import { CloudantV1, Pagination, PagerType } from '@ibm-cloud/cloudant';
import { Writable } from 'node:stream';
import { pipeline } from 'node:stream/promises';
// Initialize service
const client = CloudantV1.newInstance();
// Setup params
const paginationParams = {
db: 'shoppers', // Required: the database name.
limit: 50, // Optional: limit parameter sets the page size. Default and max is 200.
ddoc: 'allUsers', // use the allUsers design document
index: 'activeUsers', // search in this index
query: 'name:Jane* AND active:True', // Lucene search query
};
// Create pagination
// pagination can be reused without side-effects as a factory for async iterables, streams or pagers
const pagination = Pagination.newPagination(
client, // Required: the Cloudant service client instance.
PagerType.POST_SEARCH, // Required: Pager type
paginationParams // Required: pagination configuration params are fixed at pagination creation time
);
// Option: iterate rows with for await...of statement
(async () => {
for await (const row of pagination.rows()) {
// Do something with row
}
})();
// Note: Alternatively to for await....of the iterator protocol functions and properties:
// `next()`, `done`, value`, can be also used on rows().
// As `next(`)` returns with a Promise, make sure using `await` or `.then()` on it.
from ibmcloudant import Pager, Pagination, PagerType
from ibmcloudant.cloudant_v1 import CloudantV1
# Initialize service
service = CloudantV1.new_instance()
# Setup options
opts = {
'db': 'shoppers', # example database name
'limit': 50, # limit option sets the page size
'ddoc': 'allUsers', # use the allUsers design document
'index': 'activeUsers', # search in this index
'query': 'name:Jane* AND active:True' # Lucene search query
}
# Create pagination
pagination = Pagination.new_pagination(
service, PagerType.POST_SEARCH, **opts)
# pagination can be reused without side-effects as a factory for iterables or pagers
# options are fixed at pagination creation time
# Option: iterate rows
# Ideal for using a for loop with each row.
# Each call to rows() returns a fresh iterator that can be traversed once.
for row in pagination.rows():
# Do something with row
pass
import (
"github.com/IBM/cloudant-go-sdk/cloudantv1"
"github.com/IBM/cloudant-go-sdk/features"
)
// Initialize service
service, err := cloudantv1.NewCloudantV1UsingExternalConfig(
&cloudantv1.CloudantV1Options{},
)
if err != nil {
panic(err)
}
// Setup options
opts := service.NewPostSearchOptions("shoppers", "allUsers", "activeUsers", "name:Jane* AND active:True")
opts.SetLimit(50)
// Create pagination
// pagination can be reused without side-effects as a factory for iterators or pagers
// options are fixed at pagination creation time
pagination := features.NewSearchPagination(service, opts)
// Option: iterate rows
// Ideal for using a for/range loop with each row.
// The iter.Seq2 returned from Rows() has an error as a second element.
for row, err := range pagination.Rows() {
// Break on err != nil
// Do something with row
}
Paging the changes feed
Sending a request to /_changes endpoint returns a list of changes that were made to documents
in the database, including insertions, updates, and deletions. The _changes endpoint has a limit
parameter to control how many changes you would like to receive.
The since parameter gets a list of changes that occurred after a specified sequence identifier.
The changes feed supplies result rows at least once and callers must expect potential duplicates.
Use limit and since to paginate the changes feed. To get the since parameter for the next page use the last_seq from the previous page of results.
If the since identifier is 0 (the default), or omitted, the request returns all changes.
If the since identifier is now, the request asks for changes that are made after the current time.
The SDK provides a changes feed follower utility. This helper utility connects to the _changes endpoint
and returns the individual change items. It removes some complexity of using the _changes endpoint
by setting some options automatically and providing error suppression and retries.
The page size is not configurable in the SDK changes followers. It is set to an appropriate value for reasonable response sizes.
The limit parameter controls the total number of changes received by the SDK changes follower using multiple pages if necessary.
Example of paging on the changes feed
curl -H "Authorization: Bearer A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/orders/_changes?limit=5" -H "Content-Type: application/json"
{
"results": [
{"seq": "1-g1AAAA...", "id": "4eee973603bf77f30b1f880ed83df76a", "changes": [{"rev": "1-9d0c2..."}]},
{"seq": "2-g1AAAA...", "id": "4eee973603bf77f30b1f880ed83f469a", "changes": [{"rev": "1-b1f67..."}]},
...
],
"last_seq": "6-g1AAAA...", // <-- This is the sequence we use as the since parameter of the next request
"pending": 2998
}
curl -H "Authorization: Bearer A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/orders/_changes?limit=5&since=6-g1AAAA..." -H "Content-Type: application/json"
{
"results": [
{"seq": "6-g1AAAA...", "id": "65fa623a384648740ec1f39b495d591c", "changes": [{"rev": "1-00203..."}]},
{"seq": "7-g1AAAA...", "id": "d7404903579d6d5880514c22ad983529", "changes": [{"rev": "1-9410b..."}]},
...
],
"last_seq": "10-g1AAAA...",
"pending": 2993
}
Example of paging with changes follower
import java.util.stream.Stream;
import com.ibm.cloud.cloudant.features.ChangesFollower;
import com.ibm.cloud.cloudant.v1.Cloudant;
import com.ibm.cloud.cloudant.v1.model.Change;
import com.ibm.cloud.cloudant.v1.model.ChangesResultItem;
import com.ibm.cloud.cloudant.v1.model.PostChangesOptions;
public class StartOneOffAndProcess {
public static void main(String[] args) {
Cloudant client = Cloudant.newInstance();
// Start from a perviously persisted seq
// Normally this would be read by the app from persistent storage
// e.g. String previouslyPersistedSeq = yourAppPersistenceReadFunction();
String previouslyPersistedSeq = "3-g1AG3...";
PostChangesOptions options = new PostChangesOptions.Builder("example")
.since(previouslyPersistedSeq)
.build();
ChangesFollower changesFollower = new ChangesFollower(client, options);
Stream<ChangesResultItem> changesItems = changesFollower.startOneOff();
changesItems.forEach(changesItem -> {
// do something with changes
System.out.println(changesItem.getId());
for (Change change : changesItem.getChanges()) {
System.out.println(change.getRev());
}
// when change item processing is complete app can store seq
String seq = changesItem.getSeq();
// write seq to persistent storage for use as since if required to resume later
// e.g. call yourAppPersistenceWriteFunction(seq);
});
// Note: java.util.Stream terminal operations are blocking, code here will be unreachable
// until all changes are processed (or another stop condition is reached).
}
}
const client = CloudantV1.newInstance();
// Start from a previously persisted seq
// Normally this would be read by the app from persistent storage
// e.g. previouslyPersistedSeq = yourAppPersistenceReadFunc()
const previouslyPersistedSeq = '3-g1AG3...';
const changesParams = {
db: 'example',
since: previouslyPersistedSeq
};
const changesFollower = new ChangesFollower(client, changesParams);
const changesItemsStream = changesFollower.startOneOff();
const destinationStream = new Writable({
objectMode: true,
write(changesItem, _, callback) {
// do something with change item
console.log(changesItem.id);
for (const change of changesItem.changes) {
console.log(change.rev);
}
// when change item processing is complete app can store seq
const seq = changesItem.seq;
// write seq to persistent storage for use as since if required to resume later
// e.g. yourAppPersistenceWriteFunc()
callback();
}
});
pipeline(changesItemsStream, destinationStream)
.then(() => {
console.log('All changes done');
})
.catch((err) => {
console.log(err);
});
// use for-async-loop feature for stream
/*
getChangesFromFollower(changesItemsStream);
async function getChangesFromFollower(changesItemsStream) {
for await (const changesItem of changesItemsStream) {
// do something with change item
// write seq to persistent storage for use as since
console.log(changesItem.id);
for (const change of changesItem.changes) {
console.log(change.rev);
}
// when change item processing is complete app can store seq
seq = changesItem.seq;
// write seq to persistent storage for use as since if required to resume later
// e.g. yourAppPersistenceWriteFunc();
}
}
*/
import ChangesFollower
from ibmcloudant.cloudant_v1 import CloudantV1
client = CloudantV1.new_instance()
# Start from a previously persisted seq
# Normally this would be read by the app from persistent storage
# e.g. previously_persisted_seq = your_app_persistence_read_func()
previously_persisted_seq = '3-g1AG3...'
changes_follower = ChangesFollower(
service=client,
**{'db': 'example', 'since': previously_persisted_seq})
changes_items = changes_follower.start_one_off()
for changes_item in changes_items:
# do something with changes
print(changes_item.id)
for change in changes_item.changes:
print(change.rev)
# when change item processing is complete app can store seq
seq = changes_item.seq
# write seq to persistent storage for use as since if required to resume later
# e.g. your_app_persistence_write_func(seq)
# Note: iterator above is blocking, code here will be unreachable
# until all changes are processed (or another stop condition is reached).
package main
import (
"fmt"
"github.com/IBM/cloudant-go-sdk/cloudantv1"
"github.com/IBM/cloudant-go-sdk/features"
)
func main() {
client, err := cloudantv1.NewCloudantV1UsingExternalConfig(
&cloudantv1.CloudantV1Options{},
)
if err != nil {
panic(err)
}
postChangesOptions := client.NewPostChangesOptions("example")
// Start from a previously persisted seq
// Normally this would be read by the app from persistent storage
// e.g. prevSeq = yourAppPersistenceReadFunc()
prevSeq := "3-g1AG3..."
postChangesOptions.SetSince(prevSeq)
follower, err := features.NewChangesFollower(client, postChangesOptions)
if err != nil {
panic(err)
}
changesCh, err := follower.StartOneOff()
if err != nil {
panic(err)
}
for changesItem := range changesCh {
// changes item structure returns an error on failed requests
item, err := changesItem.Item()
if err != nil {
panic(err)
}
// do something with changes
fmt.Printf("%s\n", *item.ID)
for _, change := range item.Changes {
fmt.Printf("%s\n", *change.Rev)
}
// when change item processing is complete app can store seq
seq := *item.Seq
// write seq to persistent storage for use as since if required
// to resume later, e.g. yourAppPersistenceWriteFunc(seq)
}
// Note: iterating the returned channel above is blocking, code here
// will be unreachable until all changes are processed
// or another stop condition is reached.
}
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
The SDK provides a logging facility with levels Error, Info, Warn, and Debug.
By default this logger outputs messages to the standard error stream.
The default logging level is Error. With Debug level enabled HTTP messages and retry attempts become visible.
The Go SDK's 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. To use this advanced feature, implement the
Logger interface and then call the SetLogger(yourLogger) function to set your implementation
to handle the log messages.
The SDK uses the java.util.logging framework for logging messages. You can configure the logging
framework to create and configure loggers, handlers (for example ConsoleHandler or FileHandler) and
formatters. Configuring a ConsoleHandler for the com.ibm.cloud.sdk.core package outputs SDK logging messages
to the standard error stream.
Configuring the level for your logger controls the message visibility. You can use the standard java.util.logging.Level
value constants: OFF, SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST, ALL.
For additional HTTP activity logging configure com.ibm.cloud.sdk.core.http.HttpConfigOptions and call
configureClient(options) with it. The logging detail levels are: NONE, BASIC, HEADERS,BODY.
To view these messages both set the logger and handler levels for com.ibm.cloud.sdk.core.http to FINE or below.
You can also define the configuration in a file, then supply the name of the file to the logging framework when you
run your application. To use a particular configuration file when running your java application, specify the name of the
configuration file with the java.util.logging.config.file system property, like this
java -jar myapp.jar -Djava.util.logging.config.file=logging.properties mypackage.MyMainClass
The SDK uses the debug package for logging. To see the log output,
enable debug with string built up of ibm-cloud-sdk-core: followed by the wanted log level. The available levels
are: error, warning, info, verbose, and debug. To see messages from all available levels you can use * like
ibm-cloud-sdk-core*. To configure debug logger for more than one library use a comma-separated
string like ibm-cloud-sdk-core:debug,cloudant-node-sdk:debug. For example to obtain maximum logging you can set the
environment variable DEBUG='ibm-cloud-sdk-core*,cloudant-node-sdk*'.
The debug package logs to the standard error stream. To change output you must override the log or the stderr stream.
The Python SDK uses Python's built-in logging module to
perform logging messages with levels of: CRITICAL, ERROR, WARNING, INFO and DEBUG. To enable logging, import
the logging package then set the preferred log level.
With DEBUG level enabled HTTP messages and retry attempts become visible.
By default the basic configuration outputs messages to the standard error stream.
Example of logging to the standard error stream
// Enable Debug logging
core.SetLoggingLevel(core.LevelDebug)
import java.util.logging.Logger;
import java.util.logging.ConsoleHandler;
import com.ibm.cloud.sdk.core.http.HttpConfigOptions;
// Set logger on core with FINE level
Logger sdkLogger = Logger.getLogger("com.ibm.cloud.sdk.core");
sdkLogger.setLevel(Level.FINE);
// Configure the logging output to the standard error stream with FINE level
ConsoleHandler handler = new ConsoleHandler();
handler.setLevel(Level.FINE);
// Set the HTTP logging level to BASIC
HttpConfigOptions options =
new HttpConfigOptions.Builder()
.loggingLevel(HttpConfigOptions.LoggingLevel.BASIC)
.build();
service.configureClient(options);
import debug from 'debug'
// Enable debug logs on ibm-cloud-sdk-core and error logs on @ibm-cloud/cloudant packages
debug.enable('ibm-cloud-sdk-core:debug,cloudant-node-sdk:error');
// You must use dynamic imports (`await import(...)`) for monitored packages
// to ensure they load only after debug has been enabled.
const { CloudantV1 } = await import('@ibm-cloud/cloudant');
const { BasicAuthenticator } = await import('ibm-cloud-sdk-core');
import logging
# Enable DEBUG logging level which writes with a handler that display messages on the console
logging.basicConfig(level=logging.DEBUG)
Example of logging to a file
// Enable custom file logger
type FileLogger struct {
logLevel core.LogLevel // use log levels defined in core
logFile *os.File
}
func NewFileLogger(level core.LogLevel, filename string) *FileLogger {
logFile, err := os.OpenFile(filename, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
if err != nil {
log.Fatalf("Failed to open log file: %v", err)
}
return &FileLogger{
logLevel: level,
logFile: logFile,
}
}
// Implement the Log function of FileLogger from the Logger interface
func (l *FileLogger) Log(level core.LogLevel, format string, inserts ...interface{}) {
if l.IsLogLevelEnabled(level) {
logger := log.New(l.logFile, "", log.LstdFlags)
logger.Printf(format, inserts...)
}
}
// Implement all the other functions from the Logger interface for FileLogger
// func (l *FileLogger) Error(format string, inserts ...interface{}) { ... }
// func (l *FileLogger) Warn(format string, inserts ...interface{}) { ... }
// func (l *FileLogger) Info(format string, inserts ...interface{}) { ... }
// func (l *FileLogger) Debug(format string, inserts ...interface{}) { ... }
// func (l *FileLogger) SetLogLevel(level core.LogLevel) { ... }
// func (l *FileLogger) GetLogLevel() core.LogLevel { ... }
// func (l *FileLogger) IsLogLevelEnabled(level core.LogLevel) bool { ... }
// Create a new file logger with debug level
yourLogger := NewFileLogger(core.LevelDebug, "your_log_file.log")
core.SetLogger(yourLogger)
import java.util.logging.Logger;
import java.util.logging.FileHandler;
import com.ibm.cloud.sdk.core.http.HttpConfigOptions;
// Set logger on core with FINE level
Logger sdkLogger = Logger.getLogger("com.ibm.cloud.sdk.core");
sdkLogger.setLevel(Level.FINE);
// Use FileHandler if the target of logging is a file
FileHandler handler = new FileHandler("your_log_file.log")
handler.setLevel(Level.FINE);
// Set the HTTP logging level to BODY
HttpConfigOptions options =
new HttpConfigOptions.Builder()
.loggingLevel(HttpConfigOptions.LoggingLevel.BODY)
.build();
service.configureClient(options);
import fs from 'fs';
import debug from 'debug';
// Create a writable stream for the log file
const logStream = fs.createWriteStream('./your_log_file.log', { flags: 'a' });
// Namespace for all kind of logs on ibm-cloud-sdk-core package
const namespace = 'ibm-cloud-sdk-core*';
// Override global log method of the debug package
Object.getPrototypeOf(debug(namespace)).log = (...args) => {
logStream.write(args.join(' ') + '\n');
};
// Enable namespace
debug.enable(namespace);
// You must use dynamic imports (`await import(...)`) for monitored packages
// to ensure they load only after debug has been enabled.
const { CloudantV1 } = await import('@ibm-cloud/cloudant');
const { BasicAuthenticator } = await import('ibm-cloud-sdk-core');
import logging
# Enable DEBUG logging level and use filename parameter when the target of logging is a file
logging.basicConfig(level=logging.DEBUG, filename='your_log_file.log')
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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud"
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 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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/_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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X PUT -H "Content-Type: application/json" "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/_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" }
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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/_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
/_uuidsstyle 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" }
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,
) -> DetailedResponseRequest
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 rows in descending by key order.
Default:
falseQuery 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 ≤ 9007199254740991
Default:
0Query 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 rows in descending by key order.
Default:
falseQuery 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 ≤ 9007199254740991
Default:
0Query 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 rows in descending by key order.
Default:
falseQuery 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 ≤ 9007199254740991
Default:
0Query 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 rows in descending by key order.
Default:
falseQuery 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 ≤ 9007199254740991
Default:
0Query 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 rows in descending by key order.
Default:
falseQuery 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 ≤ 9007199254740991
Default:
0Query 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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/_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_dbsstyle 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" }
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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X POST "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/_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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X DELETE "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/products"
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( "products", ) 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("products") .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: 'products'}).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.delete_database(db='products').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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/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 ≤ 9007199254740991
A count of the documents in the specified database.
Possible values: 0 ≤ value ≤ 9007199254740991
Number of deleted documents
Possible values: 0 ≤ value ≤ 9007199254740991
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 information. 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
^([1-9]\d*-[A-Za-z0-9-_]+)$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
^([1-9]\d*-[A-Za-z0-9-_]+)$An opaque string that describes the committed state of the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([1-9]\d*-[A-Za-z0-9-_]+)$An opaque string that describes the compaction state of the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([1-9]\d*-[A-Za-z0-9-_]+)$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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 ≤ 9007199254740991
A count of the documents in the specified database.
Possible values: 0 ≤ value ≤ 9007199254740991
Number of deleted documents.
Possible values: 0 ≤ value ≤ 9007199254740991
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 information. 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
truefor a partitioned database.
Schema for size information of content.
- Sizes
The active size of the content, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740991
The total uncompressed size of the content, in bytes.
This is the value used for IBM Cloudant storage billing.
Possible values: 0 ≤ value ≤ 9007199254740991
The total size of the content as stored on disk, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740991
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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 ≤ 9007199254740991
A count of the documents in the specified database.
Possible values: 0 ≤ value ≤ 9007199254740991
Number of deleted documents.
Possible values: 0 ≤ value ≤ 9007199254740991
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 information. 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
truefor a partitioned database.
Schema for size information of content.
- sizes
The active size of the content, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740991
The total uncompressed size of the content, in bytes.
This is the value used for IBM Cloudant storage billing.
Possible values: 0 ≤ value ≤ 9007199254740991
The total size of the content as stored on disk, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740991
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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 ≤ 9007199254740991
A count of the documents in the specified database.
Possible values: 0 ≤ value ≤ 9007199254740991
Number of deleted documents.
Possible values: 0 ≤ value ≤ 9007199254740991
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 information. 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
truefor a partitioned database.
Schema for size information of content.
- sizes
The active size of the content, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740991
The total uncompressed size of the content, in bytes.
This is the value used for IBM Cloudant storage billing.
Possible values: 0 ≤ value ≤ 9007199254740991
The total size of the content as stored on disk, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740991
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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 ≤ 9007199254740991
A count of the documents in the specified database.
Possible values: 0 ≤ value ≤ 9007199254740991
Number of deleted documents.
Possible values: 0 ≤ value ≤ 9007199254740991
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 information. 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
truefor a partitioned database.
Schema for size information of content.
- sizes
The active size of the content, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740991
The total uncompressed size of the content, in bytes.
This is the value used for IBM Cloudant storage billing.
Possible values: 0 ≤ value ≤ 9007199254740991
The total size of the content as stored on disk, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740991
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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" --head "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/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,
) -> DetailedResponseRequest
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:
falseThe number of replicas of the database in the cluster. The default is 3, unless overridden in the
cluster config.Possible values: value = 3
Default:
3The 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:
falseThe 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:
falseThe 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:
falseThe 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:
falseThe 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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X PUT "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/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}/_changesRequest
Custom Headers
Header parameter to specify the ID of the last events received by the server on a previous connection. Overrides
sincequery 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 for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of conflicted revisions in each returned document. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to return changes in the descending order with most recent change first. The
sinceparameter has no effect when using descending order.Default:
falseQuery parameter to specify a JSON array list of document IDs to restrict the changes feed to. Used with the
_doc_idsfilter. Since length of URL is limited, it is better to use POST/{db}/_changesinstead.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:
normalQuery 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_idsrequest body parameter. (POSTonly)_selector- Returns changes for documents that match theselectorrequest body parameter. The selector syntax is the same as used for_find. (POSTonly)_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,_designor_doc_idsfilters rather than JS based_viewor design document filters. If you need to pass values to change the filtered content use the_selectorfilter 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
continuousandeventsourcefeeds. Overrides any timeout to keep the feed alive indefinitely. May also betrueto 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,
heartbeatis not suitable as a keepalive mechanism. Instead, consider one of the following options:- Use the
timeoutparameter with a value that is compatible with your network environment. - Switch to scheduled usage of one of the non-continuous changes feed
types (
normalorlongpoll). - 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:
falseQuery parameter to specify the ID of the last events received by the server on a previous connection. Alias of
Last-Event-IDheader.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. Possible values are:
0for all available changes (default).nowfor future changes.- A valid update sequence, for example, from the
seqvalue of a change received before.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$Example:
0Query 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_onlyQuery 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
longpollorcontinuousfeeds. Default value is specified byhttpd/changes_timeoutconfiguration option. Note that60000value is also the default maximum timeout to prevent undetected dead connections.Possible values: 0 ≤ value ≤ 60000
Default:
60000Query 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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/orders/_changes?limit=1"
Response
Schema for normal changes feed result.
last_seq
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([1-9]\d*-[A-Za-z0-9-_]+)$pending
Possible values: 0 ≤ value ≤ 9007199254740991
results
Possible values: 0 ≤ number of items ≤ 4294967295
Status Code
HTTP response for
/{db}/_changesstyle 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" }
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,
) -> DetailedResponsepost_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,
) -> DetailedResponseRequest
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
sincequery 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 for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of conflicted revisions in each returned document. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to return changes in the descending order with most recent change first. The
sinceparameter has no effect when using descending order.Default:
falseQuery parameter to specify the changes feed type.
Allowable values: [
continuous,eventsource,longpoll,normal]Default:
normalQuery 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_idsrequest body parameter. (POSTonly)_selector- Returns changes for documents that match theselectorrequest body parameter. The selector syntax is the same as used for_find. (POSTonly)_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,_designor_doc_idsfilters rather than JS based_viewor design document filters. If you need to pass values to change the filtered content use the_selectorfilter 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
continuousandeventsourcefeeds. Overrides any timeout to keep the feed alive indefinitely. May also betrueto 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,
heartbeatis not suitable as a keepalive mechanism. Instead, consider one of the following options:- Use the
timeoutparameter with a value that is compatible with your network environment. - Switch to scheduled usage of one of the non-continuous changes feed
types (
normalorlongpoll). - 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:
falseQuery parameter to specify the ID of the last events received by the server on a previous connection. Alias of
Last-Event-IDheader.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. Possible values are:
0for all available changes (default).nowfor future changes.- A valid update sequence, for example, from the
seqvalue of a change received before.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$Example:
0Query 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_onlyQuery 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
longpollorcontinuousfeeds. Default value is specified byhttpd/changes_timeoutconfiguration option. Note that60000value is also the default maximum timeout to prevent undetected dead connections.Possible values: 0 ≤ value ≤ 60000
Default:
60000Query 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
$eqoperator 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$regexcannot 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
$eqoperator 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$regexcannot 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
sincequery 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 for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of conflicted revisions in each returned document. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to return changes in the descending order with most recent change first. The
sinceparameter has no effect when using descending order.Default:
falseQuery parameter to specify the changes feed type.
Allowable values: [
continuous,eventsource,longpoll,normal]Default:
normalQuery 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_idsrequest body parameter. (POSTonly)_selector- Returns changes for documents that match theselectorrequest body parameter. The selector syntax is the same as used for_find. (POSTonly)_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,_designor_doc_idsfilters rather than JS based_viewor design document filters. If you need to pass values to change the filtered content use the_selectorfilter 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
continuousandeventsourcefeeds. Overrides any timeout to keep the feed alive indefinitely. May also betrueto 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,
heartbeatis not suitable as a keepalive mechanism. Instead, consider one of the following options:- Use the
timeoutparameter with a value that is compatible with your network environment. - Switch to scheduled usage of one of the non-continuous changes feed
types (
normalorlongpoll). - 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:
falseQuery 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. Possible values are:
0for all available changes (default).nowfor future changes.- A valid update sequence, for example, from the
seqvalue of a change received before.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/Examples:0Query 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_onlyQuery 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
longpollorcontinuousfeeds. Default value is specified byhttpd/changes_timeoutconfiguration option. Note that60000value is also the default maximum timeout to prevent undetected dead connections.Possible values: 0 ≤ value ≤ 60000
Default:
60000Query 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
$eqoperator 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$regexcannot 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
sincequery 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 for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of conflicted revisions in each returned document. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to return changes in the descending order with most recent change first. The
sinceparameter has no effect when using descending order.Default:
falseQuery parameter to specify the changes feed type.
Allowable values: [
continuous,eventsource,longpoll,normal]Default:
normalQuery 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_idsrequest body parameter. (POSTonly)_selector- Returns changes for documents that match theselectorrequest body parameter. The selector syntax is the same as used for_find. (POSTonly)_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,_designor_doc_idsfilters rather than JS based_viewor design document filters. If you need to pass values to change the filtered content use the_selectorfilter 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
continuousandeventsourcefeeds. Overrides any timeout to keep the feed alive indefinitely. May also betrueto 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,
heartbeatis not suitable as a keepalive mechanism. Instead, consider one of the following options:- Use the
timeoutparameter with a value that is compatible with your network environment. - Switch to scheduled usage of one of the non-continuous changes feed
types (
normalorlongpoll). - 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:
falseQuery 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. Possible values are:
0for all available changes (default).nowfor future changes.- A valid update sequence, for example, from the
seqvalue of a change received before.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/Examples:0Query 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_onlyQuery 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
longpollorcontinuousfeeds. Default value is specified byhttpd/changes_timeoutconfiguration option. Note that60000value is also the default maximum timeout to prevent undetected dead connections.Possible values: 0 ≤ value ≤ 60000
Default:
60000Query 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
$eqoperator 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$regexcannot 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
sincequery 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 for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of conflicted revisions in each returned document. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to return changes in the descending order with most recent change first. The
sinceparameter has no effect when using descending order.Default:
falseQuery parameter to specify the changes feed type.
Allowable values: [
continuous,eventsource,longpoll,normal]Default:
normalQuery 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_idsrequest body parameter. (POSTonly)_selector- Returns changes for documents that match theselectorrequest body parameter. The selector syntax is the same as used for_find. (POSTonly)_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,_designor_doc_idsfilters rather than JS based_viewor design document filters. If you need to pass values to change the filtered content use the_selectorfilter 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
continuousandeventsourcefeeds. Overrides any timeout to keep the feed alive indefinitely. May also betrueto 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,
heartbeatis not suitable as a keepalive mechanism. Instead, consider one of the following options:- Use the
timeoutparameter with a value that is compatible with your network environment. - Switch to scheduled usage of one of the non-continuous changes feed
types (
normalorlongpoll). - 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:
falseQuery 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. Possible values are:
0for all available changes (default).nowfor future changes.- A valid update sequence, for example, from the
seqvalue of a change received before.
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_onlyQuery 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
longpollorcontinuousfeeds. Default value is specified byhttpd/changes_timeoutconfiguration option. Note that60000value is also the default maximum timeout to prevent undetected dead connections.Possible values: 0 ≤ value ≤ 60000
Default:
60000Query 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
$eqoperator 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$regexcannot 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
sincequery 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 for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of conflicted revisions in each returned document. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to return changes in the descending order with most recent change first. The
sinceparameter has no effect when using descending order.Default:
falseQuery parameter to specify the changes feed type.
Allowable values: [
continuous,eventsource,longpoll,normal]Default:
normalQuery 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_idsrequest body parameter. (POSTonly)_selector- Returns changes for documents that match theselectorrequest body parameter. The selector syntax is the same as used for_find. (POSTonly)_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,_designor_doc_idsfilters rather than JS based_viewor design document filters. If you need to pass values to change the filtered content use the_selectorfilter 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
continuousandeventsourcefeeds. Overrides any timeout to keep the feed alive indefinitely. May also betrueto 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,
heartbeatis not suitable as a keepalive mechanism. Instead, consider one of the following options:- Use the
timeoutparameter with a value that is compatible with your network environment. - Switch to scheduled usage of one of the non-continuous changes feed
types (
normalorlongpoll). - 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:
falseQuery 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. Possible values are:
0for all available changes (default).nowfor future changes.- A valid update sequence, for example, from the
seqvalue of a change received before.
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_onlyQuery 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
longpollorcontinuousfeeds. Default value is specified byhttpd/changes_timeoutconfiguration option. Note that60000value is also the default maximum timeout to prevent undetected dead connections.Possible values: 0 ≤ value ≤ 60000
Default:
60000Query 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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X POST "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/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
^([1-9]\d*-[A-Za-z0-9-_]+)$pending
Possible values: 0 ≤ value ≤ 9007199254740991
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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/pending.
Possible values: 0 ≤ value ≤ 9007199254740991
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
truethen 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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
Schema for normal changes feed result.
last_seq.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/pending.
Possible values: 0 ≤ value ≤ 9007199254740991
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
truethen 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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
Schema for normal changes feed result.
last_seq.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/pending.
Possible values: 0 ≤ value ≤ 9007199254740991
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
truethen 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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
Schema for normal changes feed result.
last_seq.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/pending.
Possible values: 0 ≤ value ≤ 9007199254740991
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
truethen 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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
Status Code
HTTP response for
/{db}/_changesstyle 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,
) -> DetailedResponseRequest
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
^([1-9]\d*-[A-Za-z0-9-_]+)$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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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/jsonQuery 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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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/jsonQuery 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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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/jsonQuery 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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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/jsonQuery 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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X POST "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/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 ( "encoding/json" "fmt" "os" "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) } productsDocReader, err := os.Open("products_doc.json") if err != nil { panic(err) } defer productsDocReader.Close() postDocumentOptions := service.NewPostDocumentOptions( "products", ) postDocumentOptions.SetContentType("application/json") postDocumentOptions.SetBody(productsDocReader) 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 java.io.FileInputStream; 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(); try (FileInputStream productsDocumentStream = new FileInputStream("products_doc.json")) { PostDocumentOptions documentOptions = new PostDocumentOptions.Builder() .db("products") .contentType("application/json") .body(productsDocumentStream) .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)from ibmcloudant.cloudant_v1 import Document, CloudantV1 service = CloudantV1.new_instance() with open("products_doc.json", "rb") as products_doc: response = service.post_document( db='products', document=products_doc_binary, content_type="application/json" ).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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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_docsRequest
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. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to return rows in descending by key order.
Default:
falseQuery 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 stop returning rows at the specified document ID. No effect if using
groupor not providing end key.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:
falseQuery parameter to specify whether the specified end key should be included in the result.
Default:
trueQuery parameter to specify to return only rows 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 rows 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 ≤ 9007199254740991
Default:
0Query 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 start returning rows at the specified document ID. No effect if using
groupor not providing start key.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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/orders/_all_docs"
Response
Schema for the result of an all documents operation.
Offset where the list started.
Possible values: 0 ≤ value ≤ 9007199254740991
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
^([1-9]\d*-[A-Za-z0-9-_]+)$
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" }
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,
) -> DetailedResponsepost_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,
) -> DetailedResponseRequest
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 for compressed attachments. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include attachment content in included document content or only the attachment metadata. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include a list of conflicted revisions in each returned document. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to return the documents in descending by key order.
Default:
falseParameter to specify whether to include the full content of the documents in the response.
Default:
falseParameter to specify whether to include the specified end key in the result.
Default:
trueParameter 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 ≤ 9007199254740991
Default:
0Query 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 false.
Default:
trueParameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
falseSchema 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 for compressed attachments. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include attachment content in included document content or only the attachment metadata. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include a list of conflicted revisions in each returned document. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to return the documents in descending by key order.
Default:
falseParameter to specify whether to include the full content of the documents in the response.
Default:
falseParameter to specify whether to include the specified end key in the result.
Default:
trueParameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Examples:10Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740991
Default:
0Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
falseSchema 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 for compressed attachments. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include attachment content in included document content or only the attachment metadata. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include a list of conflicted revisions in each returned document. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to return the documents in descending by key order.
Default:
falseParameter to specify whether to include the full content of the documents in the response.
Default:
falseParameter to specify whether to include the specified end key in the result.
Default:
trueParameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Examples:10Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740991
Default:
0Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
falseSchema 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 for compressed attachments. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include attachment content in included document content or only the attachment metadata. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include a list of conflicted revisions in each returned document. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to return the documents in descending by key order.
Default:
falseParameter to specify whether to include the full content of the documents in the response.
Default:
falseParameter to specify whether to include the specified end key in the result.
Default:
trueParameter 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 ≤ 9007199254740991
Default:
0Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
falseSchema 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 for compressed attachments. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include attachment content in included document content or only the attachment metadata. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include a list of conflicted revisions in each returned document. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to return the documents in descending by key order.
Default:
falseParameter to specify whether to include the full content of the documents in the response.
Default:
falseParameter to specify whether to include the specified end key in the result.
Default:
trueParameter 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 ≤ 9007199254740991
Default:
0Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
falseSchema 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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X POST "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/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 ≤ 9007199254740991
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
^([1-9]\d*-[A-Za-z0-9-_]+)$
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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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_docsstyle view.- Value
If
truethen 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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_docsstyle view.- value
If
truethen 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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_docsstyle view.- value
If
truethen 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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_docsstyle view.- value
If
truethen 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
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,
) -> DetailedResponsepost_all_docs_queries_as_stream(
self,
db: str,
queries: List['AllDocsQuery'],
**kwargs,
) -> DetailedResponseRequest
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_docsrequest.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_docsrequest.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 for compressed attachments. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include attachment content in included document content or only the attachment metadata. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include a list of conflicted revisions in each returned document. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to return the documents in descending by key order.
Default:
falseParameter to specify whether to include the full content of the documents in the response.
Default:
falseParameter to specify whether to include the specified end key in the result.
Default:
trueParameter 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 ≤ 9007199254740991
Default:
0Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
falseSchema 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_docsrequest.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 for compressed attachments. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include attachment content in included document content or only the attachment metadata. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include a list of conflicted revisions in each returned document. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to return the documents in descending by key order.
Default:
falseParameter to specify whether to include the full content of the documents in the response.
Default:
falseParameter to specify whether to include the specified end key in the result.
Default:
trueParameter 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 ≤ 9007199254740991
Default:
0Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
falseSchema 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_docsrequest.Possible values: 1 ≤ number of items ≤ 65535
Examples:- queries
Parameter to specify whether to include the encoding information for compressed attachments. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include attachment content in included document content or only the attachment metadata. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include a list of conflicted revisions in each returned document. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to return the documents in descending by key order.
Default:
falseParameter to specify whether to include the full content of the documents in the response.
Default:
falseParameter to specify whether to include the specified end key in the result.
Default:
trueParameter 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 ≤ 9007199254740991
Default:
0Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
falseSchema 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_docsrequest.Possible values: 1 ≤ number of items ≤ 65535
Examples:- queries
Parameter to specify whether to include the encoding information for compressed attachments. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include attachment content in included document content or only the attachment metadata. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include a list of conflicted revisions in each returned document. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to return the documents in descending by key order.
Default:
falseParameter to specify whether to include the full content of the documents in the response.
Default:
falseParameter to specify whether to include the specified end key in the result.
Default:
trueParameter 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 ≤ 9007199254740991
Default:
0Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
falseSchema 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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X POST "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/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_docsrequest.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_docsrequest.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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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_docsstyle view.- Value
If
truethen 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
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_docsrequest.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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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_docsstyle view.- value
If
truethen 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
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_docsrequest.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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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_docsstyle view.- value
If
truethen 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
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_docsrequest.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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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_docsstyle view.- value
If
truethen 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
Status Code
HTTP response for
/_all_docs/queriesstyle 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,
) -> DetailedResponseRequest
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X POST "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X POST "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/events/_bulk_docs" -H "Content-Type: application/json" --data '{ "docs": [ { "_id": "0007241142412418284", "_rev": "1-00000000000000000000000000000000", "_deleted": true }, { "_id": "0007241142412418285", "_rev": "1-00000000000000000000000000000000", "_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-00000000000000000000000000000000") eventDoc1.Deleted = core.BoolPtr(true) eventDoc2 := cloudantv1.Document{ ID: core.StringPtr("H8tDIwfadxp9:0007241142412418285"), } eventDoc2.Rev = core.StringPtr("1-00000000000000000000000000000000") 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-00000000000000000000000000000000"); eventDoc1.setDeleted(true); Document eventDoc2 = new Document(); eventDoc2.setId("H8tDIwfadxp9:0007241142412418285"); eventDoc1.setRev("1-00000000000000000000000000000000"); 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-00000000000000000000000000000000', _deleted: true, } const eventDoc2: CloudantV1.Document = { _id: 'H8tDIwfadxp9:0007241142412418285', _rev: '1-00000000000000000000000000000000', _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-00000000000000000000000000000000", _deleted=True, ) event_doc_2 = Document( _id="H8tDIwfadxp9:0007241142412418285", _rev="1-00000000000000000000000000000000", _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 ≤ 9007199254740991
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,
) -> DetailedResponsepost_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,
) -> DetailedResponsepost_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,
) -> DetailedResponsepost_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,
) -> DetailedResponseRequest
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 attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include the encoding information for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
falseQuery 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 attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include the encoding information for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
falseQuery 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 attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include the encoding information for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
falseQuery 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 attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include the encoding information for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
falseQuery 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 attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include the encoding information for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
falseQuery parameter to specify whether to include a list of all known document revisions.
Default:
false
curl -H "Authorization: Bearer A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X POST "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/orders/_bulk_get" -H "Content-Type: application/json" --data '{ "docs": [ { "id": "order00067", "rev": "3-22222222222222222222222222222222" }, { "id": "order00067" "rev": "4-33333333333333333333333333333333" } ], }'
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-22222222222222222222222222222222"), }, { ID: &docID, Rev: core.StringPtr("4-33333333333333333333333333333333"), }, } 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-00000000000000000000000000000000"}, }, }, ) 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-22222222222222222222222222222222") .build()); bulkGetDocs.add( new BulkGetQueryDocument.Builder() .id(docId) .rev("4-33333333333333333333333333333333") .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-00000000000000000000000000000000") .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-22222222222222222222222222222222' }; const bulkGetDoc2: CloudantV1.BulkGetQueryDocument = { id: docId, rev: '4-33333333333333333333333333333333' }; 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-00000000000000000000000000000000'] }, ]; 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-22222222222222222222222222222222') bulk_get_doc_2 = BulkGetQueryDocument( id=doc_id, rev='4-33333333333333333333333333333333') 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-00000000000000000000000000000000']) 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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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_sincealternative 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_sincealternative 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=allalternative 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=allalternative 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_docsRequest
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. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to return rows in descending by key order.
Default:
falseQuery 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 stop returning rows at the specified document ID. No effect if using
groupor not providing end key.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:
falseQuery parameter to specify whether the specified end key should be included in the result.
Default:
trueQuery parameter to specify to return only rows 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 rows 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 ≤ 9007199254740991
Default:
0Query 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 start returning rows at the specified document ID. No effect if using
groupor not providing start key.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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/events/_partition/ns1HJS13AMkK/_all_docs?include_docs=true"
Response
Schema for the result of an all documents operation.
Offset where the list started.
Possible values: 0 ≤ value ≤ 9007199254740991
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
^([1-9]\d*-[A-Za-z0-9-_]+)$
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" }
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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X DELETE "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/events/0007241142412418284?rev=1-00000000000000000000000000000000"
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-00000000000000000000000000000000") 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-00000000000000000000000000000000") .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-00000000000000000000000000000000' }).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-00000000000000000000000000000000' ).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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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,
) -> DetailedResponseget_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,
) -> DetailedResponseget_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,
) -> DetailedResponseget_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,
) -> DetailedResponseRequest
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 attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include the encoding information for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery 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. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of deleted conflicted revisions in the
_deleted_conflictsproperty of the returned document.Default:
falseQuery parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
falseQuery parameter to specify whether to include the last update sequence for the document.
Default:
falseQuery 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:
falseQuery parameter to specify leaf revisions to retrieve. Additionally, it accepts a value of
allto 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:
falseQuery 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 attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include the encoding information for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of conflicted revisions in each returned document. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of deleted conflicted revisions in the
_deleted_conflictsproperty of the returned document.Default:
falseQuery parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
falseQuery parameter to specify whether to include the last update sequence for the document.
Default:
falseQuery 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:
falseQuery 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:
falseQuery 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 attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include the encoding information for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of conflicted revisions in each returned document. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of deleted conflicted revisions in the
_deleted_conflictsproperty of the returned document.Default:
falseQuery parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
falseQuery parameter to specify whether to include the last update sequence for the document.
Default:
falseQuery 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:
falseQuery 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:
falseQuery 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 attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include the encoding information for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of conflicted revisions in each returned document. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of deleted conflicted revisions in the
_deleted_conflictsproperty of the returned document.Default:
falseQuery parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
falseQuery parameter to specify whether to include the last update sequence for the document.
Default:
falseQuery 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:
falseQuery 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:
falseQuery 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 attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include the encoding information for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of conflicted revisions in each returned document. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of deleted conflicted revisions in the
_deleted_conflictsproperty of the returned document.Default:
falseQuery parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
falseQuery parameter to specify whether to include the last update sequence for the document.
Default:
falseQuery 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:
falseQuery 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:
falseQuery parameter to specify whether to includes detailed information for all known document revisions.
Default:
false
curl -H "Authorization: Bearer A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/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
^([1-9]\d*-[A-Za-z0-9-_]+)$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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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,
) -> DetailedResponseRequest
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:
falseQuery 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:
falseQuery 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:
falseQuery 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:
falseQuery 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:
falseQuery 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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" --head "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/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,
) -> DetailedResponseRequest
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:
falseQuery 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
^([1-9]\d*-[A-Za-z0-9-_]+)$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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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/jsonHeader 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:
falseQuery 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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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/jsonHeader 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:
falseQuery 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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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/jsonHeader 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:
falseQuery 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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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/jsonHeader 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:
falseQuery 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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X PUT "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X DELETE "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/products/_design/appliances?rev=1-00000000000000000000000000000000"
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-00000000000000000000000000000000") 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-00000000000000000000000000000000") .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-00000000000000000000000000000000' }).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-00000000000000000000000000000000' ).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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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,
) -> DetailedResponseRequest
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 attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include the encoding information for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery 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. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of deleted conflicted revisions in the
_deleted_conflictsproperty of the returned document.Default:
falseQuery parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
falseQuery parameter to specify whether to include the last update sequence for the document.
Default:
falseQuery 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:
falseQuery parameter to specify leaf revisions to retrieve. Additionally, it accepts a value of
allto 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:
falseQuery 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 attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include the encoding information for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of conflicted revisions in each returned document. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of deleted conflicted revisions in the
_deleted_conflictsproperty of the returned document.Default:
falseQuery parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
falseQuery parameter to specify whether to include the last update sequence for the document.
Default:
falseQuery 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:
falseQuery 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:
falseQuery 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 attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include the encoding information for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of conflicted revisions in each returned document. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of deleted conflicted revisions in the
_deleted_conflictsproperty of the returned document.Default:
falseQuery parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
falseQuery parameter to specify whether to include the last update sequence for the document.
Default:
falseQuery 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:
falseQuery 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:
falseQuery 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 attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include the encoding information for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of conflicted revisions in each returned document. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of deleted conflicted revisions in the
_deleted_conflictsproperty of the returned document.Default:
falseQuery parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
falseQuery parameter to specify whether to include the last update sequence for the document.
Default:
falseQuery 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:
falseQuery 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:
falseQuery 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 attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include the encoding information for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of conflicted revisions in each returned document. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of deleted conflicted revisions in the
_deleted_conflictsproperty of the returned document.Default:
falseQuery parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
falseQuery parameter to specify whether to include the last update sequence for the document.
Default:
falseQuery 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:
falseQuery 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:
falseQuery parameter to specify whether to includes detailed information for all known document revisions.
Default:
false
curl -H "Authorization: Bearer A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/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) } getDesignDocumentOptions := service.NewGetDesignDocumentOptions( "products", "appliances", ) 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") .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' }).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' ).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
^([1-9]\d*-[A-Za-z0-9-_]+)$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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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
indexfunction 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 ifstoreis 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. Set this option to
falsefor a design document that describes global indexes in a partitioned database. A design document describes either global or partitioned indexes, but not both. By default, for a partitioned database this option istrueand the design document describes partitioned indexes for queries on a single partition at a time. When set tofalsethis option allows creating global indexes in this design document for queries spanning many partitions. For non-partitioned databases, the default isfalseand design documents default to global. Only partitioned databases can have partitioned 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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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
indexfunction 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 ifstoreis 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. Set this option to
falsefor a design document that describes global indexes in a partitioned database. A design document describes either global or partitioned indexes, but not both. By default, for a partitioned database this option istrueand the design document describes partitioned indexes for queries on a single partition at a time. When set tofalsethis option allows creating global indexes in this design document for queries spanning many partitions. For non-partitioned databases, the default isfalseand design documents default to global. Only partitioned databases can have partitioned 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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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
indexfunction 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 ifstoreis 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. Set this option to
falsefor a design document that describes global indexes in a partitioned database. A design document describes either global or partitioned indexes, but not both. By default, for a partitioned database this option istrueand the design document describes partitioned indexes for queries on a single partition at a time. When set tofalsethis option allows creating global indexes in this design document for queries spanning many partitions. For non-partitioned databases, the default isfalseand design documents default to global. Only partitioned databases can have partitioned 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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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
indexfunction 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 ifstoreis 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. Set this option to
falsefor a design document that describes global indexes in a partitioned database. A design document describes either global or partitioned indexes, but not both. By default, for a partitioned database this option istrueand the design document describes partitioned indexes for queries on a single partition at a time. When set tofalsethis option allows creating global indexes in this design document for queries spanning many partitions. For non-partitioned databases, the default isfalseand design documents default to global. Only partitioned databases can have partitioned 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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" --head "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/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,
) -> DetailedResponseRequest
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:
falseQuery 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
^([1-9]\d*-[A-Za-z0-9-_]+)$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:
trueSchema 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:
javascriptSchema 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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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:
trueSchema 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
indexfunction 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 ifstoreis 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:
javascriptSchema for design document options.
- Options
Whether this design document describes partitioned or global indexes. Set this option to
falsefor a design document that describes global indexes in a partitioned database. A design document describes either global or partitioned indexes, but not both. By default, for a partitioned database this option istrueand the design document describes partitioned indexes for queries on a single partition at a time. When set tofalsethis option allows creating global indexes in this design document for queries spanning many partitions. For non-partitioned databases, the default isfalseand design documents default to global. Only partitioned databases can have partitioned 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:
falseQuery 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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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:
trueSchema 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
indexfunction 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 ifstoreis 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:
javascriptSchema for design document options.
- options
Whether this design document describes partitioned or global indexes. Set this option to
falsefor a design document that describes global indexes in a partitioned database. A design document describes either global or partitioned indexes, but not both. By default, for a partitioned database this option istrueand the design document describes partitioned indexes for queries on a single partition at a time. When set tofalsethis option allows creating global indexes in this design document for queries spanning many partitions. For non-partitioned databases, the default isfalseand design documents default to global. Only partitioned databases can have partitioned 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:
falseQuery 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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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:
trueSchema 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
indexfunction 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 ifstoreis 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:
javascriptSchema for design document options.
- options
Whether this design document describes partitioned or global indexes. Set this option to
falsefor a design document that describes global indexes in a partitioned database. A design document describes either global or partitioned indexes, but not both. By default, for a partitioned database this option istrueand the design document describes partitioned indexes for queries on a single partition at a time. When set tofalsethis option allows creating global indexes in this design document for queries spanning many partitions. For non-partitioned databases, the default isfalseand design documents default to global. Only partitioned databases can have partitioned 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:
falseQuery 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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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:
trueSchema 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
indexfunction 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 ifstoreis 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:
javascriptSchema for design document options.
- options
Whether this design document describes partitioned or global indexes. Set this option to
falsefor a design document that describes global indexes in a partitioned database. A design document describes either global or partitioned indexes, but not both. By default, for a partitioned database this option istrueand the design document describes partitioned indexes for queries on a single partition at a time. When set tofalsethis option allows creating global indexes in this design document for queries spanning many partitions. For non-partitioned databases, the default isfalseand design documents default to global. Only partitioned databases can have partitioned 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:
falseQuery 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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X PUT "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X PUT "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/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
allusersdesign document in theusersdatabase andappliancesdesign document in the partitionedproductsdatabase.
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
allusersdesign document in theusersdatabase andcheckoutdesign document in the partitionedeventsdatabase.
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
allusersdesign document in theusersdatabase andcheckoutdesign document in the partitionedeventsdatabase.
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
allusersdesign document in theusersdatabase andcheckoutdesign document in the partitionedeventsdatabase.
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
allusersdesign document in theusersdatabase andcheckoutdesign document in the partitionedeventsdatabase.
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/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 ≤ 9007199254740991
The total uncompressed size of the content, in bytes.
This is the value used for IBM Cloudant storage billing.
Possible values: 0 ≤ value ≤ 9007199254740991
The total size of the content as stored on disk, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
Sum of all shard copies.
Possible values: 0 ≤ value ≤ 9007199254740991
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 ≤ 9007199254740991
The total uncompressed size of the content, in bytes.
This is the value used for IBM Cloudant storage billing.
Possible values: 0 ≤ value ≤ 9007199254740991
The total size of the content as stored on disk, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
Sum of all shard copies.
Possible values: 0 ≤ value ≤ 9007199254740991
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 ≤ 9007199254740991
The total uncompressed size of the content, in bytes.
This is the value used for IBM Cloudant storage billing.
Possible values: 0 ≤ value ≤ 9007199254740991
The total size of the content as stored on disk, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
Sum of all shard copies.
Possible values: 0 ≤ value ≤ 9007199254740991
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 ≤ 9007199254740991
The total uncompressed size of the content, in bytes.
This is the value used for IBM Cloudant storage billing.
Possible values: 0 ≤ value ≤ 9007199254740991
The total size of the content as stored on disk, in bytes.
Possible values: 0 ≤ value ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
Sum of all shard copies.
Possible values: 0 ≤ value ≤ 9007199254740991
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}/_infostyle 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" }
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_docsRequest
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. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to return rows in descending by key order.
Default:
falseQuery 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 stop returning rows at the specified document ID. No effect if using
groupor not providing end key.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:
falseQuery parameter to specify whether the specified end key should be included in the result.
Default:
trueQuery parameter to specify to return only rows 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 rows 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 ≤ 9007199254740991
Default:
0Query 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 start returning rows at the specified document ID. No effect if using
groupor not providing start key.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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/users/_design_docs?descending=true"
Response
Schema for the result of an all documents operation.
Offset where the list started.
Possible values: 0 ≤ value ≤ 9007199254740991
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
^([1-9]\d*-[A-Za-z0-9-_]+)$
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" }
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,
) -> DetailedResponseRequest
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 for compressed attachments. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include attachment content in included document content or only the attachment metadata. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include a list of conflicted revisions in each returned document. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to return the documents in descending by key order.
Default:
falseParameter to specify whether to include the full content of the documents in the response.
Default:
falseParameter to specify whether to include the specified end key in the result.
Default:
trueParameter 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 ≤ 9007199254740991
Default:
0Query 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 false.
Default:
trueParameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
falseSchema 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 for compressed attachments. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include attachment content in included document content or only the attachment metadata. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include a list of conflicted revisions in each returned document. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to return the documents in descending by key order.
Default:
falseParameter to specify whether to include the full content of the documents in the response.
Default:
falseParameter to specify whether to include the specified end key in the result.
Default:
trueParameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Examples:10Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740991
Default:
0Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
falseSchema 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 for compressed attachments. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include attachment content in included document content or only the attachment metadata. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include a list of conflicted revisions in each returned document. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to return the documents in descending by key order.
Default:
falseParameter to specify whether to include the full content of the documents in the response.
Default:
falseParameter to specify whether to include the specified end key in the result.
Default:
trueParameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Examples:10Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740991
Default:
0Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
falseSchema 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 for compressed attachments. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include attachment content in included document content or only the attachment metadata. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include a list of conflicted revisions in each returned document. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to return the documents in descending by key order.
Default:
falseParameter to specify whether to include the full content of the documents in the response.
Default:
falseParameter to specify whether to include the specified end key in the result.
Default:
trueParameter 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 ≤ 9007199254740991
Default:
0Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
falseSchema 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 for compressed attachments. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include attachment content in included document content or only the attachment metadata. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include a list of conflicted revisions in each returned document. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to return the documents in descending by key order.
Default:
falseParameter to specify whether to include the full content of the documents in the response.
Default:
falseParameter to specify whether to include the specified end key in the result.
Default:
trueParameter 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 ≤ 9007199254740991
Default:
0Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
falseSchema 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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X POST "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/users/_design_docs" -H "Content-Type: application/json" --data '{ "descending": 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.SetDescending(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() .descending(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({ descending: true, db: 'users' }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.post_design_docs( descending=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 ≤ 9007199254740991
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
^([1-9]\d*-[A-Za-z0-9-_]+)$
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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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_docsstyle view.- Value
If
truethen 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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_docsstyle view.- value
If
truethen 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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_docsstyle view.- value
If
truethen 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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_docsstyle view.- value
If
truethen 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
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,
) -> DetailedResponseRequest
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_docsrequest.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_docsrequest.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 for compressed attachments. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include attachment content in included document content or only the attachment metadata. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include a list of conflicted revisions in each returned document. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to return the documents in descending by key order.
Default:
falseParameter to specify whether to include the full content of the documents in the response.
Default:
falseParameter to specify whether to include the specified end key in the result.
Default:
trueParameter 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 ≤ 9007199254740991
Default:
0Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
falseSchema 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_docsrequest.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 for compressed attachments. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include attachment content in included document content or only the attachment metadata. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include a list of conflicted revisions in each returned document. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to return the documents in descending by key order.
Default:
falseParameter to specify whether to include the full content of the documents in the response.
Default:
falseParameter to specify whether to include the specified end key in the result.
Default:
trueParameter 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 ≤ 9007199254740991
Default:
0Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
falseSchema 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_docsrequest.Possible values: 1 ≤ number of items ≤ 65535
Examples:- queries
Parameter to specify whether to include the encoding information for compressed attachments. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include attachment content in included document content or only the attachment metadata. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include a list of conflicted revisions in each returned document. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to return the documents in descending by key order.
Default:
falseParameter to specify whether to include the full content of the documents in the response.
Default:
falseParameter to specify whether to include the specified end key in the result.
Default:
trueParameter 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 ≤ 9007199254740991
Default:
0Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
falseSchema 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_docsrequest.Possible values: 1 ≤ number of items ≤ 65535
Examples:- queries
Parameter to specify whether to include the encoding information for compressed attachments. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include attachment content in included document content or only the attachment metadata. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include a list of conflicted revisions in each returned document. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to return the documents in descending by key order.
Default:
falseParameter to specify whether to include the full content of the documents in the response.
Default:
falseParameter to specify whether to include the specified end key in the result.
Default:
trueParameter 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 ≤ 9007199254740991
Default:
0Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
falseSchema 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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X POST "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/users/_design_docs/queries" -H "Content-Type: application/json" --data '{ "queries": [ { "descending": true, "include_docs": true, "limit": 10 }, { "inclusive_end": true, "start_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), StartKey: 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) .startKey("_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, startKey: '_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, start_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_docsrequest.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_docsrequest.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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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_docsstyle view.- Value
If
truethen 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
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_docsrequest.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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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_docsstyle view.- value
If
truethen 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
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_docsrequest.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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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_docsstyle view.- value
If
truethen 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
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_docsrequest.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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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_docsstyle view.- value
If
truethen 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
Status Code
HTTP response for
/_all_docs/queriesstyle 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 for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of conflicted revisions in each returned document. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to return rows in descending by key order.
Default:
falseQuery 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 stop returning rows at the specified document ID. No effect if using
groupor not providing end key.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_levelparameter.Default:
falseQuery 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:
falseQuery parameter to specify whether the specified end key should be included in the result.
Default:
trueQuery parameter to specify to return only rows 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 rows 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. A default
reduceview type can be disabled to behave like amapby settingreduce=falseexplicitly. Be aware thatinclude_docs=trueis only formapviews. Reduced views do not include document IDs in view rows.Default:
trueQuery parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740991
Default:
0Query 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:
trueQuery parameter to specify whether use the same replica of the index on each request. The default value
falsecontacts all replicas and returns the result from the first, fastest, responder. Setting it totruewhen used in conjunction withupdate=falsemay 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
trueis discouraged and is strictly not recommended when usingupdate=true.Default:
falseNote:
staleis deprecated, usestableandupdateinstead.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.
okis equivalent tostable=true&update=falseupdate_afteris equivalent tostable=true&update=lazy
For more details on the use cases of
stale,update, andstableparameters, 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 start returning rows at the specified document ID. No effect if using
groupor not providing start key.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:
trueQuery 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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/users/_design/allusers/_view/getVerifiedEmails?limit=10"This example requires the
getVerifiedEmailsview 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 ≤ 9007199254740991
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 therowsarray.Possible values: 0 ≤ value ≤ 4294967295
Current update sequence for the database
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([1-9]\d*-[A-Za-z0-9-_]+)$
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" }
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,
) -> DetailedResponsepost_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,
) -> DetailedResponseRequest
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 for compressed attachments. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include attachment content in included document content or only the attachment metadata. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include a list of conflicted revisions in each returned document. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to return the documents in descending by key order.
Default:
falseParameter to specify whether to include the full content of the documents in the response.
Default:
falseParameter to specify whether to include the specified end key in the result.
Default:
trueParameter 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 ≤ 9007199254740991
Default:
0Query 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 false.
Default:
trueParameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
falseSchema for any JSON type
Stop returning rows at the specified document ID. No effect if using
groupor not providing end key.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_levelparameter.Default:
falseParameter 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
Parameter to specify to return only rows that match the specified key. String representation of any JSON type that matches the key type emitted by the view function.
Parameter to specify returning only rows 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
reduceview type can be disabled to behave like amapby settingreduce=falseexplicitly.Be aware that
include_docs=trueis only formapviews. Reduced views do not include document IDs in view rows.Default:
trueQuery parameter to specify whether use the same replica of the index on each request. The default value
falsecontacts all replicas and returns the result from the first, fastest, responder. Setting it totruewhen used in conjunction withupdate=falsemay 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
trueis discouraged and is strictly not recommended when usingupdate=true.Default:
falseSchema for any JSON type
Start returning rows at the specified document ID. No effect if using
groupor not providing start key.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 for compressed attachments. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include attachment content in included document content or only the attachment metadata. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include a list of conflicted revisions in each returned document. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to return the documents in descending by key order.
Default:
falseParameter to specify whether to include the full content of the documents in the response.
Default:
falseExamples:trueParameter to specify whether to include the specified end key in the result.
Default:
trueParameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Examples:10Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740991
Default:
0Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
falseSchema for any JSON type.
Stop returning rows at the specified document ID. No effect if using
groupor not providing end key.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_levelparameter.Default:
falseParameter 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
Parameter to specify to return only rows that match the specified key. String representation of any JSON type that matches the key type emitted by the view function.
Parameter to specify returning only rows 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
reduceview type can be disabled to behave like amapby settingreduce=falseexplicitly.Be aware that
include_docs=trueis only formapviews. Reduced views do not include document IDs in view rows.Default:
trueQuery parameter to specify whether use the same replica of the index on each request. The default value
falsecontacts all replicas and returns the result from the first, fastest, responder. Setting it totruewhen used in conjunction withupdate=falsemay 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
trueis discouraged and is strictly not recommended when usingupdate=true.Default:
falseSchema for any JSON type.
Start returning rows at the specified document ID. No effect if using
groupor not providing start key.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 for compressed attachments. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include attachment content in included document content or only the attachment metadata. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include a list of conflicted revisions in each returned document. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to return the documents in descending by key order.
Default:
falseParameter to specify whether to include the full content of the documents in the response.
Default:
falseExamples:trueParameter to specify whether to include the specified end key in the result.
Default:
trueParameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Examples:10Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740991
Default:
0Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
falseSchema for any JSON type.
Stop returning rows at the specified document ID. No effect if using
groupor not providing end key.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_levelparameter.Default:
falseParameter 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
Parameter to specify to return only rows that match the specified key. String representation of any JSON type that matches the key type emitted by the view function.
Parameter to specify returning only rows 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
reduceview type can be disabled to behave like amapby settingreduce=falseexplicitly.Be aware that
include_docs=trueis only formapviews. Reduced views do not include document IDs in view rows.Default:
trueQuery parameter to specify whether use the same replica of the index on each request. The default value
falsecontacts all replicas and returns the result from the first, fastest, responder. Setting it totruewhen used in conjunction withupdate=falsemay 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
trueis discouraged and is strictly not recommended when usingupdate=true.Default:
falseSchema for any JSON type.
Start returning rows at the specified document ID. No effect if using
groupor not providing start key.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 for compressed attachments. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include attachment content in included document content or only the attachment metadata. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include a list of conflicted revisions in each returned document. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to return the documents in descending by key order.
Default:
falseParameter to specify whether to include the full content of the documents in the response.
Default:
falseExamples:Parameter to specify whether to include the specified end key in the result.
Default:
trueParameter 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 ≤ 9007199254740991
Default:
0Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
falseSchema for any JSON type.
Stop returning rows at the specified document ID. No effect if using
groupor not providing end key.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_levelparameter.Default:
falseParameter 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
Parameter to specify to return only rows that match the specified key. String representation of any JSON type that matches the key type emitted by the view function.
Parameter to specify returning only rows 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
reduceview type can be disabled to behave like amapby settingreduce=falseexplicitly.Be aware that
include_docs=trueis only formapviews. Reduced views do not include document IDs in view rows.Default:
trueQuery parameter to specify whether use the same replica of the index on each request. The default value
falsecontacts all replicas and returns the result from the first, fastest, responder. Setting it totruewhen used in conjunction withupdate=falsemay 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
trueis discouraged and is strictly not recommended when usingupdate=true.Default:
falseSchema for any JSON type.
Start returning rows at the specified document ID. No effect if using
groupor not providing start key.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 for compressed attachments. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include attachment content in included document content or only the attachment metadata. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include a list of conflicted revisions in each returned document. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to return the documents in descending by key order.
Default:
falseParameter to specify whether to include the full content of the documents in the response.
Default:
falseExamples:Parameter to specify whether to include the specified end key in the result.
Default:
trueParameter 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 ≤ 9007199254740991
Default:
0Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
falseSchema for any JSON type.
Stop returning rows at the specified document ID. No effect if using
groupor not providing end key.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_levelparameter.Default:
falseParameter 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
Parameter to specify to return only rows that match the specified key. String representation of any JSON type that matches the key type emitted by the view function.
Parameter to specify returning only rows 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
reduceview type can be disabled to behave like amapby settingreduce=falseexplicitly.Be aware that
include_docs=trueis only formapviews. Reduced views do not include document IDs in view rows.Default:
trueQuery parameter to specify whether use the same replica of the index on each request. The default value
falsecontacts all replicas and returns the result from the first, fastest, responder. Setting it totruewhen used in conjunction withupdate=falsemay 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
trueis discouraged and is strictly not recommended when usingupdate=true.Default:
falseSchema for any JSON type.
Start returning rows at the specified document ID. No effect if using
groupor not providing start key.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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X POST "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/users/_design/allusers/_view/getVerifiedEmails" -H "Content-Type: application/json" --data '{ "limit": 10 }'This example requires the
getVerifiedEmailsview 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
getVerifiedEmailsview 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
getVerifiedEmailsview 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
getVerifiedEmailsview 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
getVerifiedEmailsview 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 ≤ 9007199254740991
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 therowsarray.Possible values: 0 ≤ value ≤ 4294967295
Current update sequence for the database
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([1-9]\d*-[A-Za-z0-9-_]+)$
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 therowsarray.Possible values: 0 ≤ value ≤ 4294967295
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 therowsarray.Possible values: 0 ≤ value ≤ 4294967295
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 therowsarray.Possible values: 0 ≤ value ≤ 4294967295
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 therowsarray.Possible values: 0 ≤ value ≤ 4294967295
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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,
) -> DetailedResponsepost_view_queries_as_stream(
self,
db: str,
ddoc: str,
view: str,
queries: List['ViewQuery'],
**kwargs,
) -> DetailedResponseRequest
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 for compressed attachments. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include attachment content in included document content or only the attachment metadata. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include a list of conflicted revisions in each returned document. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to return the documents in descending by key order.
Default:
falseParameter to specify whether to include the full content of the documents in the response.
Default:
falseParameter to specify whether to include the specified end key in the result.
Default:
trueParameter 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 ≤ 9007199254740991
Default:
0Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
falseSchema for any JSON type.
Stop returning rows at the specified document ID. No effect if using
groupor not providing end key.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_levelparameter.Default:
falseParameter 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
Parameter to specify to return only rows that match the specified key. String representation of any JSON type that matches the key type emitted by the view function.
Parameter to specify returning only rows 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
reduceview type can be disabled to behave like amapby settingreduce=falseexplicitly.Be aware that
include_docs=trueis only formapviews. Reduced views do not include document IDs in view rows.Default:
trueQuery parameter to specify whether use the same replica of the index on each request. The default value
falsecontacts all replicas and returns the result from the first, fastest, responder. Setting it totruewhen used in conjunction withupdate=falsemay 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
trueis discouraged and is strictly not recommended when usingupdate=true.Default:
falseSchema for any JSON type.
Start returning rows at the specified document ID. No effect if using
groupor not providing start key.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 for compressed attachments. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include attachment content in included document content or only the attachment metadata. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include a list of conflicted revisions in each returned document. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to return the documents in descending by key order.
Default:
falseParameter to specify whether to include the full content of the documents in the response.
Default:
falseParameter to specify whether to include the specified end key in the result.
Default:
trueParameter 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 ≤ 9007199254740991
Default:
0Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
falseSchema for any JSON type.
Stop returning rows at the specified document ID. No effect if using
groupor not providing end key.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_levelparameter.Default:
falseParameter 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
Parameter to specify to return only rows that match the specified key. String representation of any JSON type that matches the key type emitted by the view function.
Parameter to specify returning only rows 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
reduceview type can be disabled to behave like amapby settingreduce=falseexplicitly.Be aware that
include_docs=trueis only formapviews. Reduced views do not include document IDs in view rows.Default:
trueQuery parameter to specify whether use the same replica of the index on each request. The default value
falsecontacts all replicas and returns the result from the first, fastest, responder. Setting it totruewhen used in conjunction withupdate=falsemay 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
trueis discouraged and is strictly not recommended when usingupdate=true.Default:
falseSchema for any JSON type.
Start returning rows at the specified document ID. No effect if using
groupor not providing start key.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 for compressed attachments. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include attachment content in included document content or only the attachment metadata. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include a list of conflicted revisions in each returned document. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to return the documents in descending by key order.
Default:
falseParameter to specify whether to include the full content of the documents in the response.
Default:
falseParameter to specify whether to include the specified end key in the result.
Default:
trueParameter 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 ≤ 9007199254740991
Default:
0Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
falseSchema for any JSON type.
Stop returning rows at the specified document ID. No effect if using
groupor not providing end key.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_levelparameter.Default:
falseParameter 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
Parameter to specify to return only rows that match the specified key. String representation of any JSON type that matches the key type emitted by the view function.
Parameter to specify returning only rows 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
reduceview type can be disabled to behave like amapby settingreduce=falseexplicitly.Be aware that
include_docs=trueis only formapviews. Reduced views do not include document IDs in view rows.Default:
trueQuery parameter to specify whether use the same replica of the index on each request. The default value
falsecontacts all replicas and returns the result from the first, fastest, responder. Setting it totruewhen used in conjunction withupdate=falsemay 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
trueis discouraged and is strictly not recommended when usingupdate=true.Default:
falseSchema for any JSON type.
Start returning rows at the specified document ID. No effect if using
groupor not providing start key.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 for compressed attachments. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include attachment content in included document content or only the attachment metadata. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include a list of conflicted revisions in each returned document. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to return the documents in descending by key order.
Default:
falseParameter to specify whether to include the full content of the documents in the response.
Default:
falseParameter to specify whether to include the specified end key in the result.
Default:
trueParameter 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 ≤ 9007199254740991
Default:
0Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
falseSchema for any JSON type.
Stop returning rows at the specified document ID. No effect if using
groupor not providing end key.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_levelparameter.Default:
falseParameter 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
Parameter to specify to return only rows that match the specified key. String representation of any JSON type that matches the key type emitted by the view function.
Parameter to specify returning only rows 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
reduceview type can be disabled to behave like amapby settingreduce=falseexplicitly.Be aware that
include_docs=trueis only formapviews. Reduced views do not include document IDs in view rows.Default:
trueQuery parameter to specify whether use the same replica of the index on each request. The default value
falsecontacts all replicas and returns the result from the first, fastest, responder. Setting it totruewhen used in conjunction withupdate=falsemay 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
trueis discouraged and is strictly not recommended when usingupdate=true.Default:
falseSchema for any JSON type.
Start returning rows at the specified document ID. No effect if using
groupor not providing start key.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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X POST "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/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
getVerifiedEmailsview 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
getVerifiedEmailsview 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
getVerifiedEmailsview 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
getVerifiedEmailsview 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
getVerifiedEmailsview 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 therowsarray.Possible values: 0 ≤ value ≤ 4294967295
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 therowsarray.Possible values: 0 ≤ value ≤ 4294967295
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 therowsarray.Possible values: 0 ≤ value ≤ 4294967295
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 therowsarray.Possible values: 0 ≤ value ≤ 4294967295
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to return rows in descending by key order.
Default:
falseQuery 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 stop returning rows at the specified document ID. No effect if using
groupor not providing end key.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_levelparameter.Default:
falseQuery 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:
falseQuery parameter to specify whether the specified end key should be included in the result.
Default:
trueQuery parameter to specify to return only rows 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 rows 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. A default
reduceview type can be disabled to behave like amapby settingreduce=falseexplicitly. Be aware thatinclude_docs=trueis only formapviews. Reduced views do not include document IDs in view rows.Default:
trueQuery parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740991
Default:
0Query 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:
trueQuery 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 start returning rows at the specified document ID. No effect if using
groupor not providing start key.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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/products/_partition/small-appliances/_design/appliances/_view/byApplianceProdId?include_docs=true&limit=10"This example requires the
byApplianceProdIdpartitioned 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 ≤ 9007199254740991
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 therowsarray.Possible values: 0 ≤ value ≤ 4294967295
Current update sequence for the database
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([1-9]\d*-[A-Za-z0-9-_]+)$
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 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,
) -> DetailedResponseRequest
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
$eqoperator 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$regexcannot 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:
trueOpaque 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=trueis 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: textindexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740991
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:
trueUse 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_fallbacktofalseand the server responds instead with a400status 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
$eqoperator 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$regexcannot 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:
trueOpaque 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=trueis 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: textindexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25Examples:3Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740991
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:
trueUse 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_fallbacktofalseand the server responds instead with a400status 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
$eqoperator 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$regexcannot 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:
trueOpaque 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=trueis 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: textindexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25Examples:3Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740991
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:
trueUse 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_fallbacktofalseand the server responds instead with a400status 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
$eqoperator 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$regexcannot 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:
trueOpaque 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=trueis 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: textindexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25Examples:Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740991
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:
trueUse 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_fallbacktofalseand the server responds instead with a400status 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
$eqoperator 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$regexcannot 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:
trueOpaque 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=trueis 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: textindexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25Examples:Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740991
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:
trueUse 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_fallbacktofalseand the server responds instead with a400status 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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X POST "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/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
$eqoperator 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$regexcannot 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 ≤ 9007199254740991
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
jsonortextquery index definition. Indexes of typetexthave additional configuration properties that do not apply tojsonindexes, 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
$textoperator.- 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
nameproperty of the field name and atypeproperty 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
$sizeoperator. * 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
$eqoperator 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$regexcannot 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
jsonortextquery index definition. Indexes of typetexthave additional configuration properties that do not apply tojsonindexes, 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
$textoperator.- 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
nameproperty of the field name and atypeproperty 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
$sizeoperator. * 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
$eqoperator 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$regexcannot 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 ≤ 9007199254740991
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
$eqoperator 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$regexcannot 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 ≤ 9007199254740991
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
jsonortextquery index definition. Indexes of typetexthave additional configuration properties that do not apply tojsonindexes, 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
$textoperator.- 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
nameproperty of the field name and atypeproperty 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
$sizeoperator. * 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
$eqoperator 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$regexcannot 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
jsonortextquery index definition. Indexes of typetexthave additional configuration properties that do not apply tojsonindexes, 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
$textoperator.- 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
nameproperty of the field name and atypeproperty 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
$sizeoperator. * 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
$eqoperator 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$regexcannot 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 ≤ 9007199254740991
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
$eqoperator 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$regexcannot 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 ≤ 9007199254740991
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
jsonortextquery index definition. Indexes of typetexthave additional configuration properties that do not apply tojsonindexes, 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
$textoperator.- 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
nameproperty of the field name and atypeproperty 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
$sizeoperator. * 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
$eqoperator 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$regexcannot 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
jsonortextquery index definition. Indexes of typetexthave additional configuration properties that do not apply tojsonindexes, 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
$textoperator.- 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
nameproperty of the field name and atypeproperty 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
$sizeoperator. * 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
$eqoperator 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$regexcannot 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 ≤ 9007199254740991
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
$eqoperator 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$regexcannot 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 ≤ 9007199254740991
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
jsonortextquery index definition. Indexes of typetexthave additional configuration properties that do not apply tojsonindexes, 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
$textoperator.- 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
nameproperty of the field name and atypeproperty 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
$sizeoperator. * 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
$eqoperator 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$regexcannot 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
jsonortextquery index definition. Indexes of typetexthave additional configuration properties that do not apply tojsonindexes, 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
$textoperator.- 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
nameproperty of the field name and atypeproperty 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
$sizeoperator. * 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
$eqoperator 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$regexcannot 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 ≤ 9007199254740991
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
$eqoperator 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$regexcannot 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 ≤ 9007199254740991
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,
) -> DetailedResponsepost_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,
) -> DetailedResponseRequest
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
$eqoperator 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$regexcannot 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:
trueOpaque 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=trueis 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: textindexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740991
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:
trueUse 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_fallbacktofalseand the server responds instead with a400status 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
$eqoperator 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$regexcannot 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:
trueOpaque 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=trueis 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: textindexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25Examples:3Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740991
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:
trueUse 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_fallbacktofalseand the server responds instead with a400status 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
$eqoperator 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$regexcannot 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:
trueOpaque 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=trueis 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: textindexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25Examples:3Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740991
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:
trueUse 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_fallbacktofalseand the server responds instead with a400status 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
$eqoperator 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$regexcannot 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:
trueOpaque 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=trueis 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: textindexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25Examples:Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740991
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:
trueUse 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_fallbacktofalseand the server responds instead with a400status 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
$eqoperator 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$regexcannot 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:
trueOpaque 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=trueis 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: textindexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25Examples:Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740991
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:
trueUse 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_fallbacktofalseand the server responds instead with a400status 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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X POST "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/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
getUserByEmailCloudant Query "json" index to exist. To create the index, see Create a new index on a database.curl -H "Authorization: Bearer A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X POST "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/users/_find" -H "Content-Type: application/json" --data '{ "fields": ["_id", "type", "name", "email", "address"], "limit": 3, "selector": { "address": { "$exists": true } } }'This example requires the
getUserByAddressCloudant 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
getUserByEmailCloudant 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]boolean{ "$exists": true, }, }, ) 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
getUserByAddressCloudant 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
getUserByEmailCloudant 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("$exists", true)); 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
getUserByAddressCloudant 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
getUserByEmailCloudant 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: { '$exists': true } }; service.postFind({ db: 'users', selector: selector, fields: ['_id', 'type', 'name', 'email', 'address'], limit: 3 }).then(response => { console.log(response.result); });This example requires the
getUserByAddressCloudant 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
getUserByEmailCloudant 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': {'$exists': True}}, fields=["_id", "type", "name", "email", "address"], limit=3 ).get_result() print(response)This example requires the
getUserByAddressCloudant 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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 ≤ 9007199254740991
Number of rows scanned in the index.
Possible values: 0 ≤ value ≤ 9007199254740991
Number of documents fetched from the primary index with the specified read quorum.
Possible values: 0 ≤ value ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 ≤ 9007199254740991
Number of rows scanned in the index.
Possible values: 0 ≤ value ≤ 9007199254740991
Number of documents fetched from the primary index with the specified read quorum.
Possible values: 0 ≤ value ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 ≤ 9007199254740991
Number of rows scanned in the index.
Possible values: 0 ≤ value ≤ 9007199254740991
Number of documents fetched from the primary index with the specified read quorum.
Possible values: 0 ≤ value ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 ≤ 9007199254740991
Number of rows scanned in the index.
Possible values: 0 ≤ value ≤ 9007199254740991
Number of documents fetched from the primary index with the specified read quorum.
Possible values: 0 ≤ value ≤ 9007199254740991
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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/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 ≤ 9007199254740991
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
jsonortextquery index definition. Indexes of typetexthave additional configuration properties that do not apply tojsonindexes, 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
$textoperator.- 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
nameproperty of the field name and atypeproperty 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
$sizeoperator. * 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
$eqoperator 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$regexcannot 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
jsonortextquery index definition. Indexes of typetexthave additional configuration properties that do not apply tojsonindexes, 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
$textoperator.- 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
nameproperty of the field name and atypeproperty 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
$sizeoperator. * 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
$eqoperator 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$regexcannot 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
jsonortextquery index definition. Indexes of typetexthave additional configuration properties that do not apply tojsonindexes, 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
$textoperator.- 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
nameproperty of the field name and atypeproperty 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
$sizeoperator. * 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
$eqoperator 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$regexcannot 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
jsonortextquery index definition. Indexes of typetexthave additional configuration properties that do not apply tojsonindexes, 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
$textoperator.- 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
nameproperty of the field name and atypeproperty 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
$sizeoperator. * 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
$eqoperator 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$regexcannot 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}/_indexstyle 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" }
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,
) -> DetailedResponseRequest
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
jsonortextquery index definition. Indexes of typetexthave additional configuration properties that do not apply tojsonindexes, 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
truefor databases withpartitioned: trueandfalseotherwise. For databases withpartitioned: falseif 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
jsonortextquery index definition. Indexes of typetexthave additional configuration properties that do not apply tojsonindexes, 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
$textoperator.- 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
nameproperty of the field name and atypeproperty 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
$sizeoperator. * 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
$eqoperator 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$regexcannot 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
truefor databases withpartitioned: trueandfalseotherwise. For databases withpartitioned: falseif 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
jsonortextquery index definition. Indexes of typetexthave additional configuration properties that do not apply tojsonindexes, 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
$textoperator.- 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
nameproperty of the field name and atypeproperty 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
$sizeoperator. * 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
$eqoperator 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$regexcannot 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
truefor databases withpartitioned: trueandfalseotherwise. For databases withpartitioned: falseif 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
jsonortextquery index definition. Indexes of typetexthave additional configuration properties that do not apply tojsonindexes, 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
$textoperator.- 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
nameproperty of the field name and atypeproperty 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
$sizeoperator. * 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
$eqoperator 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$regexcannot 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
truefor databases withpartitioned: trueandfalseotherwise. For databases withpartitioned: falseif 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
jsonortextquery index definition. Indexes of typetexthave additional configuration properties that do not apply tojsonindexes, 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
$textoperator.- 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
nameproperty of the field name and atypeproperty 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
$sizeoperator. * 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
$eqoperator 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$regexcannot 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
truefor databases withpartitioned: trueandfalseotherwise. For databases withpartitioned: falseif 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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X POST "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X POST "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/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. indexField := cloudantv1.IndexField{ Name: core.StringPtr("address"), Type: core.StringPtr(cloudantv1.IndexFieldTypeStringConst), } 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() .name("address") .type(IndexField.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: CloudantV1.IndexField.Constants.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=IndexField.TypeEnum.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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X DELETE "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/users/_index/_design/json-index/json/getUserByName"This example will fail if
getUserByNameindex 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
getUserByNameindex 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
getUserByNameindex 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
getUserByNameindex 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
getUserByNameindex 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,
) -> DetailedResponseAuditing
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
$eqoperator 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$regexcannot 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:
trueOpaque 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=trueis 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: textindexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740991
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:
trueUse 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_fallbacktofalseand the server responds instead with a400status 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
$eqoperator 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$regexcannot 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:
trueOpaque 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=trueis 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: textindexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740991
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:
trueUse 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_fallbacktofalseand the server responds instead with a400status 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
$eqoperator 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$regexcannot 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:
trueOpaque 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=trueis 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: textindexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740991
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:
trueUse 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_fallbacktofalseand the server responds instead with a400status 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
$eqoperator 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$regexcannot 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:
trueOpaque 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=trueis 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: textindexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740991
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:
trueUse 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_fallbacktofalseand the server responds instead with a400status 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
$eqoperator 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$regexcannot 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:
trueOpaque 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=trueis 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: textindexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740991
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:
trueUse 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_fallbacktofalseand the server responds instead with a400status 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
$eqoperator 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$regexcannot 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 ≤ 9007199254740991
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
jsonortextquery index definition. Indexes of typetexthave additional configuration properties that do not apply tojsonindexes, 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
$textoperator.- 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
nameproperty of the field name and atypeproperty 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
$sizeoperator. * 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
$eqoperator 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$regexcannot 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
jsonortextquery index definition. Indexes of typetexthave additional configuration properties that do not apply tojsonindexes, 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
$textoperator.- 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
nameproperty of the field name and atypeproperty 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
$sizeoperator. * 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
$eqoperator 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$regexcannot 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 ≤ 9007199254740991
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
$eqoperator 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$regexcannot 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 ≤ 9007199254740991
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
jsonortextquery index definition. Indexes of typetexthave additional configuration properties that do not apply tojsonindexes, 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
$textoperator.- 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
nameproperty of the field name and atypeproperty 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
$sizeoperator. * 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
$eqoperator 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$regexcannot 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
jsonortextquery index definition. Indexes of typetexthave additional configuration properties that do not apply tojsonindexes, 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
$textoperator.- 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
nameproperty of the field name and atypeproperty 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
$sizeoperator. * 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
$eqoperator 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$regexcannot 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 ≤ 9007199254740991
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
$eqoperator 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$regexcannot 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 ≤ 9007199254740991
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
jsonortextquery index definition. Indexes of typetexthave additional configuration properties that do not apply tojsonindexes, 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
$textoperator.- 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
nameproperty of the field name and atypeproperty 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
$sizeoperator. * 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
$eqoperator 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$regexcannot 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
jsonortextquery index definition. Indexes of typetexthave additional configuration properties that do not apply tojsonindexes, 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
$textoperator.- 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
nameproperty of the field name and atypeproperty 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
$sizeoperator. * 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
$eqoperator 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$regexcannot 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 ≤ 9007199254740991
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
$eqoperator 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$regexcannot 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 ≤ 9007199254740991
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
jsonortextquery index definition. Indexes of typetexthave additional configuration properties that do not apply tojsonindexes, 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
$textoperator.- 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
nameproperty of the field name and atypeproperty 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
$sizeoperator. * 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
$eqoperator 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$regexcannot 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
jsonortextquery index definition. Indexes of typetexthave additional configuration properties that do not apply tojsonindexes, 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
$textoperator.- 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
nameproperty of the field name and atypeproperty 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
$sizeoperator. * 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
$eqoperator 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$regexcannot 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 ≤ 9007199254740991
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
$eqoperator 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$regexcannot 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 ≤ 9007199254740991
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,
) -> DetailedResponsepost_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,
) -> DetailedResponseAuditing
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
$eqoperator 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$regexcannot 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:
trueOpaque 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=trueis 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: textindexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740991
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:
trueUse 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_fallbacktofalseand the server responds instead with a400status 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
$eqoperator 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$regexcannot 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:
trueOpaque 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=trueis 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: textindexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740991
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:
trueUse 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_fallbacktofalseand the server responds instead with a400status 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
$eqoperator 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$regexcannot 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:
trueOpaque 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=trueis 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: textindexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740991
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:
trueUse 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_fallbacktofalseand the server responds instead with a400status 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
$eqoperator 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$regexcannot 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:
trueOpaque 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=trueis 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: textindexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740991
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:
trueUse 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_fallbacktofalseand the server responds instead with a400status 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
$eqoperator 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$regexcannot 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:
trueOpaque 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=trueis 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: textindexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740991
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:
trueUse 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_fallbacktofalseand the server responds instead with a400status 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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X POST "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 ≤ 9007199254740991
Number of rows scanned in the index.
Possible values: 0 ≤ value ≤ 9007199254740991
Number of documents fetched from the primary index with the specified read quorum.
Possible values: 0 ≤ value ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 ≤ 9007199254740991
Number of rows scanned in the index.
Possible values: 0 ≤ value ≤ 9007199254740991
Number of documents fetched from the primary index with the specified read quorum.
Possible values: 0 ≤ value ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 ≤ 9007199254740991
Number of rows scanned in the index.
Possible values: 0 ≤ value ≤ 9007199254740991
Number of documents fetched from the primary index with the specified read quorum.
Possible values: 0 ≤ value ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 ≤ 9007199254740991
Number of rows scanned in the index.
Possible values: 0 ≤ value ≤ 9007199254740991
Number of documents fetched from the primary index with the specified read quorum.
Possible values: 0 ≤ value ≤ 9007199254740991
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 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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X POST "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/_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: number of items = 2
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:
1Query parameter to specify the number of characters in each fragment for highlights.
Possible values: 1 ≤ value ≤ 1048521
Default:
100Query parameter to specify whether to include the full content of the documents in the response.
Default:
falseQuery 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:trueoption. 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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/users/_design/allusers/_search/activeUsers?query=name:Jane*%20AND%20active:True"This example requires the
activeUsersCloudant 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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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" }
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,
) -> DetailedResponsepost_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,
) -> DetailedResponseRequest
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:
1A 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:
100Include the full content of the documents in the return.
Default:
falseA 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: number of items = 2
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:
1A 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:
100Include the full content of the documents in the return.
Default:
falseA 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:3Specifies 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: number of items = 2
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:
1A 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:
100Include the full content of the documents in the return.
Default:
falseA 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:3Specifies 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: number of items = 2
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:
1A 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:
100Include the full content of the documents in the return.
Default:
falseA 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: number of items = 2
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:
1A 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:
100Include the full content of the documents in the return.
Default:
falseA 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: number of items = 2
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X POST "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/users/_design/allusers/_search/activeUsers" --data '{ "query": "name:Jane* AND active:True" }'This example requires the
activeUsersCloudant 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
activeUsersCloudant 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
activeUsersCloudant 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
activeUsersCloudant 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
activeUsersCloudant 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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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,
) -> DetailedResponseRequest
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/products/_design/appliances/_search_info/findByPrice"This example requires the
findByPriceCloudant 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
findByDateCloudant 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
findByDateCloudant 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
findByDateCloudant 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
findByDateCloudant 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 ≤ 9007199254740991
The size of the search index on disk.
Possible values: 0 ≤ value ≤ 9007199254740991
The count of the number of indexed documents.
Possible values: 0 ≤ value ≤ 9007199254740991
The number of deleted documents.
Possible values: 0 ≤ value ≤ 9007199254740991
The pending sequence identifier.
Possible values: 0 ≤ value ≤ 9007199254740991
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 ≤ 9007199254740991
The size of the search index on disk.
Possible values: 0 ≤ value ≤ 9007199254740991
The count of the number of indexed documents.
Possible values: 0 ≤ value ≤ 9007199254740991
The number of deleted documents.
Possible values: 0 ≤ value ≤ 9007199254740991
The pending sequence identifier.
Possible values: 0 ≤ value ≤ 9007199254740991
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 ≤ 9007199254740991
The size of the search index on disk.
Possible values: 0 ≤ value ≤ 9007199254740991
The count of the number of indexed documents.
Possible values: 0 ≤ value ≤ 9007199254740991
The number of deleted documents.
Possible values: 0 ≤ value ≤ 9007199254740991
The pending sequence identifier.
Possible values: 0 ≤ value ≤ 9007199254740991
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 ≤ 9007199254740991
The size of the search index on disk.
Possible values: 0 ≤ value ≤ 9007199254740991
The count of the number of indexed documents.
Possible values: 0 ≤ value ≤ 9007199254740991
The number of deleted documents.
Possible values: 0 ≤ value ≤ 9007199254740991
The pending sequence identifier.
Possible values: 0 ≤ value ≤ 9007199254740991
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" }
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:
1Query parameter to specify the number of characters in each fragment for highlights.
Possible values: 1 ≤ value ≤ 1048521
Default:
100Query parameter to specify whether to include the full content of the documents in the response.
Default:
falseQuery 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:trueoption. 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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/products/_partition/small-appliances/_design/appliances/_search/findByPrice?query=price:[14%20TO%2020]"This example requires the
findByPriceCloudant 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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
The uncompressed size of database contents in bytes.
Possible values: 0 ≤ value ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
The uncompressed size of database contents in bytes.
Possible values: 0 ≤ value ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
The uncompressed size of database contents in bytes.
Possible values: 0 ≤ value ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
The uncompressed size of database contents in bytes.
Possible values: 0 ≤ value ≤ 9007199254740991
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_docsRequest
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. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to return rows in descending by key order.
Default:
falseQuery 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 stop returning rows at the specified document ID. No effect if using
groupor not providing end key.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:
falseQuery parameter to specify whether the specified end key should be included in the result.
Default:
trueQuery parameter to specify to return only rows 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 rows 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 ≤ 9007199254740991
Default:
0Query 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 start returning rows at the specified document ID. No effect if using
groupor not providing start key.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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/events/_partition/ns1HJS13AMkK/_all_docs?include_docs=true"
Response
Schema for the result of an all documents operation.
Offset where the list started.
Possible values: 0 ≤ value ≤ 9007199254740991
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
^([1-9]\d*-[A-Za-z0-9-_]+)$
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" }
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,
) -> DetailedResponsepost_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,
) -> DetailedResponseRequest
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 for compressed attachments. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include attachment content in included document content or only the attachment metadata. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include a list of conflicted revisions in each returned document. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to return the documents in descending by key order.
Default:
falseParameter to specify whether to include the full content of the documents in the response.
Default:
falseParameter to specify whether to include the specified end key in the result.
Default:
trueParameter 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 ≤ 9007199254740991
Default:
0Query 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 false.
Default:
trueParameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
falseSchema 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 for compressed attachments. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include attachment content in included document content or only the attachment metadata. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include a list of conflicted revisions in each returned document. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to return the documents in descending by key order.
Default:
falseParameter to specify whether to include the full content of the documents in the response.
Default:
falseParameter to specify whether to include the specified end key in the result.
Default:
trueParameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Examples:10Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740991
Default:
0Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
falseSchema 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 for compressed attachments. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include attachment content in included document content or only the attachment metadata. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include a list of conflicted revisions in each returned document. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to return the documents in descending by key order.
Default:
falseParameter to specify whether to include the full content of the documents in the response.
Default:
falseParameter to specify whether to include the specified end key in the result.
Default:
trueParameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Examples:10Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740991
Default:
0Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
falseSchema 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 for compressed attachments. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include attachment content in included document content or only the attachment metadata. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include a list of conflicted revisions in each returned document. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to return the documents in descending by key order.
Default:
falseParameter to specify whether to include the full content of the documents in the response.
Default:
falseParameter to specify whether to include the specified end key in the result.
Default:
trueParameter 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 ≤ 9007199254740991
Default:
0Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
falseSchema 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 for compressed attachments. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include attachment content in included document content or only the attachment metadata. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include a list of conflicted revisions in each returned document. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to return the documents in descending by key order.
Default:
falseParameter to specify whether to include the full content of the documents in the response.
Default:
falseParameter to specify whether to include the specified end key in the result.
Default:
trueParameter 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 ≤ 9007199254740991
Default:
0Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
falseSchema 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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X POST "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/events/_partition/ns1HJS13AMkK/_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 ≤ 9007199254740991
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
^([1-9]\d*-[A-Za-z0-9-_]+)$
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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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_docsstyle view.- Value
If
truethen 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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_docsstyle view.- value
If
truethen 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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_docsstyle view.- value
If
truethen 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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_docsstyle view.- value
If
truethen 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
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:
1Query parameter to specify the number of characters in each fragment for highlights.
Possible values: 1 ≤ value ≤ 1048521
Default:
100Query parameter to specify whether to include the full content of the documents in the response.
Default:
falseQuery 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:trueoption. 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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/products/_partition/small-appliances/_design/appliances/_search/findByPrice?query=price:[14%20TO%2020]"This example requires the
findByPriceCloudant 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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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" }
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,
) -> DetailedResponsepost_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,
) -> DetailedResponseRequest
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:
1A 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:
100Include the full content of the documents in the return.
Default:
falseA 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:
1A 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:
100Include the full content of the documents in the return.
Default:
falseA 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:3Specifies 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:
1A 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:
100Include the full content of the documents in the return.
Default:
falseA 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:3Specifies 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:
1A 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:
100Include the full content of the documents in the return.
Default:
falseA 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:
1A 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:
100Include the full content of the documents in the return.
Default:
falseA 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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X POST "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/products/_partition/small-appliances/_design/appliances/_search/findByPrice" -H "Content-Type: application/json" --data '{ "query": "price:[14 TO 20]" }'This example requires the
findByPriceCloudant 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
findByDateCloudant 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
findByDateCloudant 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
findByDateCloudant 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
findByDateCloudant 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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to return rows in descending by key order.
Default:
falseQuery 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 stop returning rows at the specified document ID. No effect if using
groupor not providing end key.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_levelparameter.Default:
falseQuery 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:
falseQuery parameter to specify whether the specified end key should be included in the result.
Default:
trueQuery parameter to specify to return only rows 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 rows 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. A default
reduceview type can be disabled to behave like amapby settingreduce=falseexplicitly. Be aware thatinclude_docs=trueis only formapviews. Reduced views do not include document IDs in view rows.Default:
trueQuery parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740991
Default:
0Query 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:
trueQuery 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 start returning rows at the specified document ID. No effect if using
groupor not providing start key.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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/products/_partition/small-appliances/_design/appliances/_view/byApplianceProdId?include_docs=true&limit=10"This example requires the
byApplianceProdIdpartitioned 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 ≤ 9007199254740991
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 therowsarray.Possible values: 0 ≤ value ≤ 4294967295
Current update sequence for the database
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([1-9]\d*-[A-Za-z0-9-_]+)$
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" }
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,
) -> DetailedResponsepost_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,
) -> DetailedResponseRequest
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 for compressed attachments. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include attachment content in included document content or only the attachment metadata. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include a list of conflicted revisions in each returned document. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to return the documents in descending by key order.
Default:
falseParameter to specify whether to include the full content of the documents in the response.
Default:
falseParameter to specify whether to include the specified end key in the result.
Default:
trueParameter 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 ≤ 9007199254740991
Default:
0Query 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 false.
Default:
trueParameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
falseSchema for any JSON type
Stop returning rows at the specified document ID. No effect if using
groupor not providing end key.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_levelparameter.Default:
falseParameter 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
Parameter to specify to return only rows that match the specified key. String representation of any JSON type that matches the key type emitted by the view function.
Parameter to specify returning only rows 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
reduceview type can be disabled to behave like amapby settingreduce=falseexplicitly.Be aware that
include_docs=trueis only formapviews. Reduced views do not include document IDs in view rows.Default:
trueSchema for any JSON type
Start returning rows at the specified document ID. No effect if using
groupor not providing start key.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 for compressed attachments. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include attachment content in included document content or only the attachment metadata. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include a list of conflicted revisions in each returned document. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to return the documents in descending by key order.
Default:
falseParameter to specify whether to include the full content of the documents in the response.
Default:
falseExamples:trueParameter to specify whether to include the specified end key in the result.
Default:
trueParameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Examples:10Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740991
Default:
0Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
falseSchema for any JSON type.
Stop returning rows at the specified document ID. No effect if using
groupor not providing end key.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_levelparameter.Default:
falseParameter 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
Parameter to specify to return only rows that match the specified key. String representation of any JSON type that matches the key type emitted by the view function.
Parameter to specify returning only rows 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
reduceview type can be disabled to behave like amapby settingreduce=falseexplicitly.Be aware that
include_docs=trueis only formapviews. Reduced views do not include document IDs in view rows.Default:
trueSchema for any JSON type.
Start returning rows at the specified document ID. No effect if using
groupor not providing start key.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 for compressed attachments. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include attachment content in included document content or only the attachment metadata. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include a list of conflicted revisions in each returned document. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to return the documents in descending by key order.
Default:
falseParameter to specify whether to include the full content of the documents in the response.
Default:
falseExamples:trueParameter to specify whether to include the specified end key in the result.
Default:
trueParameter to specify the number of returned documents to limit the result to.
Possible values: 0 ≤ value ≤ 4294967295
Examples:10Parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740991
Default:
0Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
falseSchema for any JSON type.
Stop returning rows at the specified document ID. No effect if using
groupor not providing end key.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_levelparameter.Default:
falseParameter 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
Parameter to specify to return only rows that match the specified key. String representation of any JSON type that matches the key type emitted by the view function.
Parameter to specify returning only rows 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
reduceview type can be disabled to behave like amapby settingreduce=falseexplicitly.Be aware that
include_docs=trueis only formapviews. Reduced views do not include document IDs in view rows.Default:
trueSchema for any JSON type.
Start returning rows at the specified document ID. No effect if using
groupor not providing start key.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 for compressed attachments. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include attachment content in included document content or only the attachment metadata. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include a list of conflicted revisions in each returned document. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to return the documents in descending by key order.
Default:
falseParameter to specify whether to include the full content of the documents in the response.
Default:
falseExamples:Parameter to specify whether to include the specified end key in the result.
Default:
trueParameter 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 ≤ 9007199254740991
Default:
0Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
falseSchema for any JSON type.
Stop returning rows at the specified document ID. No effect if using
groupor not providing end key.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_levelparameter.Default:
falseParameter 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
Parameter to specify to return only rows that match the specified key. String representation of any JSON type that matches the key type emitted by the view function.
Parameter to specify returning only rows 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
reduceview type can be disabled to behave like amapby settingreduce=falseexplicitly.Be aware that
include_docs=trueis only formapviews. Reduced views do not include document IDs in view rows.Default:
trueSchema for any JSON type.
Start returning rows at the specified document ID. No effect if using
groupor not providing start key.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 for compressed attachments. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include attachment content in included document content or only the attachment metadata. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to include a list of conflicted revisions in each returned document. This only applies when requesting documents in the response.
Default:
falseParameter to specify whether to return the documents in descending by key order.
Default:
falseParameter to specify whether to include the full content of the documents in the response.
Default:
falseExamples:Parameter to specify whether to include the specified end key in the result.
Default:
trueParameter 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 ≤ 9007199254740991
Default:
0Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
Default:
falseSchema for any JSON type.
Stop returning rows at the specified document ID. No effect if using
groupor not providing end key.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_levelparameter.Default:
falseParameter 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
Parameter to specify to return only rows that match the specified key. String representation of any JSON type that matches the key type emitted by the view function.
Parameter to specify returning only rows 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
reduceview type can be disabled to behave like amapby settingreduce=falseexplicitly.Be aware that
include_docs=trueis only formapviews. Reduced views do not include document IDs in view rows.Default:
trueSchema for any JSON type.
Start returning rows at the specified document ID. No effect if using
groupor not providing start key.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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X POST "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/products/_partition/small-appliances/_design/appliances/_view/byApplianceProdId" -H "Content-Type: application/json" --data '{ "include_docs": true, "limit": 10 }'This example requires the
byApplianceProdIdpartitioned 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
byProductIdpartitioned 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
byProductIdpartitioned 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
byProductIdpartitioned 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
byProductIdpartitioned 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 ≤ 9007199254740991
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 therowsarray.Possible values: 0 ≤ value ≤ 4294967295
Current update sequence for the database
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([1-9]\d*-[A-Za-z0-9-_]+)$
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 therowsarray.Possible values: 0 ≤ value ≤ 4294967295
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 therowsarray.Possible values: 0 ≤ value ≤ 4294967295
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 therowsarray.Possible values: 0 ≤ value ≤ 4294967295
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 therowsarray.Possible values: 0 ≤ value ≤ 4294967295
Current update sequence for the database.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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,
) -> DetailedResponseAuditing
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
$eqoperator 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$regexcannot 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:
trueOpaque 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=trueis 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: textindexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740991
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:
trueUse 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_fallbacktofalseand the server responds instead with a400status 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
$eqoperator 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$regexcannot 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:
trueOpaque 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=trueis 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: textindexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740991
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:
trueUse 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_fallbacktofalseand the server responds instead with a400status 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
$eqoperator 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$regexcannot 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:
trueOpaque 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=trueis 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: textindexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740991
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:
trueUse 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_fallbacktofalseand the server responds instead with a400status 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
$eqoperator 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$regexcannot 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:
trueOpaque 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=trueis 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: textindexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740991
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:
trueUse 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_fallbacktofalseand the server responds instead with a400status 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
$eqoperator 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$regexcannot 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:
trueOpaque 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=trueis 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: textindexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740991
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:
trueUse 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_fallbacktofalseand the server responds instead with a400status 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
$eqoperator 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$regexcannot 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 ≤ 9007199254740991
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
jsonortextquery index definition. Indexes of typetexthave additional configuration properties that do not apply tojsonindexes, 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
$textoperator.- 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
nameproperty of the field name and atypeproperty 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
$sizeoperator. * 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
$eqoperator 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$regexcannot 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
jsonortextquery index definition. Indexes of typetexthave additional configuration properties that do not apply tojsonindexes, 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
$textoperator.- 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
nameproperty of the field name and atypeproperty 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
$sizeoperator. * 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
$eqoperator 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$regexcannot 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 ≤ 9007199254740991
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
$eqoperator 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$regexcannot 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 ≤ 9007199254740991
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
jsonortextquery index definition. Indexes of typetexthave additional configuration properties that do not apply tojsonindexes, 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
$textoperator.- 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
nameproperty of the field name and atypeproperty 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
$sizeoperator. * 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
$eqoperator 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$regexcannot 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
jsonortextquery index definition. Indexes of typetexthave additional configuration properties that do not apply tojsonindexes, 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
$textoperator.- 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
nameproperty of the field name and atypeproperty 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
$sizeoperator. * 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
$eqoperator 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$regexcannot 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 ≤ 9007199254740991
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
$eqoperator 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$regexcannot 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 ≤ 9007199254740991
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
jsonortextquery index definition. Indexes of typetexthave additional configuration properties that do not apply tojsonindexes, 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
$textoperator.- 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
nameproperty of the field name and atypeproperty 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
$sizeoperator. * 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
$eqoperator 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$regexcannot 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
jsonortextquery index definition. Indexes of typetexthave additional configuration properties that do not apply tojsonindexes, 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
$textoperator.- 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
nameproperty of the field name and atypeproperty 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
$sizeoperator. * 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
$eqoperator 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$regexcannot 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 ≤ 9007199254740991
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
$eqoperator 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$regexcannot 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 ≤ 9007199254740991
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
jsonortextquery index definition. Indexes of typetexthave additional configuration properties that do not apply tojsonindexes, 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
$textoperator.- 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
nameproperty of the field name and atypeproperty 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
$sizeoperator. * 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
$eqoperator 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$regexcannot 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
jsonortextquery index definition. Indexes of typetexthave additional configuration properties that do not apply tojsonindexes, 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
$textoperator.- 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
nameproperty of the field name and atypeproperty 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
$sizeoperator. * 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
$eqoperator 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$regexcannot 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 ≤ 9007199254740991
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
$eqoperator 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$regexcannot 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 ≤ 9007199254740991
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,
) -> DetailedResponsepost_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,
) -> DetailedResponseAuditing
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
$eqoperator 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$regexcannot 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:
trueOpaque 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=trueis 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: textindexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740991
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:
trueUse 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_fallbacktofalseand the server responds instead with a400status 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
$eqoperator 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$regexcannot 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:
trueOpaque 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=trueis 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: textindexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740991
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:
trueUse 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_fallbacktofalseand the server responds instead with a400status 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
$eqoperator 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$regexcannot 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:
trueOpaque 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=trueis 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: textindexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740991
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:
trueUse 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_fallbacktofalseand the server responds instead with a400status 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
$eqoperator 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$regexcannot 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:
trueOpaque 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=trueis 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: textindexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740991
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:
trueUse 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_fallbacktofalseand the server responds instead with a400status 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
$eqoperator 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$regexcannot 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:
trueOpaque 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=trueis 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: textindexes are limited to 200 results when queried.Possible values: 0 ≤ value ≤ 4294967295
Default:
25Skip the first 'n' results, where 'n' is the value that is specified.
Possible values: 0 ≤ value ≤ 9007199254740991
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:
trueUse 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_fallbacktofalseand the server responds instead with a400status 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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X POST "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 ≤ 9007199254740991
Number of rows scanned in the index.
Possible values: 0 ≤ value ≤ 9007199254740991
Number of documents fetched from the primary index with the specified read quorum.
Possible values: 0 ≤ value ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 ≤ 9007199254740991
Number of rows scanned in the index.
Possible values: 0 ≤ value ≤ 9007199254740991
Number of documents fetched from the primary index with the specified read quorum.
Possible values: 0 ≤ value ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 ≤ 9007199254740991
Number of rows scanned in the index.
Possible values: 0 ≤ value ≤ 9007199254740991
Number of documents fetched from the primary index with the specified read quorum.
Possible values: 0 ≤ value ≤ 9007199254740991
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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 ≤ 9007199254740991
Number of rows scanned in the index.
Possible values: 0 ≤ value ≤ 9007199254740991
Number of documents fetched from the primary index with the specified read quorum.
Possible values: 0 ≤ value ≤ 9007199254740991
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 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}/_changesRequest
Custom Headers
Header parameter to specify the ID of the last events received by the server on a previous connection. Overrides
sincequery 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 for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of conflicted revisions in each returned document. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to return changes in the descending order with most recent change first. The
sinceparameter has no effect when using descending order.Default:
falseQuery parameter to specify a JSON array list of document IDs to restrict the changes feed to. Used with the
_doc_idsfilter. Since length of URL is limited, it is better to use POST/{db}/_changesinstead.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:
normalQuery 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_idsrequest body parameter. (POSTonly)_selector- Returns changes for documents that match theselectorrequest body parameter. The selector syntax is the same as used for_find. (POSTonly)_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,_designor_doc_idsfilters rather than JS based_viewor design document filters. If you need to pass values to change the filtered content use the_selectorfilter 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
continuousandeventsourcefeeds. Overrides any timeout to keep the feed alive indefinitely. May also betrueto 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,
heartbeatis not suitable as a keepalive mechanism. Instead, consider one of the following options:- Use the
timeoutparameter with a value that is compatible with your network environment. - Switch to scheduled usage of one of the non-continuous changes feed
types (
normalorlongpoll). - 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:
falseQuery parameter to specify the ID of the last events received by the server on a previous connection. Alias of
Last-Event-IDheader.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. Possible values are:
0for all available changes (default).nowfor future changes.- A valid update sequence, for example, from the
seqvalue of a change received before.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$Example:
0Query 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_onlyQuery 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
longpollorcontinuousfeeds. Default value is specified byhttpd/changes_timeoutconfiguration option. Note that60000value is also the default maximum timeout to prevent undetected dead connections.Possible values: 0 ≤ value ≤ 60000
Default:
60000Query 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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/orders/_changes?limit=1"
Response
Schema for normal changes feed result.
last_seq
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([1-9]\d*-[A-Za-z0-9-_]+)$pending
Possible values: 0 ≤ value ≤ 9007199254740991
results
Possible values: 0 ≤ number of items ≤ 4294967295
Status Code
HTTP response for
/{db}/_changesstyle 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" }
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,
) -> DetailedResponsepost_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,
) -> DetailedResponseRequest
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
sincequery 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 for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of conflicted revisions in each returned document. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to return changes in the descending order with most recent change first. The
sinceparameter has no effect when using descending order.Default:
falseQuery parameter to specify the changes feed type.
Allowable values: [
continuous,eventsource,longpoll,normal]Default:
normalQuery 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_idsrequest body parameter. (POSTonly)_selector- Returns changes for documents that match theselectorrequest body parameter. The selector syntax is the same as used for_find. (POSTonly)_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,_designor_doc_idsfilters rather than JS based_viewor design document filters. If you need to pass values to change the filtered content use the_selectorfilter 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
continuousandeventsourcefeeds. Overrides any timeout to keep the feed alive indefinitely. May also betrueto 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,
heartbeatis not suitable as a keepalive mechanism. Instead, consider one of the following options:- Use the
timeoutparameter with a value that is compatible with your network environment. - Switch to scheduled usage of one of the non-continuous changes feed
types (
normalorlongpoll). - 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:
falseQuery parameter to specify the ID of the last events received by the server on a previous connection. Alias of
Last-Event-IDheader.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. Possible values are:
0for all available changes (default).nowfor future changes.- A valid update sequence, for example, from the
seqvalue of a change received before.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^0|([1-9]\d*-[A-Za-z0-9-_]+)|now$Example:
0Query 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_onlyQuery 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
longpollorcontinuousfeeds. Default value is specified byhttpd/changes_timeoutconfiguration option. Note that60000value is also the default maximum timeout to prevent undetected dead connections.Possible values: 0 ≤ value ≤ 60000
Default:
60000Query 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
$eqoperator 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$regexcannot 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
$eqoperator 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$regexcannot 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
sincequery 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 for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of conflicted revisions in each returned document. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to return changes in the descending order with most recent change first. The
sinceparameter has no effect when using descending order.Default:
falseQuery parameter to specify the changes feed type.
Allowable values: [
continuous,eventsource,longpoll,normal]Default:
normalQuery 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_idsrequest body parameter. (POSTonly)_selector- Returns changes for documents that match theselectorrequest body parameter. The selector syntax is the same as used for_find. (POSTonly)_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,_designor_doc_idsfilters rather than JS based_viewor design document filters. If you need to pass values to change the filtered content use the_selectorfilter 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
continuousandeventsourcefeeds. Overrides any timeout to keep the feed alive indefinitely. May also betrueto 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,
heartbeatis not suitable as a keepalive mechanism. Instead, consider one of the following options:- Use the
timeoutparameter with a value that is compatible with your network environment. - Switch to scheduled usage of one of the non-continuous changes feed
types (
normalorlongpoll). - 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:
falseQuery 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. Possible values are:
0for all available changes (default).nowfor future changes.- A valid update sequence, for example, from the
seqvalue of a change received before.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/Examples:0Query 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_onlyQuery 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
longpollorcontinuousfeeds. Default value is specified byhttpd/changes_timeoutconfiguration option. Note that60000value is also the default maximum timeout to prevent undetected dead connections.Possible values: 0 ≤ value ≤ 60000
Default:
60000Query 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
$eqoperator 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$regexcannot 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
sincequery 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 for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of conflicted revisions in each returned document. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to return changes in the descending order with most recent change first. The
sinceparameter has no effect when using descending order.Default:
falseQuery parameter to specify the changes feed type.
Allowable values: [
continuous,eventsource,longpoll,normal]Default:
normalQuery 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_idsrequest body parameter. (POSTonly)_selector- Returns changes for documents that match theselectorrequest body parameter. The selector syntax is the same as used for_find. (POSTonly)_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,_designor_doc_idsfilters rather than JS based_viewor design document filters. If you need to pass values to change the filtered content use the_selectorfilter 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
continuousandeventsourcefeeds. Overrides any timeout to keep the feed alive indefinitely. May also betrueto 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,
heartbeatis not suitable as a keepalive mechanism. Instead, consider one of the following options:- Use the
timeoutparameter with a value that is compatible with your network environment. - Switch to scheduled usage of one of the non-continuous changes feed
types (
normalorlongpoll). - 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:
falseQuery 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. Possible values are:
0for all available changes (default).nowfor future changes.- A valid update sequence, for example, from the
seqvalue of a change received before.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^0|([1-9]\\d*-[A-Za-z0-9-_]+)|now$/Examples:0Query 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_onlyQuery 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
longpollorcontinuousfeeds. Default value is specified byhttpd/changes_timeoutconfiguration option. Note that60000value is also the default maximum timeout to prevent undetected dead connections.Possible values: 0 ≤ value ≤ 60000
Default:
60000Query 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
$eqoperator 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$regexcannot 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
sincequery 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 for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of conflicted revisions in each returned document. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to return changes in the descending order with most recent change first. The
sinceparameter has no effect when using descending order.Default:
falseQuery parameter to specify the changes feed type.
Allowable values: [
continuous,eventsource,longpoll,normal]Default:
normalQuery 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_idsrequest body parameter. (POSTonly)_selector- Returns changes for documents that match theselectorrequest body parameter. The selector syntax is the same as used for_find. (POSTonly)_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,_designor_doc_idsfilters rather than JS based_viewor design document filters. If you need to pass values to change the filtered content use the_selectorfilter 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
continuousandeventsourcefeeds. Overrides any timeout to keep the feed alive indefinitely. May also betrueto 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,
heartbeatis not suitable as a keepalive mechanism. Instead, consider one of the following options:- Use the
timeoutparameter with a value that is compatible with your network environment. - Switch to scheduled usage of one of the non-continuous changes feed
types (
normalorlongpoll). - 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:
falseQuery 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. Possible values are:
0for all available changes (default).nowfor future changes.- A valid update sequence, for example, from the
seqvalue of a change received before.
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_onlyQuery 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
longpollorcontinuousfeeds. Default value is specified byhttpd/changes_timeoutconfiguration option. Note that60000value is also the default maximum timeout to prevent undetected dead connections.Possible values: 0 ≤ value ≤ 60000
Default:
60000Query 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
$eqoperator 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$regexcannot 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
sincequery 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 for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of conflicted revisions in each returned document. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to return changes in the descending order with most recent change first. The
sinceparameter has no effect when using descending order.Default:
falseQuery parameter to specify the changes feed type.
Allowable values: [
continuous,eventsource,longpoll,normal]Default:
normalQuery 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_idsrequest body parameter. (POSTonly)_selector- Returns changes for documents that match theselectorrequest body parameter. The selector syntax is the same as used for_find. (POSTonly)_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,_designor_doc_idsfilters rather than JS based_viewor design document filters. If you need to pass values to change the filtered content use the_selectorfilter 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
continuousandeventsourcefeeds. Overrides any timeout to keep the feed alive indefinitely. May also betrueto 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,
heartbeatis not suitable as a keepalive mechanism. Instead, consider one of the following options:- Use the
timeoutparameter with a value that is compatible with your network environment. - Switch to scheduled usage of one of the non-continuous changes feed
types (
normalorlongpoll). - 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:
falseQuery 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. Possible values are:
0for all available changes (default).nowfor future changes.- A valid update sequence, for example, from the
seqvalue of a change received before.
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_onlyQuery 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
longpollorcontinuousfeeds. Default value is specified byhttpd/changes_timeoutconfiguration option. Note that60000value is also the default maximum timeout to prevent undetected dead connections.Possible values: 0 ≤ value ≤ 60000
Default:
60000Query 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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X POST "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/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
^([1-9]\d*-[A-Za-z0-9-_]+)$pending
Possible values: 0 ≤ value ≤ 9007199254740991
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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/pending.
Possible values: 0 ≤ value ≤ 9007199254740991
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
truethen 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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
Schema for normal changes feed result.
last_seq.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/pending.
Possible values: 0 ≤ value ≤ 9007199254740991
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
truethen 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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
Schema for normal changes feed result.
last_seq.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/pending.
Possible values: 0 ≤ value ≤ 9007199254740991
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
truethen 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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
Schema for normal changes feed result.
last_seq.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/pending.
Possible values: 0 ≤ value ≤ 9007199254740991
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
truethen 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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
Status Code
HTTP response for
/{db}/_changesstyle 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
^([1-9]\d*-[A-Za-z0-9-_]+)$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:
30000HTTP 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:
30000Configure the replication to be continuous.
Default:
falseCreates the target database. Requires administrator privileges on target server.
Default:
falseRequest 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:
20The 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_proxyandtarget_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:
5JSON 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
$eqoperator 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$regexcannot 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:
trueSchema 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:
falseControls 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:
500Controls 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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X POST "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/_replicate" -H "Content-Type: application/json" --data '{ "_id": "repldoc-example", "create_target": true, "source": { "url": "https://~replace-with-source-host~.cloudantnosqldb.appdomain.cloud/animaldb" }, "target": { "auth": { "iam": { "api_key": "a1b2c3d4e5f6f1g4h7j3k6l9m2p5q8s1t4v7x0z3" } }, "url": "https://~replace-with-target-host~.cloudantnosqldb.appdomain.cloud/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 ≤ 9007199254740991
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
^([1-9]\d*-[A-Za-z0-9-_]+)$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,
) -> DetailedResponseRequest
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
^([1-9]\d*-[A-Za-z0-9-_]+)$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:
30000HTTP 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:
30000Configure the replication to be continuous.
Default:
falseCreates the target database. Requires administrator privileges on target server.
Default:
falseRequest 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:
20The 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_proxyandtarget_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:
5JSON 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
$eqoperator 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$regexcannot 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:
trueSchema 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:
falseControls 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:
500Controls 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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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:
30000HTTP 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:
30000Configure the replication to be continuous.
Default:
falseCreates the target database. Requires administrator privileges on target server.
Default:
falseRequest 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:
3Parameter to specify whether to enable database partitions when creating the target database.
Default:
falseSchema 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:
20The 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:
5JSON 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
$eqoperator 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$regexcannot 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:
trueSchema 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:
falseControls 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:
500Controls 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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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:
30000HTTP 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:
30000Configure the replication to be continuous.
Default:
falseCreates the target database. Requires administrator privileges on target server.
Default:
falseRequest 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:
3Parameter to specify whether to enable database partitions when creating the target database.
Default:
falseSchema 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:
20The 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:
5JSON 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
$eqoperator 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$regexcannot 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:
trueSchema 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:
falseControls 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:
500Controls 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, andfilterare 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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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:
30000HTTP 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:
30000Configure the replication to be continuous.
Default:
falseCreates the target database. Requires administrator privileges on target server.
Default:
falseRequest 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:
3Parameter to specify whether to enable database partitions when creating the target database.
Default:
falseSchema 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:
20The 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:
5JSON 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
$eqoperator 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$regexcannot 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:
trueSchema 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:
falseControls 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:
500Controls 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, andfilterare 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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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:
30000HTTP 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:
30000Configure the replication to be continuous.
Default:
falseCreates the target database. Requires administrator privileges on target server.
Default:
falseRequest 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:
3Parameter to specify whether to enable database partitions when creating the target database.
Default:
falseSchema 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:
20The 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:
5JSON 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
$eqoperator 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$regexcannot 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:
trueSchema 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:
falseControls 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:
500Controls 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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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,
) -> DetailedResponseRequest
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
_replicatordatabase.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
_replicatordatabase.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
_replicatordatabase.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
_replicatordatabase.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
_replicatordatabase.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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X DELETE "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/_replicator/repldoc-example?rev=1-00000000000000000000000000000000"
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("1-00000000000000000000000000000000") 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("1-00000000000000000000000000000000") .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: '1-00000000000000000000000000000000' }).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='1-00000000000000000000000000000000' ).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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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,
) -> DetailedResponseRequest
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
_replicatordatabase.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].+$
Query Parameters
Query parameter to specify whether to include attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include the encoding information for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery 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. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of deleted conflicted revisions in the
_deleted_conflictsproperty of the returned document.Default:
falseQuery parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
falseQuery parameter to specify whether to include the last update sequence for the document.
Default:
falseQuery 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:
falseQuery parameter to specify leaf revisions to retrieve. Additionally, it accepts a value of
allto 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:
falseQuery 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
_replicatordatabase.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 attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include the encoding information for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of conflicted revisions in each returned document. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of deleted conflicted revisions in the
_deleted_conflictsproperty of the returned document.Default:
falseQuery parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
falseQuery parameter to specify whether to include the last update sequence for the document.
Default:
falseQuery 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:
falseQuery 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:
falseQuery 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
_replicatordatabase.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 attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include the encoding information for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of conflicted revisions in each returned document. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of deleted conflicted revisions in the
_deleted_conflictsproperty of the returned document.Default:
falseQuery parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
falseQuery parameter to specify whether to include the last update sequence for the document.
Default:
falseQuery 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:
falseQuery 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:
falseQuery 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
_replicatordatabase.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 attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include the encoding information for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of conflicted revisions in each returned document. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of deleted conflicted revisions in the
_deleted_conflictsproperty of the returned document.Default:
falseQuery parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
falseQuery parameter to specify whether to include the last update sequence for the document.
Default:
falseQuery 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:
falseQuery 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:
falseQuery 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
_replicatordatabase.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 attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include the encoding information for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of conflicted revisions in each returned document. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include a list of deleted conflicted revisions in the
_deleted_conflictsproperty of the returned document.Default:
falseQuery parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
Default:
falseQuery parameter to specify whether to include the last update sequence for the document.
Default:
falseQuery 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:
falseQuery 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:
falseQuery parameter to specify whether to includes detailed information for all known document revisions.
Default:
false
curl -H "Authorization: Bearer A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/_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
^([1-9]\d*-[A-Za-z0-9-_]+)$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_proxyandtarget_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
$eqoperator 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$regexcannot 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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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
$eqoperator 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$regexcannot 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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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
$eqoperator 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$regexcannot 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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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
$eqoperator 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$regexcannot 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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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
$eqoperator 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$regexcannot 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,
) -> DetailedResponseRequest
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
_replicatordatabase.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
_replicatordatabase.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
_replicatordatabase.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
_replicatordatabase.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
_replicatordatabase.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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" --head "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/_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,
) -> DetailedResponseRequest
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
_replicatordatabase.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:
falseQuery 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
^([1-9]\d*-[A-Za-z0-9-_]+)$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:
30000HTTP 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:
30000Configure the replication to be continuous.
Default:
falseCreates the target database. Requires administrator privileges on target server.
Default:
falseRequest 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:
20The 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_proxyandtarget_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:
5JSON 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
$eqoperator 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$regexcannot 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:
trueSchema 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:
falseControls 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:
500Controls 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
_replicatordatabase.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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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:
30000HTTP 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:
30000Configure the replication to be continuous.
Default:
falseCreates the target database. Requires administrator privileges on target server.
Default:
falseRequest 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:
3Parameter to specify whether to enable database partitions when creating the target database.
Default:
falseSchema 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:
20The 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:
5JSON 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
$eqoperator 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$regexcannot 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:
trueSchema 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:
falseControls 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:
500Controls 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:
falseQuery 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
_replicatordatabase.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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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:
30000HTTP 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:
30000Configure the replication to be continuous.
Default:
falseCreates the target database. Requires administrator privileges on target server.
Default:
falseRequest 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:
3Parameter to specify whether to enable database partitions when creating the target database.
Default:
falseSchema 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:
20The 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:
5JSON 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
$eqoperator 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$regexcannot 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:
trueSchema 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:
falseControls 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:
500Controls 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:
falseQuery 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
_replicatordatabase.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/Schema for a replication document. Note that
selector,doc_ids, andfilterare 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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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:
30000HTTP 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:
30000Configure the replication to be continuous.
Default:
falseCreates the target database. Requires administrator privileges on target server.
Default:
falseRequest 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:
3Parameter to specify whether to enable database partitions when creating the target database.
Default:
falseSchema 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:
20The 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:
5JSON 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
$eqoperator 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$regexcannot 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:
trueSchema 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:
falseControls 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:
500Controls 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:
falseQuery 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
_replicatordatabase.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^[^_].+$/Schema for a replication document. Note that
selector,doc_ids, andfilterare 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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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:
30000HTTP 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:
30000Configure the replication to be continuous.
Default:
falseCreates the target database. Requires administrator privileges on target server.
Default:
falseRequest 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:
3Parameter to specify whether to enable database partitions when creating the target database.
Default:
falseSchema 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:
20The 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:
5JSON 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
$eqoperator 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$regexcannot 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:
trueSchema 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:
falseControls 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:
500Controls 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:
falseQuery 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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X PUT "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/_replicator/repldoc-example" -H "Content-Type: application/json" --data '{ "_id": "repldoc-example", "create_target": true, "source": { "url": "https://~replace-with-source-host~.cloudantnosqldb.appdomain.cloud/animaldb" }, "target": { "auth": { "iam": { "api_key": "a1b2c3d4e5f6f1g4h7j3k6l9m2p5q8s1t4v7x0z3" } }, "url": "https://~replace-with-target-host~.cloudantnosqldb.appdomain.cloud/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( "https://~replace-with-source-host~.cloudantnosqldb.appdomain.cloud/animaldb", ) if err != nil { panic(err) } target, err := service.NewReplicationDatabase( "https://~replace-with-target-host~.cloudantnosqldb.appdomain.cloud/animaldb-target", ) if err != nil { panic(err) } auth, err := service.NewReplicationDatabaseAuthIam( "a1b2c3d4e5f6f1g4h7j3k6l9m2p5q8s1t4v7x0z3", //use your own 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("https://~replace-with-source-host~.cloudantnosqldb.appdomain.cloud/animaldb") .build(); ReplicationDatabaseAuthIam targetAuthIam = new ReplicationDatabaseAuthIam.Builder() .apiKey("a1b2c3d4e5f6f1g4h7j3k6l9m2p5q8s1t4v7x0z3") //use your own IAM API key .build(); ReplicationDatabaseAuth targetAuth = new ReplicationDatabaseAuth.Builder() .iam(targetAuthIam) .build(); ReplicationDatabase targetDb = new ReplicationDatabase.Builder() .auth(targetAuth) .url("https://~replace-with-target-host~.cloudantnosqldb.appdomain.cloud/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: 'https://~replace-with-source-host~.cloudantnosqldb.appdomain.cloud/animaldb' }; const targetDb: CloudantV1.ReplicationDatabase = { auth: { iam: { 'apiKey': 'a1b2c3d4e5f6f1g4h7j3k6l9m2p5q8s1t4v7x0z3' //use your own IAM API key } }, url: 'https://~replace-with-target-host~.cloudantnosqldb.appdomain.cloud/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='https://~replace-with-source-host~.cloudantnosqldb.appdomain.cloud/animaldb' ) target_auth_iam = ReplicationDatabaseAuthIam( api_key='a1b2c3d4e5f6f1g4h7j3k6l9m2p5q8s1t4v7x0z3' #use your own IAM API key ) target_auth = ReplicationDatabaseAuth( iam=target_auth_iam ) target_db = ReplicationDatabase( auth=target_auth, url='https://~replace-with-target-host~.cloudantnosqldb.appdomain.cloud/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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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,
) -> DetailedResponseRequest
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 ≤ 9007199254740991
Default:
0Query 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 ≤ 9007199254740991
Default:
0Query 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 ≤ 9007199254740991
Default:
0Query 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 ≤ 9007199254740991
Default:
0Query 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 ≤ 9007199254740991
Default:
0Query 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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/_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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
The source sequence id which was last successfully replicated.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/The count of docs which failed to be written to the target.
Possible values: 0 ≤ value ≤ 9007199254740991
The count of docs which have been read from the source.
Possible values: 0 ≤ value ≤ 9007199254740991
The count of docs which have been written to the target.
Possible values: 0 ≤ value ≤ 9007199254740991
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 ≤ 9007199254740991
The count of revisions which have been checked since this replication began.
Possible values: 0 ≤ value ≤ 9007199254740991
The last sequence number obtained from the source database changes feed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/The last sequence number processed by the replicator.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
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 ≤ 9007199254740991
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 ≤ 9007199254740991
The source sequence id which was last successfully replicated.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/The count of docs which failed to be written to the target.
Possible values: 0 ≤ value ≤ 9007199254740991
The count of docs which have been read from the source.
Possible values: 0 ≤ value ≤ 9007199254740991
The count of docs which have been written to the target.
Possible values: 0 ≤ value ≤ 9007199254740991
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 ≤ 9007199254740991
The count of revisions which have been checked since this replication began.
Possible values: 0 ≤ value ≤ 9007199254740991
The last sequence number obtained from the source database changes feed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/The last sequence number processed by the replicator.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
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 ≤ 9007199254740991
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 ≤ 9007199254740991
The source sequence id which was last successfully replicated.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/The count of docs which failed to be written to the target.
Possible values: 0 ≤ value ≤ 9007199254740991
The count of docs which have been read from the source.
Possible values: 0 ≤ value ≤ 9007199254740991
The count of docs which have been written to the target.
Possible values: 0 ≤ value ≤ 9007199254740991
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 ≤ 9007199254740991
The count of revisions which have been checked since this replication began.
Possible values: 0 ≤ value ≤ 9007199254740991
The last sequence number obtained from the source database changes feed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/The last sequence number processed by the replicator.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
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 ≤ 9007199254740991
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 ≤ 9007199254740991
The source sequence id which was last successfully replicated.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/The count of docs which failed to be written to the target.
Possible values: 0 ≤ value ≤ 9007199254740991
The count of docs which have been read from the source.
Possible values: 0 ≤ value ≤ 9007199254740991
The count of docs which have been written to the target.
Possible values: 0 ≤ value ≤ 9007199254740991
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 ≤ 9007199254740991
The count of revisions which have been checked since this replication began.
Possible values: 0 ≤ value ≤ 9007199254740991
The last sequence number obtained from the source database changes feed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/The last sequence number processed by the replicator.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
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/docsstyle 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 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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/_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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
The source sequence id which was last successfully replicated.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/The count of docs which failed to be written to the target.
Possible values: 0 ≤ value ≤ 9007199254740991
The count of docs which have been read from the source.
Possible values: 0 ≤ value ≤ 9007199254740991
The count of docs which have been written to the target.
Possible values: 0 ≤ value ≤ 9007199254740991
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 ≤ 9007199254740991
The count of revisions which have been checked since this replication began.
Possible values: 0 ≤ value ≤ 9007199254740991
The last sequence number obtained from the source database changes feed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/The last sequence number processed by the replicator.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
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 ≤ 9007199254740991
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 ≤ 9007199254740991
The source sequence id which was last successfully replicated.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/The count of docs which failed to be written to the target.
Possible values: 0 ≤ value ≤ 9007199254740991
The count of docs which have been read from the source.
Possible values: 0 ≤ value ≤ 9007199254740991
The count of docs which have been written to the target.
Possible values: 0 ≤ value ≤ 9007199254740991
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 ≤ 9007199254740991
The count of revisions which have been checked since this replication began.
Possible values: 0 ≤ value ≤ 9007199254740991
The last sequence number obtained from the source database changes feed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/The last sequence number processed by the replicator.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
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 ≤ 9007199254740991
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 ≤ 9007199254740991
The source sequence id which was last successfully replicated.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/The count of docs which failed to be written to the target.
Possible values: 0 ≤ value ≤ 9007199254740991
The count of docs which have been read from the source.
Possible values: 0 ≤ value ≤ 9007199254740991
The count of docs which have been written to the target.
Possible values: 0 ≤ value ≤ 9007199254740991
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 ≤ 9007199254740991
The count of revisions which have been checked since this replication began.
Possible values: 0 ≤ value ≤ 9007199254740991
The last sequence number obtained from the source database changes feed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/The last sequence number processed by the replicator.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
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 ≤ 9007199254740991
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 ≤ 9007199254740991
The source sequence id which was last successfully replicated.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/The count of docs which failed to be written to the target.
Possible values: 0 ≤ value ≤ 9007199254740991
The count of docs which have been read from the source.
Possible values: 0 ≤ value ≤ 9007199254740991
The count of docs which have been written to the target.
Possible values: 0 ≤ value ≤ 9007199254740991
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 ≤ 9007199254740991
The count of revisions which have been checked since this replication began.
Possible values: 0 ≤ value ≤ 9007199254740991
The last sequence number obtained from the source database changes feed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/The last sequence number processed by the replicator.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
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,
) -> DetailedResponseRequest
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,
) -> DetailedResponseRequest
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:
25Query parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740991
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:
25Query parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740991
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:
25Query parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740991
Default:
0
parameters
Query parameter to specify the number of returned jobs to limit the result to.
Possible values: 0 ≤ value ≤ 200
Default:
25Query parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740991
Default:
0
parameters
Query parameter to specify the number of returned jobs to limit the result to.
Possible values: 0 ≤ value ≤ 200
Default:
25Query parameter to specify the number of records before starting to return the results.
Possible values: 0 ≤ value ≤ 9007199254740991
Default:
0
curl -H "Authorization: Bearer A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/_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 ≤ 9007199254740991
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 ≤ 9007199254740991
The source sequence id which was last successfully replicated.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/The count of docs which failed to be written to the target.
Possible values: 0 ≤ value ≤ 9007199254740991
The count of docs which have been read from the source.
Possible values: 0 ≤ value ≤ 9007199254740991
The count of docs which have been written to the target.
Possible values: 0 ≤ value ≤ 9007199254740991
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 ≤ 9007199254740991
The count of revisions which have been checked since this replication began.
Possible values: 0 ≤ value ≤ 9007199254740991
The last sequence number obtained from the source database changes feed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/The last sequence number processed by the replicator.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
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 ≤ 9007199254740991
The source sequence id which was last successfully replicated.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/The count of docs which failed to be written to the target.
Possible values: 0 ≤ value ≤ 9007199254740991
The count of docs which have been read from the source.
Possible values: 0 ≤ value ≤ 9007199254740991
The count of docs which have been written to the target.
Possible values: 0 ≤ value ≤ 9007199254740991
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 ≤ 9007199254740991
The count of revisions which have been checked since this replication began.
Possible values: 0 ≤ value ≤ 9007199254740991
The last sequence number obtained from the source database changes feed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/The last sequence number processed by the replicator.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
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 ≤ 9007199254740991
The source sequence id which was last successfully replicated.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/The count of docs which failed to be written to the target.
Possible values: 0 ≤ value ≤ 9007199254740991
The count of docs which have been read from the source.
Possible values: 0 ≤ value ≤ 9007199254740991
The count of docs which have been written to the target.
Possible values: 0 ≤ value ≤ 9007199254740991
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 ≤ 9007199254740991
The count of revisions which have been checked since this replication began.
Possible values: 0 ≤ value ≤ 9007199254740991
The last sequence number obtained from the source database changes feed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/The last sequence number processed by the replicator.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
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 ≤ 9007199254740991
The source sequence id which was last successfully replicated.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/The count of docs which failed to be written to the target.
Possible values: 0 ≤ value ≤ 9007199254740991
The count of docs which have been read from the source.
Possible values: 0 ≤ value ≤ 9007199254740991
The count of docs which have been written to the target.
Possible values: 0 ≤ value ≤ 9007199254740991
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 ≤ 9007199254740991
The count of revisions which have been checked since this replication began.
Possible values: 0 ≤ value ≤ 9007199254740991
The last sequence number obtained from the source database changes feed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/The last sequence number processed by the replicator.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
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/jobsstyle 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 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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/_scheduler/jobs/7b94915cd8c4a0173c77c55cd0443939+continuous?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 ≤ 9007199254740991
The source sequence id which was last successfully replicated.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/The count of docs which failed to be written to the target.
Possible values: 0 ≤ value ≤ 9007199254740991
The count of docs which have been read from the source.
Possible values: 0 ≤ value ≤ 9007199254740991
The count of docs which have been written to the target.
Possible values: 0 ≤ value ≤ 9007199254740991
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 ≤ 9007199254740991
The count of revisions which have been checked since this replication began.
Possible values: 0 ≤ value ≤ 9007199254740991
The last sequence number obtained from the source database changes feed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/The last sequence number processed by the replicator.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
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 ≤ 9007199254740991
The source sequence id which was last successfully replicated.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/The count of docs which failed to be written to the target.
Possible values: 0 ≤ value ≤ 9007199254740991
The count of docs which have been read from the source.
Possible values: 0 ≤ value ≤ 9007199254740991
The count of docs which have been written to the target.
Possible values: 0 ≤ value ≤ 9007199254740991
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 ≤ 9007199254740991
The count of revisions which have been checked since this replication began.
Possible values: 0 ≤ value ≤ 9007199254740991
The last sequence number obtained from the source database changes feed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/The last sequence number processed by the replicator.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
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 ≤ 9007199254740991
The source sequence id which was last successfully replicated.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/The count of docs which failed to be written to the target.
Possible values: 0 ≤ value ≤ 9007199254740991
The count of docs which have been read from the source.
Possible values: 0 ≤ value ≤ 9007199254740991
The count of docs which have been written to the target.
Possible values: 0 ≤ value ≤ 9007199254740991
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 ≤ 9007199254740991
The count of revisions which have been checked since this replication began.
Possible values: 0 ≤ value ≤ 9007199254740991
The last sequence number obtained from the source database changes feed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/The last sequence number processed by the replicator.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
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 ≤ 9007199254740991
The source sequence id which was last successfully replicated.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/The count of docs which failed to be written to the target.
Possible values: 0 ≤ value ≤ 9007199254740991
The count of docs which have been read from the source.
Possible values: 0 ≤ value ≤ 9007199254740991
The count of docs which have been written to the target.
Possible values: 0 ≤ value ≤ 9007199254740991
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 ≤ 9007199254740991
The count of revisions which have been checked since this replication began.
Possible values: 0 ≤ value ≤ 9007199254740991
The last sequence number obtained from the source database changes feed.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/The last sequence number processed by the replicator.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/
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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" --head "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/_scheduler/jobs/7b94915cd8c4a0173c77c55cd0443939+continuous"
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 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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X DELETE "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/_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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/_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
/_sessionstyle 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" }
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 "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/_session" -H "Content-Type: application/json" --data '{ "username": "username", "password": "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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X POST "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/_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": "apikey-examplegeneratedapikeyidentifier", "ok": true, "password": "abcdefABCDEFabcdefABCDEF" }Example ApiKeysResult response.
{ "key": "apikey-examplegeneratedapikeyidentifier", "ok": true, "password": "abcdefABCDEFabcdefABCDEF" }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}/_securityRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/_api/v2/db/products/_security"The
nobodyusername 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 thenobodyuser has the role_reader.If instead of using Cloudant's security model for managing permissions you opt to use the Apache CouchDB
_usersdatabase (that is using legacy credentials and thecouchdb_auth_only:trueoption) then be aware that the user must already exist in_usersdatabase before getting permissions. For information on the_usersdatabase, see Using the_usersdatabase with Cloudant.
Response
Schema for a Cloudant 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
_usersdatabase 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,
) -> DetailedResponseRequest
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
_usersdatabase 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
_usersdatabase 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
_usersdatabase 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
_usersdatabase 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
_usersdatabase 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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X PUT "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/_api/v2/db/products/_security" --data '{"nobody": ["_reader"]}'The
nobodyusername 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 thenobodyuser has the role_reader.If instead of using Cloudant's security model for managing permissions you opt to use the Apache CouchDB
_usersdatabase (that is using legacy credentials and thecouchdb_auth_only:trueoption) then be aware that the user must already exist in_usersdatabase before adding permissions. For information on the_usersdatabase, see Using the_usersdatabase 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
nobodyusername 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 thenobodyuser has the role_reader.If instead of using Cloudant's security model for managing permissions you opt to use the Apache CouchDB
_usersdatabase (that is using legacy credentials and thecouchdb_auth_only:trueoption) then be aware that the user must already exist in_usersdatabase before adding permissions. For information on the_usersdatabase, see Using the_usersdatabase 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
nobodyusername 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 thenobodyuser has the role_reader.If instead of using Cloudant's security model for managing permissions you opt to use the Apache CouchDB
_usersdatabase (that is using legacy credentials and thecouchdb_auth_only:trueoption) then be aware that the user must already exist in_usersdatabase before adding permissions. For information on the_usersdatabase, see Using the_usersdatabase 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
nobodyusername 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 thenobodyuser has the role_reader.If instead of using Cloudant's security model for managing permissions you opt to use the Apache CouchDB
_usersdatabase (that is using legacy credentials and thecouchdb_auth_only:trueoption) then be aware that the user must already exist in_usersdatabase before adding permissions. For information on the_usersdatabase, see Using the_usersdatabase 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
nobodyusername 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 thenobodyuser has the role_reader.If instead of using Cloudant's security model for managing permissions you opt to use the Apache CouchDB
_usersdatabase (that is using legacy credentials and thecouchdb_auth_only:trueoption) then be aware that the user must already exist in_usersdatabase before adding permissions. For information on the_usersdatabase, see Using the_usersdatabase 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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/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 Cloudant 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
_usersdatabase only.Schema for names and roles to map to a database permission.
Schema for a Cloudant 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
_usersdatabase 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 Cloudant 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
_usersdatabase 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 Cloudant 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
_usersdatabase 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 Cloudant 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
_usersdatabase 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" }
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,
) -> DetailedResponseRequest
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
_usersdatabase 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
_usersdatabase 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
_usersdatabase 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
_usersdatabase 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
_usersdatabase 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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X PUT "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/products/_security" -H "Content-Type: application/json" --data '{ "members": { "names": [ "user1", "user2" ], "roles": [ "developers" ] } }'The
nobodyusername 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 thenobodyuser has the role_reader.If instead of using Cloudant's security model for managing permissions you opt to use the Apache CouchDB
_usersdatabase (that is using legacy credentials and thecouchdb_auth_only:trueoption) then be aware that the user must already exist in_usersdatabase before adding permissions. For information on the_usersdatabase, see Using the_usersdatabase 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
nobodyusername 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 thenobodyuser has the role_reader.If instead of using Cloudant's security model for managing permissions you opt to use the Apache CouchDB
_usersdatabase (that is using legacy credentials and thecouchdb_auth_only:trueoption) then be aware that the user must already exist in_usersdatabase before adding permissions. For information on the_usersdatabase, see Using the_usersdatabase 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
nobodyusername 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 thenobodyuser has the role_reader.If instead of using Cloudant's security model for managing permissions you opt to use the Apache CouchDB
_usersdatabase (that is using legacy credentials and thecouchdb_auth_only:trueoption) then be aware that the user must already exist in_usersdatabase before adding permissions. For information on the_usersdatabase, see Using the_usersdatabase 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
nobodyusername 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 thenobodyuser has the role_reader.If instead of using Cloudant's security model for managing permissions you opt to use the Apache CouchDB
_usersdatabase (that is using legacy credentials and thecouchdb_auth_only:trueoption) then be aware that the user must already exist in_usersdatabase before adding permissions. For information on the_usersdatabase, see Using the_usersdatabase 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
nobodyusername 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 thenobodyuser has the role_reader.If instead of using Cloudant's security model for managing permissions you opt to use the Apache CouchDB
_usersdatabase (that is using legacy credentials and thecouchdb_auth_only:trueoption) then be aware that the user must already exist in_usersdatabase before adding permissions. For information on the_usersdatabase, see Using the_usersdatabase 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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/_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,
) -> DetailedResponseRequest
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:
trueBoolean 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:
trueExamples:trueBoolean value to turn CORS on and off.
Default:
trueExamples: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:
trueExamples:trueBoolean value to turn CORS on and off.
Default:
trueExamples: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:
trueExamples:Boolean value to turn CORS on and off.
Default:
trueExamples:
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:
trueExamples:Boolean value to turn CORS on and off.
Default:
trueExamples:
curl -H "Authorization: Bearer A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X PUT "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/_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 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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X DELETE "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/products/small-appliances:100001/product_details.txt?rev=4-33333333333333333333333333333333"This example requires the
product_details.txtattachment insmall-appliances:100001document 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-33333333333333333333333333333333") 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.txtattachment in1000042document 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-33333333333333333333333333333333") .build(); DocumentResult response = service.deleteAttachment(attachmentOptions).execute() .getResult(); System.out.println(response);This example requires the
product_details.txtattachment in1000042document 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-33333333333333333333333333333333' }).then(response => { console.log(response.result); });This example requires the
product_details.txtattachment in1000042document 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-33333333333333333333333333333333' ).get_result() print(response)This example requires the
product_details.txtattachment in1000042document 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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/products/small-appliances:100001/product_details.txt"This example requires the
product_details.txtattachment insmall-appliances:100001document 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.txtattachment in1000042document 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.txtattachment in1000042document 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.txtattachment in1000042document 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.txtattachment in1000042document 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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" --head "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/products/small-appliances:100001/product_details.txt"This example requires the
product_details.txtattachment insmall-appliances:100001document 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.txtattachment in1000042document 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.txtattachment in1000042document 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.txtattachment in1000042document 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.txtattachment in1000042document 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
Response header in the form of
bytes <range>/<total content length>returning the bytes requested by theRangeheader 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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X PUT "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X DELETE "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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,
) -> DetailedResponseRequest
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 attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include the encoding information for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery 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/jsonHeader 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 attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include the encoding information for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery 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/jsonHeader 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 attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include the encoding information for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery 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/jsonHeader 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 attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include the encoding information for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery 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/jsonHeader 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 attachment content in the response. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include the encoding information for compressed attachments. Note that when used with a view-style query or changes feed this only applies when requesting documents in the response.
Default:
falseQuery parameter to specify whether to include the last update sequence for the document.
Default:
false
curl -H "Authorization: Bearer A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/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
^([1-9]\d*-[A-Za-z0-9-_]+)$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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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,
) -> DetailedResponseRequest
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,
) -> DetailedResponseRequest
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
^([1-9]\d*-[A-Za-z0-9-_]+)$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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 when requested with
attachments=trueoratts_since. When retrieving attachments for a single document this field is only avialable when accepting an application/json response. For multipart responses each attachment is instead included in a separate part of the response (seefollows).Note that SDK deserialization of documents with included attachments automatically decodes the Base64 encoded attachment content string to bytes.
Possible values: 1 ≤ length ≤ 13981014, Value must match regular expression
/^[A-Za-z0-9+\/]{2,}={0,3}$/Content hash digest. It starts with prefix declaring the hash type,
md5-for example, and continues with the 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 for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.Possible values: 0 ≤ value ≤ 10485760
Compression codec. Available for compressed attachments when requested with
att_encoding_info. The database compresses attachments if the content_type is in the list of compressible types when added.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 at attachment addition.
Possible values: 1 ≤ value ≤ 4294967295
Has
truevalue if object has stub attachment metadata, but not attachment 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
/^([1-9]\\d*-[A-Za-z0-9-_]+)$/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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X PUT "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 ≤ 9007199254740991
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 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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X POST "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/orders/_revs_diff" -H "Content-Type: application/json" -d '{ "order00077": [ "1-00000000000000000000000000000000", "2-11111111111111111111111111111111", "3-22222222222222222222222222222222" ] }'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-00000000000000000000000000000000", // missing revision "2-11111111111111111111111111111111", // missing revision "3-22222222222222222222222222222222", // 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-00000000000000000000000000000000", // missing revision "2-11111111111111111111111111111111", // missing revision "3-22222222222222222222222222222222" // 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-00000000000000000000000000000000", // missing revision "2-11111111111111111111111111111111", // missing revision "3-22222222222222222222222222222222" // 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-00000000000000000000000000000000", # missing revision "2-11111111111111111111111111111111", # missing revision "3-22222222222222222222222222222222" # 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 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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/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}/_shardsstyle 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 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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/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 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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/_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 forreplicationtype tasks.Possible values: 0 ≤ value ≤ 9007199254740991
The total count of successful docs fetched with
_bulk_get. Available forreplicationtype tasks.Possible values: 0 ≤ value ≤ 9007199254740991
Processed changes. Available for
database_compaction,indexer,search_indexer,view_compactiontype tasks.Possible values: 0 ≤ value ≤ 9007199254740991
The count of changes not yet replicated. Available for
replicationtype tasks.Possible values: 0 ≤ value ≤ 9007199254740991
Specifies the checkpoint interval in ms. Available for
replicationtype tasks.Possible values: 0 ≤ value ≤ 2147483647
The source sequence id which was last successfully replicated. Available for
replicationtype tasks.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([1-9]\d*-[A-Za-z0-9-_]+)$The replication configured to be continuous. Available for
replicationtype tasks.The design document that belongs to this task. Available for
indexer,search_indexer,view_compactiontype tasks.Possible values: 9 ≤ length ≤ 7160, Value must match regular expression
^_design\/.+$Replication document ID. Available for
replicationtype tasks.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([^_]|_(design|local)\/).+$Number of document write failures. Available for
replicationtype tasks.Possible values: 0 ≤ value ≤ 9007199254740991
Number of documents read. Available for
replicationtype tasks.Possible values: 0 ≤ value ≤ 9007199254740991
Number of documents written to target. Available for
replicationtype tasks.Possible values: 0 ≤ value ≤ 9007199254740991
The search index that belongs to this task. Available for
search_indexertype tasks.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^[^_].*$|^_all_docs$Indexer process ID. Available for
indexertype tasks.Possible values: 1 ≤ length ≤ 34, Value must match regular expression
^.+$The count of docs which have been read from the source. Available for
replicationtype tasks.Possible values: 0 ≤ value ≤ 9007199254740991
The phase the active task is in.
docid_sort,docid_copy,document_copyphases are available fordatabase_compaction, whileidsandviewphases are available forview_compactiontype 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_compactiontype tasks.Possible values: 0 ≤ value ≤ 100
Replication ID. Available for
replicationtype 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_compactiontype tasks.The count of revisions which have been checked since this replication began. Available for
replicationtype tasks.Possible values: 0 ≤ value ≤ 9007199254740991
Replication source. Available for
replicationtype 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
replicationtype tasks.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([1-9]\d*-[A-Za-z0-9-_]+)$Replication target. Available for
replicationtype tasks.Possible values: 1 ≤ length ≤ 8000, Value must match regular expression
^https:\/\/.*$The last sequence number processed by the replicator. Available for
replicationtype tasks.Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^([1-9]\d*-[A-Za-z0-9-_]+)$Total changes to process. Available for
database_compaction,indexer,search_indexer,view_compactiontype tasks.Possible values: 0 ≤ value ≤ 9007199254740991
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_compactiontype tasks.Possible values: 0 ≤ value ≤ 4294967295
Status Code
HTTP response for
/_active_tasksstyle 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 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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/_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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X POST "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/_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{ cloudantv1.ActivityTrackerEventsTypesManagementConst, cloudantv1.ActivityTrackerEventsTypesDataConst, }, ) 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.ActivityTrackerEvents; 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(ActivityTrackerEvents.Types.MANAGEMENT) .addTypes(ActivityTrackerEvents.Types.DATA) .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: [ CloudantV1.ActivityTrackerEvents.Constants.Types.MANAGEMENT, CloudantV1.ActivityTrackerEvents.Constants.Types.DATA ], }).then(response => { console.log(response.result); });
from ibmcloudant.cloudant_v1 import CloudantV1, ActivityTrackerEvents service = CloudantV1.new_instance() response = service.post_activity_tracker_events( types=[ ActivityTrackerEvents.TypesEnum.MANAGEMENT, ActivityTrackerEvents.TypesEnum.DATA ] ).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,
) -> DetailedResponseRequest
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" }
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,
) -> DetailedResponseRequest
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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/_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" }
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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/_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
/_membershipstyle 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 information about whether the server is up
Confirms that the server is up, running, and ready to respond to
requests. If the cluster is unavailable the endpoint returns
a 503 response code.
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 the cluster is unavailable the endpoint returns a 503 response code.
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 the cluster is unavailable the endpoint returns a 503 response code.
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 the cluster is unavailable the endpoint returns a 503 response code.
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 the cluster is unavailable the endpoint returns a 503 response code.
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,
) -> DetailedResponseRequest
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 A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" -X GET "https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud/_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 { if response.GetStatusCode() == 503 { fmt.Println("Service is unavailable: Status code:", response.GetStatusCode()) } else { fmt.Println("Issue performing health check: Status code:", response.GetStatusCode()) } return } fmt.Println("Service is up and healthy") b, _ := json.MarshalIndent(upInformation, "", " ") fmt.Println(string(b))
import com.ibm.cloud.cloudant.v1.Cloudant; import com.ibm.cloud.cloudant.v1.model.UpInformation; import com.ibm.cloud.sdk.core.http.Response; import com.ibm.cloud.sdk.core.service.exception.ServiceResponseException; import com.ibm.cloud.sdk.core.service.exception.ServiceUnavailableException;Cloudant service = Cloudant.newInstance(); try { // Execute the health check Response<UpInformation> response = service.getUpInformation().execute(); // Check the status code to determine service health System.out.println("Service is up and healthy"); System.out.println(response.getResult()); } catch (ServiceUnavailableException e) { System.out.println("Service unavailable:" + " \"" + e.getMessage() + "\" " + "Status code: " + e.getStatusCode()); } catch (ServiceResponseException e) { System.out.println("Issue performing health check: \"" + e.getMessage() + "\" Status code: " + e.getStatusCode()); }
import { CloudantV1 } from '@ibm-cloud/cloudant'; const service = CloudantV1.newInstance({}); service.getUpInformation().then(response => { console.log('Service is up and healthy'); console.log(response.result); }) .catch(err => { if (err.code === 503) { console.error(`Service is unavailable, status code: ${err.code}, ${err.message}`); } else { console.error(`Issue checking service health, status: ${err.code}, ${err.message}`); } });
from ibmcloudant.cloudant_v1 import CloudantV1 from ibm_cloud_sdk_core.api_exception import ApiException service = CloudantV1.new_instance() try: response = service.get_up_information() print("Service is up and healthy") print(response.get_result()) except ApiException as ae: if ae.code == 503: print(f"Service is unavailable, status code: {ae.code}") else: print(f"Issue performing health check, status code: {ae.code}, message: {ae.http_response.reason}")
Response
Schema for information about the up state of the server.
status
Possible values: [
maintenance_mode,nolb,ok]cluster
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
^.+$seeds
Schema for information about the up state of the server.
cluster.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/seeds.
status.
Possible values: [
maintenance_mode,nolb,ok]
Schema for information about the up state of the server.
cluster.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/seeds.
status.
Possible values: [
maintenance_mode,nolb,ok]
Schema for information about the up state of the server.
cluster.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/seeds.
status.
Possible values: [
maintenance_mode,nolb,ok]
Schema for information about the up state of the server.
cluster.
Possible values: 1 ≤ length ≤ 7168, Value must match regular expression
/^.+$/seeds.
status.
Possible values: [
maintenance_mode,nolb,ok]
Status Code
HTTP response for
/_upstyle 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 UpInformation response.
{ "cluster": "bm-cc-us-east-01", "status": "ok" }Example UpInformation response.
{ "cluster": "bm-cc-us-east-01", "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 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 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,
) -> DetailedResponseRequest
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
/_upstyle operations.HTTP error for bad request.
HTTP error for unauthorized.
HTTP error for payment required.
HTTP error for forbidden.
HTTP response for
/_upstyle 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.