Create a new ChangesFollower using the supplied client and params that
+suppress transient errors and retry for as long as the given errorTolerance
duration.
CloudantV1 client instance to use to make requests
+Changes feed params
+Optional
errorTolerance: numberthe duration to suppress errors, measured from the previous
+successful request. Use 0
to disable error suppression and terminate this ChangesFollower
+on any failed request.
Return all available changes and keep listening for new changes until reaching an end condition.
+The end conditions are:
+The same change may be received more than once.
+at least one ChangesResultItem per change
+if:
+Return all available changes until there are no further changes pending or +reaching an end condition.
+The end conditions are:
+The same change may be received more than once.
+at least one ChangesResultItem per change
+if:
+Stop this ChangesFollower.
+if start +or startOneOff was not called first
+NoSQL database based on Apache CouchDB
+ +Construct a CloudantV1 object.
+Options for the service.
+Static
DEFAULT_Static
DEFAULT_Static
_loggerProtected
configureConfigure the service using external configuration +Cloudant specific extensions:
+The name of the service. Will be used to read from external +configuration.
+Protected
createDelete 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.
The parameters to send to the service.
+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.
The parameters to send to the service.
+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.
The parameters to send to the service.
+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.
The parameters to send to the service.
+Delete an index.
+Delete the index functions from the design document and index files on the server.
+The parameters to send to the service.
+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.
+The parameters to send to the service.
+Cancel a replication.
+Cancels a replication by deleting the document that describes it from the _replicator
database.
The parameters to send to the service.
+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.
+Optional
params: GetActiveTasksParamsThe parameters to send to the service.
+Retrieve Activity Tracker events information.
+Check event types that are being sent to IBM Cloud Activity Tracker for the IBM Cloudant instance.
+Optional
params: GetActivityTrackerEventsParamsThe parameters to send to the service.
+Query a list of all database names in the instance.
+Query to retrieve a list of database names from the instance.
+Optional
params: GetAllDbsParamsThe parameters to send to the service.
+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.
+The parameters to send to the service.
+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.
+Optional
params: GetCapacityThroughputInformationParamsThe parameters to send to the service.
+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.
+Optional
params: GetCorsInformationParamsThe parameters to send to the service.
+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.
+Optional
params: GetCurrentThroughputInformationParamsThe parameters to send to the service.
+Retrieve information about a database.
+Retrieve detailed information about the database.
+The parameters to send to the service.
+Retrieve change events for all databases.
+This endpoint is not available in IBM Cloudant.
+Lists changes to databases, like a global changes feed. Types of changes include updating the database and creating +or deleting a database. Like the changes feed, the feed is not guaranteed to return changes in the correct order +and might repeat changes. Polling modes for this method work like polling modes for the changes feed.
+Optional
params: GetDbUpdatesParamsThe parameters to send to the service.
+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.
The parameters to send to the service.
+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.
+The parameters to send to the service.
+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.
The parameters to send to the service.
+Retrieve a document as mixed.
+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.
The parameters to send to the service.
+Retrieve a document as related.
+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.
The parameters to send to the service.
+Retrieve a document as stream.
+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.
The parameters to send to the service.
+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.
+The parameters to send to the service.
+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.
The parameters to send to the service.
+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.
+The parameters to send to the service.
+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.
Optional
params: GetMembershipInformationParamsThe parameters to send to the service.
+Retrieve information about a database partition.
+Given a partition key, return the database name, sizes, partition, doc count, and doc delete count.
+The parameters to send to the service.
+Retrieve a replication document.
+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.
The parameters to send to the service.
+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.
+Optional
params: GetSchedulerDocsParamsThe parameters to send to the service.
+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.
+The parameters to send to the service.
+Retrieve a replication scheduler job.
+Retrieves the state of a single replication task based on its replication ID.
+The parameters to send to the service.
+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.
Optional
params: GetSchedulerJobsParamsThe parameters to send to the service.
+Retrieve information about a search index.
+Retrieve search index metadata information, such as the size of the index on disk.
+The parameters to send to the service.
+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.
The parameters to send to the service.
+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.
+Optional
params: GetServerInformationParamsThe parameters to send to the service.
+Retrieve current session cookie information.
+Retrieves information about the authenticated user's session.
+Optional
params: GetSessionInformationParamsThe parameters to send to the service.
+Retrieve shard information.
+List each shard range and the corresponding replicas for a specified database.
+The parameters to send to the service.
+Retrieve information about whether the server is up.
+Confirms that the server is up, running, and ready to respond to requests. If maintenance_mode
is true
or
+nolb
, the endpoint returns a 404 response.
Tip: The authentication for this endpoint is only enforced when using IAM.
+Optional
params: GetUpInformationParamsThe parameters to send to the service.
+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.
+Optional
params: GetUuidsParamsThe parameters to send to the service.
+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.
The parameters to send to the service.
+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.
+The parameters to send to the service.
+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.
The parameters to send to the service.
+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.
The parameters to send to the service.
+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.
+The parameters to send to the service.
+Retrieve the HTTP headers for a replication document.
+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.
The parameters to send to the service.
+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.
+The parameters to send to the service.
+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.
+The parameters to send to the service.
+Retrieve HTTP headers about whether the server is up.
+Retrieves the HTTP headers about whether the server is up.
+Optional
params: HeadUpInformationParamsThe parameters to send to the service.
+Modify Activity Tracker events configuration.
+Configure event types that are being sent to IBM Cloud Activity Tracker for the IBM Cloudant instance.
+The parameters to send to the service.
+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.
+The parameters to send to the service.
+Query a list of all documents in a database as stream.
+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.
+The parameters to send to the service.
+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.
The parameters to send to the service.
+Multi-query the list of all documents in a database as stream.
+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.
The parameters to send to the service.
+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.
+Optional
params: PostApiKeysParamsThe parameters to send to the service.
+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 parameters to send to the service.
+Bulk query revision information for multiple documents.
+Fetch specific revisions or revision histories for multiple documents in bulk as replicators do.
+The parameters to send to the service.
+Bulk query revision information for multiple documents as mixed.
+Fetch specific revisions or revision histories for multiple documents in bulk as replicators do.
+The parameters to send to the service.
+Bulk query revision information for multiple documents as related.
+Fetch specific revisions or revision histories for multiple documents in bulk as replicators do.
+The parameters to send to the service.
+Bulk query revision information for multiple documents as stream.
+Fetch specific revisions or revision histories for multiple documents in bulk as replicators do.
+The parameters to send to the service.
+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.
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.
The parameters to send to the service.
+Query the database document changes feed as stream.
+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.
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.
The parameters to send to the service.
+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.
The parameters to send to the service.
+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.
+The parameters to send to the service.
+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.
The parameters to send to the service.
+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.
The parameters to send to the service.
+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.
The parameters to send to the service.
+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 will fallback to using the built-in _all_docs
index. This is not
+recommended because it has a significant performance impact causing a full scan of the database with each request.
+In this case the response body will include a warning field recommending that an index is created.
The parameters to send to the service.
+Query an index by using selector syntax as stream.
+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 will fallback to using the built-in _all_docs
index. This is not
+recommended because it has a significant performance impact causing a full scan of the database with each request.
+In this case the response body will include a warning field recommending that an index is created.
The parameters to send to the service.
+Create a new index on a database.
+Create a new index on a database.
+The parameters to send to the service.
+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.
+The parameters to send to the service.
+Query a list of all documents in a database partition as stream.
+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.
+The parameters to send to the service.
+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.
The parameters to send to the service.
+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 will fallback to using the built-in _all_docs
index. This is not
+recommended because it has a noticeable performance impact causing a full scan of the partition with each request.
+In this case the response body will include a warning field recommending that an index is created.
The parameters to send to the service.
+Query a database partition index by using selector syntax as stream.
+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 will fallback to using the built-in _all_docs
index. This is not
+recommended because it has a noticeable performance impact causing a full scan of the partition with each request.
+In this case the response body will include a warning field recommending that an index is created.
The parameters to send to the service.
+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.
+The parameters to send to the service.
+Query a database partition search index as stream.
+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.
+The parameters to send to the service.
+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.
The parameters to send to the service.
+Query a database partition MapReduce view function as stream.
+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.
The parameters to send to the service.
+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 parameters to send to the service.
+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.
The parameters to send to the service.
+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.
+The parameters to send to the service.
+Query a search index as stream.
+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.
The parameters to send to the service.
+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.
The parameters to send to the service.
+Query a MapReduce view as stream.
+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.
The parameters to send to the service.
+Multi-query a MapReduce view.
+This operation runs multiple specified view queries against the view function from the specified design document.
+The parameters to send to the service.
+Multi-query a MapReduce view as stream.
+This operation runs multiple specified view queries against the view function from the specified design document.
+The parameters to send to the service.
+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.
The parameters to send to the service.
+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.
+The parameters to send to the service.
+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.
+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
.
The parameters to send to the service.
+Modify CORS configuration.
+Sets the CORS configuration. The configuration applies to all databases and all account level endpoints in your +account.
+The parameters to send to the service.
+Create a database.
+Create a new database with the requested properties.
+The parameters to send to the service.
+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 parameters to send to the service.
+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.
+The parameters to send to the service.
+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.
+The parameters to send to the service.
+Create or modify a replication using a replication document.
+Creates or modifies a document in the _replicator
database to start a new replication or to edit an existing
+replication.
The parameters to send to the service.
+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.
+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
.
The parameters to send to the service.
+Static
newConstructs an instance of CloudantV1 with passed in options and external configuration.
+Optional
options: UserOptionsThe parameters to send to the service.
+Schema for information about a running task.
+Optional
bulkThe total count of attempted doc revisions fetched with _bulk_get
. Available for replication
type tasks.
Optional
bulkThe total count of successful docs fetched with _bulk_get
. Available for replication
type tasks.
Optional
changesProcessed changes. Available for database_compaction
, indexer
, search_indexer
, view_compaction
type
+tasks.
Optional
changesThe count of changes not yet replicated. Available for replication
type tasks.
Optional
checkpointSpecifies the checkpoint interval in ms. Available for replication
type tasks.
Optional
checkpointedThe source sequence id which was last successfully replicated. Available for replication
type tasks.
Optional
continuousThe replication configured to be continuous. Available for replication
type tasks.
Source database.
+Optional
designThe design document that belongs to this task. Available for indexer
, search_indexer
, view_compaction
+type tasks.
Optional
docReplication document ID. Available for replication
type tasks.
Optional
docNumber of document write failures. Available for replication
type tasks.
Optional
docsNumber of documents read. Available for replication
type tasks.
Optional
docsNumber of documents written to target. Available for replication
type tasks.
Optional
indexThe search index that belongs to this task. Available for search_indexer
type tasks.
Optional
indexerIndexer process ID. Available for indexer
type tasks.
Optional
missingThe count of docs which have been read from the source. Available for replication
type tasks.
Cluster node where the task is running.
+Optional
phaseThe phase the active task is in. docid_sort
, docid_copy
, document_copy
phases are available for
+database_compaction
, while ids
and view
phases are available for view_compaction
type tasks.
Process ID.
+Optional
processProcess status.
+Optional
progressCurrent percentage progress. Available for database_compaction
, indexer
, search_indexer
,
+view_compaction
type tasks.
Optional
replicationReplication ID. Available for replication
type tasks.
Optional
retryIndicates whether a compaction retry is currently running on the database. Available for
+database_compaction
type tasks.
Optional
revisionsThe count of revisions which have been checked since this replication began. Available for replication
+type tasks.
Optional
sourceReplication source. Available for replication
type tasks.
Optional
sourceThe last sequence number obtained from the source database changes feed. Available for replication
type
+tasks.
Schema for a Unix epoch timestamp.
+Optional
targetReplication target. Available for replication
type tasks.
Optional
throughThe last sequence number processed by the replicator. Available for replication
type tasks.
Optional
totalTotal changes to process. Available for database_compaction
, indexer
, search_indexer
,
+view_compaction
type tasks.
Operation type.
+Schema for a Unix epoch timestamp.
+Optional
userName of user running replication or owning the indexer. Available for indexer
, replication
type tasks.
Optional
viewNumber of view indexes. Available for view_compaction
type tasks.
Static
deserializeStatic
serializeSchema for Activity Tracker events.
+An array of event types that are being sent to IBM Cloud Activity Tracker for the IBM Cloudant instance. +"management" is a required element of this array.
+Static
deserializeStatic
serializeSchema for the result of an all documents queries operation.
+An array of result objects - one for each query. Each result object contains the same fields as the response
+to a regular /_all_docs
request.
Static
deserializeStatic
serializeSchema for an all documents query operation.
+Optional
attParameter to specify whether to include the encoding information in attachment stubs if the particular +attachment is compressed.
+Optional
attachmentsParameter to specify whether to include attachments bodies in a response.
+Optional
conflictsParameter to specify whether to include a list of conflicted revisions in each returned document. Active
+only when include_docs
is true
.
Optional
descendingParameter to specify whether to return the documents in descending by key order.
+Optional
endSchema for a document ID.
+Optional
includeParameter to specify whether to include the full content of the documents in the response.
+Optional
inclusiveParameter to specify whether the specified end key should be included in the result.
+Optional
keySchema for a document ID.
+Optional
keysSchema for a list of document IDs.
+Optional
limitParameter to specify the number of returned documents to limit the result to.
+Optional
skipParameter to specify the number of records before starting to return the results.
+Optional
startSchema for a document ID.
+Optional
updateParameter to specify whether to include in the response an update_seq value indicating the sequence id of +the database the view reflects.
+Static
deserializeStatic
serializeSchema for the result of an all documents operation.
+List of doc results.
+Number of total rows.
+Optional
updateCurrent update sequence for the database.
+Static
deserializeStatic
serializeSchema for a full text search analyzer.
+Optional
nameSchema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies +depending on the analyzer usage:
+standard
* For query text indexes the default is keyword
* For a query
+text index default_field the default is standard
.Optional
stopwordsCustom stopwords to use with the named analyzer.
+Static
deserializeStatic
serializeSchema for a search analyzer configuration.
+Optional
fieldsSchema for mapping a field name to a per field analyzer.
+Optional
nameSchema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies +depending on the analyzer usage:
+standard
* For query text indexes the default is keyword
* For a query
+text index default_field the default is standard
.Optional
stopwordsCustom stopwords to use with the named analyzer.
+Static
deserializeStatic
serializeSchema for api keys.
+The generated api key.
+ok.
+The password associated with the api key.
+Static
deserializeStatic
serializeSchema for an attachment.
+Optional
contentAttachment MIME type.
+Optional
dataBase64-encoded content. Available if attachment content is requested by using the query parameters
+attachments=true
or atts_since
. Note that when used with a view or changes feed include_docs
must also be
+true
.
Optional
digestContent hash digest. It starts with prefix which announce hash type (e.g. md5-
) and continues with
+Base64-encoded hash digest.
Optional
encodedCompressed attachment size in bytes. Available if content_type was in list of compressible types when the
+attachment was added and the query parameter att_encoding_info
is true
. Note that when used with a view or
+changes feed include_docs
must also be true
.
Optional
encodingCompression codec. Available if content_type was in list of compressible types when the attachment was added
+and the and the query parameter att_encoding_info
is true
. Note that when used with a view or changes feed
+include_docs
must also be true
.
Optional
followsTrue if the attachment follows in a multipart request or response.
+Optional
lengthReal attachment size in bytes. Not available if inline attachment content requested.
+Optional
revposRevision number when attachment was added.
+Optional
stubHas true
value if object contains stub info and no content. Otherwise omitted in response.
Static
deserializeStatic
serializeSchema for submitting documents for bulk modifications.
+Array of documents.
+Optional
newIf false
, prevents the database from assigning them new revision IDs. Default is true
.
Static
deserializeStatic
serializeSchema for a document item in a bulk get query.
+Optional
attsIncludes attachments only since specified revisions.
+Schema for a document ID.
+Optional
revSchema for a document revision identifier.
+Static
deserializeStatic
serializeSchema for the results object of a bulk get operation.
+Static
deserializeStatic
serializeSchema for BulkGetResult object containing a successfully retrieved document or error information.
+Optional
errorSchema for the result of a document modification.
+Optional
okSchema for a document.
+Static
deserializeStatic
serializeSchema for the document revisions information from a bulk get operation.
+Array of document revisions or error information.
+Schema for a document ID.
+Static
deserializeStatic
serializeSchema for information about the currently provisioned and target throughput capacity.
+Detailed information about provisioned throughput capacity.
+Optional
targetDetailed information about target throughput capacity.
+Static
deserializeStatic
serializeDetailed information about provisioned throughput capacity.
+Schema for detailed information about throughput capacity with breakdown by specific throughput requests +classes.
+Static
deserializeStatic
serializeDetailed information about target throughput capacity.
+Schema for detailed information about throughput capacity with breakdown by specific throughput requests +classes.
+Static
deserializeStatic
serializeSchema for a document leaf with single field rev.
+Static
deserializeStatic
serializeSchema for normal changes feed result.
+Static
deserializeStatic
serializeSchema for an item in the changes results array.
+List of document's leaves with single field rev.
+Optional
deletedif true
then the document is deleted.
Optional
docSchema for a document.
+Schema for a document ID.
+Update sequence.
+Static
deserializeStatic
serializeSchema for size information of content.
+The active size of the content, in bytes.
+The total uncompressed size of the content, in bytes.
+The total size of the content as stored on disk, in bytes.
+Static
deserializeStatic
serializeSchema 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.
+Static
deserializeStatic
serializeSchema for information about current consumption of a provisioned throughput capacity.
+Static
deserializeStatic
serializeDetailed information about current consumption.
+Number of global queries conducted against the instance for a given second.
+Number of reads conducted against the instance for a given second.
+Number of writes conducted against the instance for a given second.
+Static
deserializeStatic
serializeSchema for information about a database.
+Schema for database cluster information.
+Optional
committedAn opaque string that describes the committed state of the database.
+True if the database compaction routine is operating on this database.
+Optional
compactedAn opaque string that describes the compaction state of the database.
+The name of the database.
+The version of the physical format used for the data when it is stored on disk.
+A count of the documents in the specified database.
+Number of deleted documents.
+Optional
engineThe engine used for the database.
+An opaque string to detect whether a database has been recreated. The field name is for compatibility with +old replicator versions. Do not use the value to infer timing infromation. Typically only used by replicators.
+Optional
partitionedInformation about database's partitioned indexes.
+Schema for database properties.
+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.
+Optional
uuidThe UUID of the database.
+Static
deserializeStatic
serializeSchema for database cluster information.
+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.
+Schema for the number of shards in a database. Each shard is a partition of the hash value range.
+Read quorum. The number of consistent copies of a document that need to be read before a successful reply.
+Write quorum. The number of copies of a document that need to be written before a successful reply.
+Static
deserializeStatic
serializeSchema for database properties.
+Static
deserializeStatic
serializeSchema for a database change event.
+Database name.
+Sequence number.
+A database event.
+Static
deserializeStatic
serializeSchema for database updates.
+Static
deserializeStatic
serializeSchema for database information keyed by database name.
+Optional
errorThe name of the error.
+Optional
infoSchema for information about a database.
+Database name.
+Static
deserializeStatic
serializeSchema for a design document.
+This type supports additional properties of type any.
+DesignDocument accepts additional properties of type any.
+Optional
_attachmentsSchema for a map of attachment name to attachment metadata.
+Optional
_conflictsSchema for a list of document revision identifiers.
+Optional
_deletedDeletion flag. Available if document was removed.
+Optional
_deleted_Schema for a list of document revision identifiers.
+Optional
_idSchema for a design document ID.
+Optional
_local_Document's update sequence in current database. Available if requested with local_seq=true query parameter.
+Optional
_revSchema for a document revision identifier.
+Optional
_revisionsSchema for list of revision information.
+Optional
_revs_Schema for a list of objects with information about local revisions and their status.
+Optional
autoupdateIndicates whether to automatically build indexes defined in this design document.
+Optional
filtersSchema 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,
+see DatabaseInformation
.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 the UserContext
.secObj
: Security Object, with lists of database security roles,
+see the SecurityObject
.uuid
- string, generated UUID by a specified algorithm in the
+config file.Filter functions must return true if a document passed all the rules.
+Optional
indexesSearch (text) index function definitions.
+Optional
languageDefines Query Server key to process design document functions.
+Optional
optionsSchema for design document options.
+Optional
validateValidate 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 the UserContext
.secObj
- Security Object, with lists of database security roles,
+see the SecurityObject
.Optional
viewsSchema for design document views.
+Static
deserializeStatic
serializeSchema for information about a design document.
+Static
deserializeStatic
serializeSchema for design document options.
+Optional
partitionedWhether this design document describes partitioned or global indexes.
+Static
deserializeStatic
serializeView index information.
+List of collator versions. If there are multiple entries this implies a libicu upgrade has occurred but +compaction has not run yet.
+Indicates whether a compaction routine is currently running on the view.
+Language for the defined views.
+MD5 signature of the views for the design document.
+Schema for size information of content.
+Indicates if the view is currently being updated.
+Schema for an ability to tell if view is up-to-date without querying it.
+Number of clients waiting on views from this design document.
+Indicates if there are outstanding commits to the underlying database that need to processed.
+Static
deserializeStatic
serializeSchema for view functions definition.
+JavaScript map function as a string.
+Optional
reduceJavaScript reduce function as a string.
+Static
deserializeStatic
serializeSchema for a row of document information in a DocsResult.
+Optional
causedThe cause of the error (if available).
+Optional
docSchema for a document.
+Optional
errorThe name of the error.
+Optional
idid.
+Document ID.
+Optional
reasonThe reason the error occurred (if available).
+Optional
refAn internal error reference (if available).
+Optional
valueValue of built-in /_all_docs
style view.
Static
deserializeStatic
serializeValue of built-in /_all_docs
style view.
Optional
deletedIf true
then the document is deleted. Not present for undeleted documents.
Schema for a document revision identifier.
+Static
deserializeStatic
serializeSchema for a document.
+This type supports additional properties of type any.
+Document accepts additional properties of type any.
+Optional
_attachmentsSchema for a map of attachment name to attachment metadata.
+Optional
_conflictsSchema for a list of document revision identifiers.
+Optional
_deletedDeletion flag. Available if document was removed.
+Optional
_deleted_Schema for a list of document revision identifiers.
+Optional
_idSchema for a document ID.
+Optional
_local_Document's update sequence in current database. Available if requested with local_seq=true query parameter.
+Optional
_revSchema for a document revision identifier.
+Optional
_revisionsSchema for list of revision information.
+Optional
_revs_Schema for a list of objects with information about local revisions and their status.
+Static
deserializeStatic
serializeSchema for the result of a document modification.
+Optional
causedThe cause of the error (if available).
+Optional
errorThe name of the error.
+Schema for a document ID.
+Optional
okok.
+Optional
reasonThe reason the error occurred (if available).
+Optional
refAn internal error reference (if available).
+Optional
revSchema for a document revision identifier.
+Static
deserializeStatic
serializeSchema for information about revisions and their status.
+Schema for a document revision identifier.
+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.
Static
deserializeStatic
serializeSchema for document shard information.
+List of nodes serving a replica of the shard.
+The shard range in which the document is stored.
+Static
deserializeStatic
serializeSchema for find query execution statistics.
+Time to execute the query.
+Number of results returned.
+Number of documents fetched from the index.
+Number of rows scanned in the index.
+Number of documents fetched from the primary index with the specified read quorum.
+Static
deserializeStatic
serializeSchema 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.
Name of database.
+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.
+Schema for information about an index.
+Optional
indexSchema for the list of all the other indexes that were not chosen for serving the query.
+The used maximum number of results returned.
+Optional
mrargsArguments passed to the underlying view.
+Options used for the request.
+Optional
partitionedSchema 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:
+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:
+$eq
operator matches when the specified field contains a value that is equal to the
+supplied argument. See the Cloudant Docs for a
+list of all available combination and conditional operators.$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.For further reference see +selector syntax.
+Optional
selectorSchema for a list of objects with extra information on the selector to provide insights about its usability.
+Skip parameter used.
+Static
deserializeStatic
serializeArguments passed to the underlying view.
+Optional
conflictsSchema for any JSON type.
+Optional
directionDirection parameter passed to the underlying view.
+Optional
endSchema for any JSON type.
+Optional
includeA parameter that specifies whether to include the full content of the documents in the response in the +underlying view.
+Optional
partitionPartition parameter passed to the underlying view.
+Optional
reduceA parameter that specifies returning only documents that match any of the specified keys in the underlying +view.
+Optional
stableA parameter that specifies whether the view results should be returned form a "stable" set of shards passed +to the underlying view.
+Optional
startSchema for any JSON type.
+Optional
updateSchema for any JSON type.
+Optional
viewThe type of the underlying view.
+Static
deserializeStatic
serializeOptions used for the request.
+Opaque bookmark token used when paginating results.
+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.
+Limit used in the request query.
+On which database partition the request was used. If it was not used on a database partition, it returns
+with ""
.
The read quorum that is needed for the result.
+Skip used in the request query.
+Schema for any JSON type.
+Stable used in the request query.
+Deprecated: Stale used in the request query.
+Update used in the request query.
+Use index used in the request query.
+Static
deserializeStatic
serializeSchema for the result of a query find operation.
+Opaque bookmark token used when paginating results.
+Documents matching the selector.
+Optional
executionSchema for find query execution statistics.
+Optional
warningwarning.
+Static
deserializeStatic
serializeSchema for detailed explanation of why the specific index was excluded by the query planner.
+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.
+A list of reasons explaining why index was not chosen for the query.
+Indicates whether an index can still be used for the query.
+Static
deserializeStatic
serializeA reason for index's exclusion.
+Optional
nameA reason code for index's exclusion.
+The full list of possible reason codes is following:
+Static
deserializeStatic
serializeSchema for an index that was not chosen for serving the query with the reason for the exclusion.
+Schema for detailed explanation of why the specific index was excluded by the query planner.
+Schema for information about an index.
+Static
deserializeStatic
serializeSchema for a json
or text
query index definition. Indexes of type text
have additional configuration
+properties that do not apply to json
indexes, these are:
default_analyzer
- the default text analyzer to use * default_field
- whether to index the text in all
+document fields and what analyzer to use for that purpose.Optional
defaultSchema for a full text search analyzer.
+Optional
defaultSchema for the text index default field configuration. The default field is used to index the text of all
+fields within a document for use with the $text
operator.
Optional
fieldsList of field objects to index. Nested fields are also allowed, e.g. person.name
.
For "json" type indexes each object is a mapping of field name to sort direction (asc or desc).
+For "text" type indexes each object has a name
property of the field name and a type
property of the field
+type (string, number, or boolean).
Optional
indexWhether to scan every document for arrays and store the length for each array found. Set the +index_array_lengths field to false if:
+$size
operator. * The documents in your
+database are complex, or not completely under your control. As a result, it is difficult to estimate the impact
+of the extra processing that is needed to determine and store the arrays lengths.Optional
partialJSON 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:
+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:
+$eq
operator matches when the specified field contains a value that is equal to the
+supplied argument. See the Cloudant Docs for a
+list of all available combination and conditional operators.$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.For further reference see +selector syntax.
+Static
deserializeStatic
serializeSchema for indexed fields for use with declarative JSON query.
+This type supports additional properties of type string. Schema for sort direction.
+IndexField accepts additional properties of type string. Schema for sort direction.
+Optional
nameName of the field.
+Optional
typeThe type of the named field.
+Static
deserializeStatic
serializeSchema for information about an index.
+Design document ID including a _design/
prefix.
Schema for a json
or text
query index definition. Indexes of type text
have additional configuration
+properties that do not apply to json
indexes, these are:
default_analyzer
- the default text analyzer to use * default_field
- whether to index the text in all
+document fields and what analyzer to use for that purpose.Index name.
+Optional
partitionedIndicates if index is partitioned.
+Schema for the type of an index.
+Static
deserializeStatic
serializeSchema for the result of creating an index.
+Id of the design document the index was created in.
+Name of the index created.
+Flag to show whether the index was created or one already exists.
+Static
deserializeStatic
serializeSchema for the text index default field configuration. The default field is used to index the text of all fields
+within a document for use with the $text
operator.
Optional
analyzerSchema for a full text search analyzer.
+Optional
enabledWhether or not the default_field is enabled.
+Static
deserializeStatic
serializeSchema for information about the indexes in a database.
+Static
deserializeStatic
serializeA standard JS object, defined to avoid the limitations of Object
and object
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.
+All cluster nodes.
+Static
deserializeStatic
serializeSchema for an OK result.
+Static
deserializeStatic
serializeSchema for information about a database partition.
+The name of the database.
+A count of the documents in the specified database partition.
+Number of deleted documents.
+The name of the partition in the database.
+Optional
partitionedSchema for information about the partition index count and limit in a database.
+The size of active and external data, in bytes.
+Static
deserializeStatic
serializeSchema for information about the partition index count and limit in a database.
+Optional
countTotal count of the partitioned indexes.
+Optional
indexesThe count breakdown of partitioned indexes.
+Optional
limitThe partitioned index limit.
+Static
deserializeStatic
serializeThe count breakdown of partitioned indexes.
+Optional
searchNumber of partitioned search indexes.
+Optional
viewNumber of partitioned view indexes.
+Static
deserializeStatic
serializeThe size of active and external data, in bytes.
+Optional
activeThe size of live data inside the database, in bytes.
+Optional
externalThe uncompressed size of database contents in bytes.
+Static
deserializeStatic
serializeNumber of partitioned indexes by type.
+Optional
searchNumber of partitioned indexes of search type.
+Optional
viewNumber of partitioned indexes of view type.
+Static
deserializeStatic
serializeInformation about database's partitioned indexes.
+Optional
countTotal number of partitioned indexes in the database.
+Optional
indexesNumber of partitioned indexes by type.
+Optional
limitMaximum allowed number of partitioned indexes in the database.
+Static
deserializeStatic
serializeRequest parameters to use during target database creation.
+Optional
nSchema 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.
+Optional
partitionedParameter to specify whether to enable database partitions when creating the target database.
+Optional
qSchema for the number of shards in a database. Each shard is a partition of the hash value range.
+Static
deserializeStatic
serializeSchema for a replication source or target database.
+Optional
authSchema for replication source or target database authentication.
+Optional
headersReplication request headers.
+Replication database URL.
+Static
deserializeStatic
serializeSchema for replication source or target database authentication.
+Optional
basicSchema for basic authentication of replication source or target database.
+Optional
iamSchema for an IAM API key for replication database authentication.
+Static
deserializeStatic
serializeSchema for basic authentication of replication source or target database.
+The password associated with the username.
+The username.
+Static
deserializeStatic
serializeSchema for an IAM API key for replication database authentication.
+Static
deserializeStatic
serializeSchema for a replication document. Note that selector
, doc_ids
, and filter
are incompatible with each other.
This type supports additional properties of type any.
+ReplicationDocument accepts additional properties of type any.
+Optional
_attachmentsSchema for a map of attachment name to attachment metadata.
+Optional
_conflictsSchema for a list of document revision identifiers.
+Optional
_deletedDeletion flag. Available if document was removed.
+Optional
_deleted_Schema for a list of document revision identifiers.
+Optional
_idSchema for a document ID.
+Optional
_local_Document's update sequence in current database. Available if requested with local_seq=true query parameter.
+Optional
_revSchema for a document revision identifier.
+Optional
_revisionsSchema for list of revision information.
+Optional
_revs_Schema for a list of objects with information about local revisions and their status.
+Optional
cancelCancels the replication.
+Optional
checkpointDefines replication checkpoint interval in milliseconds.
+Optional
connectionHTTP connection timeout per replication. Even for very fast/reliable networks it might need to be increased +if a remote database is too busy.
+Optional
continuousConfigure the replication to be continuous.
+Optional
createCreates the target database. Requires administrator privileges on target server.
+Optional
createRequest parameters to use during target database creation.
+Optional
docSchema for a list of document IDs.
+Optional
filterThe 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.
+Optional
httpMaximum number of HTTP connections per replication.
+Optional
ownerThe 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.
+Optional
querySchema for a map of string key value pairs, such as query parameters.
+Optional
retriesNumber 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.
+Optional
selectorJSON 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:
+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:
+$eq
operator matches when the specified field contains a value that is equal to the
+supplied argument. See the Cloudant Docs for a
+list of all available combination and conditional operators.$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.For further reference see +selector syntax.
+Optional
sinceStart the replication at a specific sequence value.
+Optional
socketReplication socket options.
+Schema for a replication source or target database.
+Optional
sourceDeprecated: 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.
+Schema for a replication source or target database.
+Optional
targetDeprecated: 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.
+Optional
useSpecify whether to use _bulk_get for fetching documents from the source. If unset, the server configured +default will be used.
+Optional
useSpecify if checkpoints should be saved during replication. Using checkpoints means a replication can be +efficiently resumed.
+Optional
userSchema for the user context of a session.
+Optional
winningReplicate 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.
+Optional
workerControls how many documents are processed. After each batch a checkpoint is written so this controls how +frequently checkpointing occurs.
+Optional
workerControls how many separate processes will read from the changes manager and write to the target. A higher +number can improve throughput.
+Static
deserializeStatic
serializeSchema for list of revision information.
+Array of valid revision IDs, in reverse order (latest first).
+Prefix number for the latest revision.
+Static
deserializeStatic
serializeSchema for information about missing revs and possible ancestors.
+Optional
missingList of missing revisions.
+Optional
possibleList of possible ancestor revisions.
+Static
deserializeStatic
serializeSchema for a listing of replication scheduler documents.
+Array of replication scheduler doc objects.
+Number of total rows.
+Static
deserializeStatic
serializeSchema for a replication scheduler document.
+Database where replication document came from.
+Replication document ID.
+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.
+Replication ID, or null if state is completed or failed.
+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.
+Optional
nodeCluster node where the job is running.
+Optional
sourceReplication source.
+Optional
sourceDeprecated: Forbidden in IBM Cloudant mediated replications.
+Address of the (http or socks5 protocol) proxy server through which replication with the source database occurs.
+Timestamp of when the replication was started.
+Schema for replication state.
+Optional
targetReplication target.
+Optional
targetDeprecated: Forbidden in IBM Cloudant mediated replications.
+Address of the (http or socks5 protocol) proxy server through which replication with the target database occurs.
+Static
deserializeStatic
serializeSchema 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.
+Optional
changesThe count of changes not yet replicated.
+Optional
checkpointedThe source sequence id which was last successfully replicated.
+Optional
docThe count of docs which failed to be written to the target.
+Optional
docsThe count of docs which have been read from the source.
+Optional
docsThe count of docs which have been written to the target.
+Optional
errorReplication error message.
+Optional
missingThe count of revisions which were found on the source, but missing from the target.
+Optional
revisionsThe count of revisions which have been checked since this replication began.
+Optional
sourceThe last sequence number obtained from the source database changes feed.
+Optional
throughThe last sequence number processed by the replicator.
+Static
deserializeStatic
serializeSchema for a replication scheduler job.
+Replication document database.
+Replication document ID.
+Timestamped history of events as a list of objects.
+Schema for a replication job id.
+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.
+Replication process ID.
+Replication source.
+Timestamp of when the replication was started.
+Replication target.
+Name of user running replication.
+Static
deserializeStatic
serializeSchema for a replication scheduler job event.
+Optional
reasonReason for current state of event.
+Timestamp of the event.
+Type of the event.
+Static
deserializeStatic
serializeSchema for a listing of replication scheduler jobs.
+Static
deserializeStatic
serializeSchema for the output of testing search analyzer tokenization.
+Static
deserializeStatic
serializeSchema for a search index definition.
+Optional
analyzerSchema for a search analyzer configuration.
+String form of a JavaScript function that is called for each document in the database. The function takes
+the document as a parameter, extracts some data from it, and then calls the index
function to index that data.
+The index function takes 2, or optionally 3, parameters.
The first parameter is the name of the field you intend to use when
+querying the index. If the special value "default"
is used when you
+define the name, you do not have to specify a field name at query time.
The second parameter is the data to be indexed. This data must be only a +string, number, or boolean. Other types will cause an error to be thrown +by the index function call.
+The optional third parameter is a JavaScript object with these +properties:
+facet
- boolean, default false
- Creates a faceted index.index
- boolean, default true
- If set to false
, the data
+cannot be used for searches, but can still be retrieved from the
+index if store
is set to true
.store
- boolean, default true
- If true, the value is returned
+in the search result; otherwise, the value is not returned.Static
deserializeStatic
serializeSchema for metadata information about a search index.
+The committed sequence identifier.
+The size of the search index on disk.
+The count of the number of indexed documents.
+The number of deleted documents.
+The pending sequence identifier.
+Unique signature of the search index.
+Static
deserializeStatic
serializeSchema for search index information.
+The name of the search index prefixed by the design document ID where the index is stored.
+Schema for metadata information about a search index.
+Static
deserializeStatic
serializeSchema for the result of a query search operation.
+Optional
bookmarkOpaque bookmark token used when paginating results.
+Optional
byGrouped search matches.
+Optional
countsThe counts facet syntax returns the number of query results for each unique value of each named field.
+Optional
groupsArray of grouped search matches.
+Optional
rangesThe range facet syntax reuses the standard Lucene syntax for ranges to return counts of results that fit +into each specified category.
+Optional
rowsArray of row objects.
+Number of total rows.
+Static
deserializeStatic
serializeSchema for the result of a query search operation.
+Optional
bookmarkOpaque bookmark token used when paginating results.
+Optional
byGrouped search matches.
+Optional
countsThe counts facet syntax returns the number of query results for each unique value of each named field.
+Optional
rangesThe range facet syntax reuses the standard Lucene syntax for ranges to return counts of results that fit +into each specified category.
+Optional
rowsArray of row objects.
+Number of total rows.
+Static
deserializeStatic
serializeSchema for a row of the result of a query search operation.
+Optional
docSchema for a document.
+Schema for the fields returned by a query search operation, a map of field name to value.
+Optional
highlightsReturns the context in which a search term was mentioned so that you can display more emphasized results to +a user.
+Schema for a document ID.
+Static
deserializeStatic
serializeSchema for a security document.
+Optional
adminsSchema for names and roles to map to a database permission.
+Optional
cloudantDatabase permissions for Cloudant users and/or API keys.
+Optional
couchdbManage permissions using the _users
database only.
Optional
membersSchema for names and roles to map to a database permission.
+Static
deserializeStatic
serializeSchema for names and roles to map to a database permission.
+Optional
namesList of usernames.
+Optional
rolesList of roles.
+Static
deserializeStatic
serializeSchema for extra information on the selector.
+A list of fields in the given selector that can be used to restrict the query.
+A type of the index.
+A list of fields in the given selector that can't be used to restrict the query.
+Static
deserializeStatic
serializeSchema for information about the server instance.
+Welcome message.
+List of enabled optional features.
+List of feature flags.
+Schema for server vendor information.
+Apache CouchDB version.
+Static
deserializeStatic
serializeSchema for server vendor information.
+This type supports additional properties of type string.
+ServerVendor accepts additional properties of type string.
+Vendor name.
+Vendor variant.
+Vendor version.
+Static
deserializeStatic
serializeSchema for session authentication information.
+Optional
authenticatedauthenticated.
+Optional
authenticationauthentication_db.
+authentication_handlers.
+Static
deserializeStatic
serializeSchema for information about a session.
+Schema for session authentication information.
+ok.
+Schema for the user context of a session.
+Static
deserializeStatic
serializeSchema 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.
+Static
deserializeStatic
serializeSchema for detailed information about throughput capacity with breakdown by specific throughput requests classes.
+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.
+Provisioned global queries capacity in operations per second.
+Provisioned reads capacity in operations per second.
+Provisioned writes capacity in operations per second.
+Static
deserializeStatic
serializeSchema for information about the up state of the server.
+Static
deserializeStatic
serializeSchema for an ability to tell if view is up-to-date without querying it.
+Sum of shard copies with the least amount of work to do.
+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.
+Sum of all shard copies.
+Static
deserializeStatic
serializeSchema for the user context of a session.
+Optional
dbDatabase name in the context of the provided operation.
+User name.
+List of user roles.
+Static
deserializeStatic
serializeSchema for a set of uuids generated by the server.
+Static
deserializeStatic
serializeSchema 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.
+Static
deserializeStatic
serializeSchema for a query view operation.
+Optional
attParameter to specify whether to include the encoding information in attachment stubs if the particular +attachment is compressed.
+Optional
attachmentsParameter to specify whether to include attachments bodies in a response.
+Optional
conflictsParameter to specify whether to include a list of conflicted revisions in each returned document. Active
+only when include_docs
is true
.
Optional
descendingParameter to specify whether to return the documents in descending by key order.
+Optional
endSchema for any JSON type.
+Optional
endSchema for a document ID.
+Optional
groupParameter to specify whether to group reduced results by key. Valid only if a reduce function defined in the
+view. If the view emits key in JSON array format, then it is possible to reduce groups further based on the
+number of array elements with the group_level
parameter.
Optional
groupParameter 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.
Optional
includeParameter to specify whether to include the full content of the documents in the response.
+Optional
inclusiveParameter to specify whether the specified end key should be included in the result.
+Optional
keySchema for any JSON type.
+Optional
keysParameter to specify returning only documents that match any of the specified keys. A JSON array of keys +that match the key type emitted by the view function.
+Optional
limitParameter to specify the number of returned documents to limit the result to.
+Optional
reduceParameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce +function is defined.
+Optional
skipParameter to specify the number of records before starting to return the results.
+Optional
stableQuery parameter to specify whether use the same replica of the index on each request. The default value
+false
contacts all replicas and returns the result from the first, fastest, responder. Setting it to true
+when used in conjunction with update=false
may improve consistency at the expense of increased latency and
+decreased throughput if the selected replica is not the fastest of the available replicas.
Note: In general setting true
is discouraged and is strictly not recommended when using update=true
.
Optional
startSchema for any JSON type.
+Optional
startSchema for a document ID.
+Optional
updateParameter 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.Optional
updateParameter to specify whether to include in the response an update_seq value indicating the sequence id of +the database the view reflects.
+Static
deserializeStatic
serializeSchema for the result of a query view operation.
+rows.
+Optional
totalNumber of total rows.
+Optional
updateCurrent update sequence for the database.
+Static
deserializeStatic
serializeSchema for a row of a view result.
+Optional
causedThe cause of the error (if available).
+Optional
docSchema for a document.
+Optional
errorThe name of the error.
+Optional
idSchema for a document ID.
+Schema for any JSON type.
+Optional
reasonThe reason the error occurred (if available).
+Optional
refAn internal error reference (if available).
+Schema for any JSON type.
+Static
deserializeStatic
serializeThe CouchdbSessionAuthenticator is used to get CouchDB session authentication information to +requests.
+CouchDB Session Authenticator stores Authentication data in a Cookie Jar and +that will be used during a request. +The following token information are stored in the CookieJar.
+Cookie-Content: AuthSession=<sessionToken>; Expires=<expirationDate>; Max-Age=<refreshmentTimeInSeconds>
+ Version=1; Path=/; HttpOnly; Secure
+
+Create a new CouchdbSessionAuthenticator instance.
+Configuration options for session authentication.
+Protected
requiredProtected
tokenStatic
Readonly
AUTHTYPE_Optional
encoding: BufferEncodingThe readable.read()
method reads data out of the internal buffer and
+returns it. If no data is available to be read, null
is returned. By default,
+the data is returned as a Buffer
object unless an encoding has been
+specified using the readable.setEncoding()
method or the stream is operating
+in object mode.
The optional size
argument specifies a specific number of bytes to read. Ifsize
bytes are not available to be read, null
will be returned _unless_the stream has ended, in which
+case all of the data remaining in the internal
+buffer will be returned.
If the size
argument is not specified, all of the data contained in the
+internal buffer will be returned.
The size
argument must be less than or equal to 1 GiB.
The readable.read()
method should only be called on Readable
streams
+operating in paused mode. In flowing mode, readable.read()
is called
+automatically until the internal buffer is fully drained.
const readable = getReadableStreamSomehow();
// 'readable' may be triggered multiple times as data is buffered in
readable.on('readable', () => {
let chunk;
console.log('Stream is readable (new data received in buffer)');
// Use a loop to make sure we read all currently available data
while (null !== (chunk = readable.read())) {
console.log(`Read ${chunk.length} bytes of data...`);
}
});
// 'end' will be triggered once when there is no more data available
readable.on('end', () => {
console.log('Reached end of stream.');
});
+
+
+Each call to readable.read()
returns a chunk of data, or null
. The chunks
+are not concatenated. A while
loop is necessary to consume all data
+currently in the buffer. When reading a large file .read()
may return null
,
+having consumed all buffered content so far, but there is still more data to
+come not yet buffered. In this case a new 'readable'
event will be emitted
+when there is more data in the buffer. Finally the 'end'
event will be
+emitted when there is no more data to come.
Therefore to read a file's whole contents from a readable
, it is necessary
+to collect chunks across multiple 'readable'
events:
const chunks = [];
readable.on('readable', () => {
let chunk;
while (null !== (chunk = readable.read())) {
chunks.push(chunk);
}
});
readable.on('end', () => {
const content = chunks.join('');
});
+
+
+A Readable
stream in object mode will always return a single item from
+a call to readable.read(size)
, regardless of the value of thesize
argument.
If the readable.read()
method returns a chunk of data, a 'data'
event will
+also be emitted.
Calling read after the 'end'
event has
+been emitted will return null
. No runtime error will be raised.
Optional
size: numberOptional argument to specify how much data to read.
+The phase the active task is in. docid_sort
, docid_copy
, document_copy
phases are available for database_compaction
, while ids
and view
phases are available for view_compaction
type tasks.
Process status.
+Operation type.
+An array of event types that are being sent to IBM Cloud Activity Tracker for the IBM Cloudant instance. "management" is a required element of this array.
+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 is keyword
* For a query text index default_field the default is standard
.
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 is keyword
* For a query text index default_field the default is standard
.
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
+Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
+Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
+Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
+Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
+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.
Query parameter to specify the changes feed type.
+The type of the response: application/json, multipart/mixed, multipart/related, or application/octet-stream.
+Query parameter to include only replication documents in the specified states. String must be a comma-delimited string.
+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.
+Query parameter to specify the changes feed type.
+Query parameter to specify the changes feed type.
+The type of the response: application/json or 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.
+The type of the input.
+Do not wait for the index to finish building to return results.
+Do not wait for the index to finish building to return results.
+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.
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.
The analyzer type that is being used at the tokenization.
+Do not wait for the index to finish building to return results.
+Do not wait for the index to finish building to return results.
+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.
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.
Database permissions for Cloudant users and/or API keys.
+Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
+Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
+The type of the input.
+Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
+The type of the input.
+Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
+Database permissions for Cloudant users and/or API keys.
+Schema for replication state.
+status.
+List of user roles.
+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.
IBM Cloudant Node.js SDK is a client library that interacts with the +IBM Cloudant APIs.
+Disclaimer: This library is still a 0.x release. We do consider this +library production-ready and capable, but there are still some +limitations we’re working to resolve, and refinements we want to +deliver. We are working really hard to minimise the disruption from +now until the 1.0 release, but there may still be some changes that +impact applications using this SDK. For now, be sure to pin versions +to avoid surprises.
+The IBM Cloudant Node.js SDK allows developers to programmatically
+interact with IBM Cloudant
+with the help of the @ibm-cloud/cloudant
package.
The purpose of this Node.js SDK is to wrap most of the HTTP request APIs +provided by Cloudant and supply other functions to ease the usage of Cloudant. +This SDK should make life easier for programmers to do what’s really important +to them: developing software.
+Reasons why you should consider using Cloudant Node.js SDK in your +project:
+Promise
based design with asynchronous HTTP requests.npm install @ibm-cloud/cloudant
+
+
+For fundamental SDK usage information and config options, please see the common IBM Cloud SDK documentation.
+This library requires configuration with a service URL and +Cloudant service credentials to authenticate with your +account.
+There are several ways to set these authentication properties:
+The following section describes the different authentication types and provides environment variable examples. +Examples for other configuration methods are available by following the provided links.
+This library requires credentials to authenticate with IBM Cloudant. These credentials may be:
+CONTAINER
, VPC
and IAM
)
+COUCHDB_SESSION
and BASIC
)
+IAM only
.For other compatible APIs that are not Cloudant accounts (e.g. Apache CouchDB) non-IAM based authentication types +must be used.
+This table summarizes the available authentication types. +The authentication types are listed in order of recommendation, preferably use the authentication type +from the first row in the table that is compatible with your environment.
+Authentication type | +Recommended for | +AUTH_TYPE |
+Description | +
---|---|---|---|
IAM Trusted Profiles compute resource (container) | +Cloudant (SDK running in IBM Cloud IKS) |
+CONTAINER |
+Obtains a compute resource (CR) token from the container. Exchanges the CR token for an IAM access_token .Adds an Authorization: Bearer <access_token> header to each HTTP request.Automatically renews the access token when needed. |
+
IAM Trusted Profiles compute resource (VPC) | +Cloudant (SDK running in IBM Cloud VPC) |
+VPC |
+Obtains an identity token from the VPC instance metadata. Exchanges the identity token for an IAM access_token .Adds an Authorization: Bearer <access_token> header to each HTTP request.Automatically renews the access token when needed. |
+
IAM API key | +Cloudant | +IAM |
+Exchanges an IAM API key for an IAM access_token .Adds an Authorization: Bearer <access_token> header to each HTTP request.Automatically renews the access token when needed. |
+
Session cookie | +Cloudant (legacy credentials & instances without IAM) Apache CouchDB |
+COUCHDB_SESSION |
+Exchanges credentials with /_session endpoint to retrieve a cookie.Adds Cookie header and content to each HTTP request.Automatically renews session when needed. |
+
Bearer token | +Apache CouchDB (using JWT authentication) |
+BEARERTOKEN |
+Adds an Authorization: Bearer <token> to each HTTP request.No token management or renewal. Also compatible with IAM access tokens managed independently of the SDK. |
+
Basic | +Apache CouchDB (if cookies are not enabled) |
+BASIC |
+Adds an Authorization: Basic <encoded username and password> header to each HTTP request. |
+
None | +- | +NOAUTH |
+Note that this authentication type only works for operations against a database allowing access for unauthenticated users. | +
The default authentication type for the SDK is CONTAINER
unless APIKEY
configuration is supplied, which changes the default authentication type to IAM
.
The default service name is CLOUDANT
so CLOUDANT_
prefixed names are used in these examples.
Any custom service name prefix can be used as long as the matching name is used to instantiate the SDK client +and the same prefix is used for all configuration options.
+For Cloudant IAM API key authentication, set the following environmental variables by
+replacing the <url>
and <apikey>
with your proper
+service credentials. There is no need to set
+CLOUDANT_AUTH_TYPE
to IAM
because it is the default when an APIKEY
is set.
CLOUDANT_URL=<url>
CLOUDANT_APIKEY=<apikey>
+
+
+For Cloudant IAM Trusted profile compute resource container authentication, set the following environmental variables by
+replacing the <url>
and <id>
with your values. There is no need to set
+CLOUDANT_AUTH_TYPE
to CONTAINER
because it is the default.
CLOUDANT_URL=<url>
CLOUDANT_IAM_PROFILE_ID=<id>
+
+
+Alternatively a profile name may be used instead of an ID by replacing CLOUDANT_IAM_PROFILE_ID
with CLOUDANT_IAM_PROFILE_NAME
.
For Cloudant IAM Trusted profile compute resource vpc authentication, set the following environmental variables by
+replacing the <url>
and <id>
with your values.
CLOUDANT_AUTH_TYPE=VPC
CLOUDANT_URL=<url>
CLOUDANT_IAM_PROFILE_ID=<id>
+
+
+Alternatively a profile CRN may be used instead of an ID by replacing CLOUDANT_IAM_PROFILE_ID
with CLOUDANT_IAM_PROFILE_CRN
.
For COUCHDB_SESSION
authentication, set the following environmental variables
+by replacing the <url>
, <username>
and <password>
with your proper
+service credentials.
CLOUDANT_AUTH_TYPE=COUCHDB_SESSION
CLOUDANT_URL=<url>
CLOUDANT_USERNAME=<username>
CLOUDANT_PASSWORD=<password>
+
+
+To use an external configuration file, the +Cloudant API docs, +or the +general SDK usage information +will guide you.
+To learn more about how to use programmatic authentication, see the related +documentation in the +Cloudant API docs +or in the +Node.js SDK Core document about authentication.
+The SDK supports a generalized retry feature that can automatically retry on common errors.
+The automatic retries section has details on how to enable the retries with default values and customize the retries programmatically or with external configuration.
+No request timeout is defined, but a 2.5m connect and 2.5m read timeout is set by default. Be sure to set a request timeout appropriate to your application usage and environment. +The request timeout section contains details on how to change the value.
+Note: System settings may take precedence over configured timeout values.
+The following code examples +authenticate with the environment variables.
+Note: This example code assumes that orders
database does not exist in your account.
This example code creates orders
database and adds a new document "example"
+into it. To connect, you must set your environment variables with
+the service url, authentication type and authentication credentials
+of your Cloudant service.
Cloudant environment variable naming starts with a service name prefix that identifies your service.
+By default, this is CLOUDANT
, see the settings in the
+authentication with environment variables section.
If you would like to rename your Cloudant service from CLOUDANT
,
+you must use your defined service name as the prefix for all Cloudant related environment variables.
Once the environment variables are set, you can try out the code examples.
+import { CloudantV1 } from '@ibm-cloud/cloudant';
+
+
+interface OrderDocument extends CloudantV1.Document {
name?: string;
joined?: string;
_id: string;
_rev?: string;
}
// 1. Create a client with `CLOUDANT` default service name ======================
const client = CloudantV1.newInstance({});
// 2. Create a database =========================================================
const exampleDbName = 'orders';
// Try to create database if it doesn't exist
const createDb = client
.putDatabase({ db: exampleDbName })
.then((putDatabaseResult) => {
if (putDatabaseResult.result.ok) {
console.log(`"${exampleDbName}" database created."`);
}
})
.catch((err) => {
if (err.code === 412) {
console.log(
`Cannot create "${exampleDbName}" database, it already exists.`
);
}
});
// 3. Create a document =========================================================
// Create a document object with "example" id
const exampleDocId = 'example';
// Setting `_id` for the document is optional when postDocument function is used for CREATE.
// When `_id` is not provided the server will generate one for your document.
const exampleDocument: OrderDocument = { _id: exampleDocId };
// Add "name" and "joined" fields to the document
exampleDocument.name = 'Bob Smith';
exampleDocument.joined = '2019-01-24T10:42:59.000Z';
// Save the document in the database with "postDocument" function
createDb.then(() => {
client
.postDocument({
db: exampleDbName,
document: exampleDocument,
})
// ==========================================================================
// Note: saving the document can also be done with the "putDocument"
// function. In this case `docId` is required for a CREATE operation:
/*
.putDocument({
db: exampleDbName,
docId: exampleDocId,
document: exampleDocument,
})
*/
// ==========================================================================
.then((createDocumentResponse) => {
// Keeping track of the revision number of the document object
// is necessary for further UPDATE/DELETE operations:
exampleDocument._rev = createDocumentResponse.result.rev;
console.log(
'You have created the document:\n' +
JSON.stringify(exampleDocument, null, 2)
);
});
});
+
+
+import { CloudantV1 } from '@ibm-cloud/cloudant';
+
+
+const createDbAndDoc = async () => {
// 1. Create a client with `CLOUDANT` default service name ====================
const client = CloudantV1.newInstance({});
// 2. Create a database =======================================================
const exampleDbName = 'orders';
// Try to create database if it doesn't exist
try {
const putDatabaseResult = (
await client.putDatabase({
db: exampleDbName,
})
).result;
if (putDatabaseResult.ok) {
console.log(`"${exampleDbName}" database created.`);
}
} catch (err) {
if (err.code === 412) {
console.log(
`Cannot create "${exampleDbName}" database, it already exists.`
);
}
}
// 3. Create a document =======================================================
// Create a document object with "example" id
const exampleDocId = 'example';
// Setting `_id` for the document is optional when "postDocument" function is used for CREATE.
// When `_id` is not provided the server will generate one for your document.
const exampleDocument = { _id: exampleDocId };
// Add "name" and "joined" fields to the document
exampleDocument['name'] = 'Bob Smith';
exampleDocument.joined = '2019-01-24T10:42:59.000Z';
// Save the document in the database with "postDocument" function
const createDocumentResponse = await client.postDocument({
db: exampleDbName,
document: exampleDocument,
});
// ==========================================================================
// Note: saving the document can also be done with the "putDocument"
// function. In this case `docId` is required for a CREATE operation:
/* const createDocumentResponse = await client.putDocument({
db: exampleDbName,
docId: exampleDocId,
document: exampleDocument,
}); */
// ==========================================================================
// Keeping track of the revision number of the document object
// is necessary for further UPDATE/DELETE operations:
exampleDocument._rev = createDocumentResponse.result.rev;
console.log(
'You have created the document:\n' +
JSON.stringify(exampleDocument, null, 2)
);
};
if (require.main === module) {
createDbAndDoc();
}
+
+
+When you run the code, you see a result similar to the following output.
+"orders" database created.
+You have created the document:
+{
+ "_id": "example",
+ "name": "Bob Smith",
+ "joined": "2019-01-24T10:42:59.000Z",
+ "_rev": "1-1b403633540686aa32d013fda9041a5d"
+}
+
+
+Note: This example code assumes that you have created both the orders
+database and the example
document by
+running the previous example code
+successfully. Otherwise, the following error message occurs, "Cannot delete document because either 'orders'
+database or 'example' document was not found."
import { CloudantV1 } from '@ibm-cloud/cloudant';
+
+
+// 1. Create a client with `CLOUDANT` default service name =====================
const client = CloudantV1.newInstance({});
// 2. Get server information ====================================================
// call service without parameters:
client.getServerInformation().then((serverInformation) => {
const { version } = serverInformation.result;
console.log(`Server version ${version}`);
});
// 3. Get database information for "orders" ===================================
const dbName = 'orders';
// call service with embedded parameters:
client.getDatabaseInformation({ db: dbName }).then((dbInfo) => {
const documentCount = dbInfo.result.docCount;
const dbNameResult = dbInfo.result.dbName;
// 4. Show document count in database =========================================
console.log(
`Document count in "${dbNameResult}" database is ${documentCount}.`
);
});
// 5. Get "example" document out of the database by document id =====================
const getDocParams: CloudantV1.GetDocumentParams = {
db: dbName,
docId: 'example',
};
// call service with predefined parameters:
client.getDocument(getDocParams).then((documentExample) => {
// result object is defined as a Document here:
const { result } = documentExample;
console.log(
`Document retrieved from database:\n${JSON.stringify(result, null, 2)}`
);
});
+
+
+import { CloudantV1 } from '@ibm-cloud/cloudant';
+
+
+const getInfoFromExistingDatabase = async () => {
// 1. Create a client with `CLOUDANT` default service name ===================
const client = CloudantV1.newInstance({});
// 2. Get server information ==================================================
// call service without parameters:
const { version } = (await client.getServerInformation()).result;
console.log(`Server version ${version}`);
// 3. Get database information for "orders" =================================
const dbName = 'orders';
// call service with embedded parameters:
const dbInfo = await client.getDatabaseInformation({ db: dbName });
const documentCount = dbInfo.result.docCount;
const dbNameResult = dbInfo.result.dbName;
// 4. Show document count in database =========================================
console.log(
`Document count in "${dbNameResult}" database is ${documentCount}.`
);
// 5. Get "example" document out of the database by document id ===================
const getDocParams = { db: dbName, docId: 'example' };
// call service with predefined parameters:
const documentExample = await client.getDocument(getDocParams);
// result object is defined as a Document here:
const { result } = documentExample;
console.log(
`Document retrieved from database:\n${JSON.stringify(result, null, 2)}`
);
};
if (require.main === module) {
getInfoFromExistingDatabase();
}
+
+
+Server version 3.2.1
+Document count in "orders" database is 1.
+Document retrieved from database:
+{
+ "_id": "example",
+ "_rev": "1-1b403633540686aa32d013fda9041a5d",
+ "name": "Bob Smith",
+ "joined": "2019-01-24T10:42:59.000Z"
+}
+
+
+Note: This example code assumes that you have created both the orders
+database and the example
document by
+running the previous example code
+successfully. Otherwise, the following error message occurs, "Cannot update document because either 'orders'
+database or 'example' document was not found."
import { CloudantV1 } from '@ibm-cloud/cloudant';
+
+
+interface OrderDocument extends CloudantV1.Document {
address?: string;
joined?: string;
_id?: string;
_rev?: string;
}
// 1. Create a client with `CLOUDANT` default service name ======================
const client = CloudantV1.newInstance({});
// 2. Update the document =======================================================
// Set the options to get the document out of the database if it exists
const exampleDbName = 'orders';
// Try to get the document if it previously existed in the database
const getDocParams: CloudantV1.GetDocumentParams = {
docId: 'example',
db: exampleDbName,
};
// ==============================================================================
// Note : for response byte stream use:
/*
const getdocAsStreamParam: CloudantV1.GetDocumentAsStreamParams = {
docId: 'example',
db: exampleDbName,
};
client
.getDocumentAsStream(getdocAsStreamParam)
.then((documentAsByteStream) => {...});
*/
// ==============================================================================
client
.getDocument(getDocParams)
.then((docResult) => {
// using OrderDocument on getDocument result:
const document: OrderDocument = docResult.result;
// Add Bob Smith's address to the document
document.address = '19 Front Street, Darlington, DL5 1TY';
// Remove the joined property from document object
delete document.joined;
// Update the document in the database
client
.postDocument({ db: exampleDbName, document })
// ========================================================================
// Note 1: for request byte stream use:
// .postDocument(
// {db: exampleDbName, document: documentAsByteStream}
// )
// ========================================================================
// ========================================================================
// Note 2: updating the document can also be done with the "putDocument" function.
// `docId` and `rev` are required for an UPDATE operation,
// but `rev` can be provided in the document object as `_rev` too:
/*
.putDocument({
db: exampleDbName,
docId: document._id, // docId is a required parameter
rev: document._rev,
document, // _rev in the document object CAN replace above `rev` parameter
})
*/
// ========================================================================
.then((res) => {
// Keeping track of the latest revision number of the document object
// is necessary for further UPDATE/DELETE operations:
document._rev = res.result.rev;
console.log(
`You have updated the document:\n${JSON.stringify(document, null, 2)}`
);
});
})
.catch((err) => {
if (err.code === 404) {
console.log(
`Cannot update document because either "${exampleDbName}" database or the "example" ` +
`document was not found.`
);
}
});
+
+
+import { CloudantV1 } from '@ibm-cloud/cloudant';
+
+
+const updateDoc = async () => {
// 1. Create a client with `CLOUDANT` default service name ====================
const client = CloudantV1.newInstance({});
// 2. Update the document =====================================================
// Set the options to get the document out of the database if it exists
const exampleDbName = 'orders';
// Try to get the document if it previously existed in the database
try {
const document = (
await client.getDocument({
docId: 'example',
db: exampleDbName,
})
).result;
// ==========================================================================
// Note: for response byte stream use:
/*
const documentAsByteStream = (
await client.getDocumentAsStream({
docId: 'example',
db: exampleDbName,
})
).result;
*/
// ==========================================================================
// Add Bob Smith's address to the document
document.address = '19 Front Street, Darlington, DL5 1TY';
// Remove the joined property from document object
delete document['joined'];
// Keeping track of the latest revision number of the document object
// is necessary for further UPDATE/DELETE operations:
document._rev = (
await client.postDocument({
db: exampleDbName,
document, // _id and _rev MUST be inside the document object
})
).result.rev;
// ==========================================================================
// Note 1: for request byte stream use:
/*
document._rev = (
await client.postDocument({
db: exampleDbName,
document: documentAsByteStream,
})
).result.rev;
*/
// ==========================================================================
// ==========================================================================
// Note 2: updating the document can also be done with the "putDocument" function.
// `docId` and `rev` are required for an UPDATE operation,
// but `rev` can be provided in the document object as `_rev` too:
/*
document._rev = (
await client.putDocument({
db: exampleDbName,
docId: document._id, // docId is a required parameter
rev: document._rev,
document // _rev in the document object CAN replace above `rev` parameter
})
).result.rev;
*/
// ==========================================================================
console.log(
`You have updated the document:\n${JSON.stringify(document, null, 2)}`
);
} catch (err) {
if (err.code === 404) {
console.log(
`Cannot update document because either "${exampleDbName}" database or the "example" ` +
`document was not found.`
);
}
}
};
if (require.main === module) {
updateDoc();
}
+
+
+You have updated the document:
+{
+ "_id": "example",
+ "_rev": "2-4e2178e85cffb32d38ba4e451f6ca376",
+ "name": "Bob Smith",
+ "address": "19 Front Street, Darlington, DL5 1TY"
+}
+
+
+Note: This example code assumes that you have created both the orders
+database and the example
document by
+running the previous example code
+successfully. Otherwise, the following error message occurs, "Cannot delete document because either 'orders'
+database or 'example' document was not found."
import { CloudantV1 } from '@ibm-cloud/cloudant';
+
+
+interface OrderDocument extends CloudantV1.Document {
name?: string;
address?: string;
joined?: string;
_id?: string;
_rev?: string;
}
// 1. Create a client with `CLOUDANT` default service name ======================
const client = CloudantV1.newInstance({});
// 2. Delete the document =======================================================
// Set the options to get the document out of the database if it exists
const exampleDbName = 'orders';
const exampleDocId = 'example';
// Try to get the document if it previously existed in the database
const getDocParams: CloudantV1.GetDocumentParams = {
docId: exampleDocId,
db: exampleDbName,
};
client
.getDocument(getDocParams)
.then((docResult) => {
const document: OrderDocument = docResult.result;
client
.deleteDocument({
db: exampleDbName,
docId: document._id, // `docId` is required for DELETE
rev: document._rev, // `rev` is required for DELETE
})
.then(() => {
console.log('You have deleted the document.');
});
})
.catch((err) => {
if (err.code === 404) {
console.log(
`Cannot delete document because either "${exampleDbName}" database or the "example" ` +
`document was not found.`
);
}
});
+
+
+import { CloudantV1 } from '@ibm-cloud/cloudant';
+
+
+const deleteDoc = async () => {
// 1. Create a client with `CLOUDANT` default service name ====================
const client = CloudantV1.newInstance({});
// 2. Delete the document =====================================================
// Set the options to get the document out of the database if it exists
const exampleDbName = 'orders';
const exampleDocId = 'example';
// Try to get the document if it previously existed in the database
try {
const document = (
await client.getDocument({
docId: exampleDocId,
db: exampleDbName,
})
).result;
await client.deleteDocument({
db: exampleDbName,
docId: document._id, // `docId` is required for DELETE
rev: document._rev, // `rev` is required for DELETE
});
console.log('You have deleted the document.');
} catch (err) {
if (err.code === 404) {
console.log(
`Cannot delete document because either "${exampleDbName}" database or the "example" ` +
`document was not found.`
);
}
}
};
if (require.main === module) {
deleteDoc();
}
+
+
+You have deleted the document.
+
+
+For a complete list of code examples, see the examples directory.
+For sample code on handling errors, see +Cloudant API docs.
+For endpoints that read or write document content it is possible to bypass +usage of the built-in interface with byte streams.
+Depending on the specific SDK operation it may be possible to:
+Request byte stream can be supplied for NodeJS.ReadableStream
or Buffer
type parameters
+.
+For these cases you can pass this byte stream directly to the HTTP request body.
Response byte stream is supported in functions with the suffix of AsStream
.
+The returned byte stream allows the response body to be consumed
+without triggering JSON unmarshalling that is typically performed by the SDK.
The update document section +contains examples for both request and response byte stream cases.
+The API reference contains further examples of using byte streams. +They are titled "Example request as stream" and are initially collapsed. +Expand them to see examples of:
+Byte requests:
+ +Byte responses:
+ +The SDK provides a changes feed follower utility (currently beta).
+This helper utility connects to the _changes
endpoint and returns the individual change items.
+It removes some of the complexity of using the _changes
endpoint by setting some options automatically
+and providing error suppression and retries.
Tip: the changes feed often does not meet user expectations or assumptions.
+Consult the Cloudant changes feed FAQ +to get a better understanding of the limitations and suitable use-cases before using the changes feed in your application.
+There are two modes of operation:
+since
sequence (by default the feed will start from now
).since
sequence (by default the feed will start from the beginning).The SDK's model of changes feed options is also used to configure the follower. +However, a subset of the options are invalid as they are configured internally by the implementation. +Supplying these options when instantiating the follower causes an error. +The invalid options are:
+descending
feed
heartbeat
lastEventId
- use since
insteadtimeout
_selector
is permitted for the filter
option. This restriction is because selector
+based filters perform better than JavaScript backed filters. Configuring a non-selector based filter will
+cause the follower to error.Note that the limit
parameter will terminate the follower at the given number of changes in either
+operating mode.
The changes follower requires the client to have HTTP timeouts of at least 1 minute and will error during +instantiation if it is insufficient. The default client configuration has sufficiently long timeouts.
+For use-cases where these configuration limitations are deemed too restrictive then it is recommended to
+write code to use the SDK's POST _changes
API instead of the follower.
By default, the changes follower will suppress transient errors indefinitely and attempt to run to completion or listen forever as +dictated by the operating mode. +For applications where that is not desirable an optional error tolerance duration may be specified to control the time since +the last successful response that transient errors will be suppressed. This can be used, for example, by applications as a grace period +before reporting an error and requiring intervention.
+There are some additional points to consider for error suppression:
+For both modes:
+400
, 401
, 403
404
).limit
.As is true for the _changes
endpoint change items have at least once delivery and an individual item
+may be received multiple times. When using the follower change items may be repeated even within a limited
+number of changes (i.e. using the limit
option) this is a minor difference from using limit
on the HTTP native API.
The follower is not optimized for some use cases and it is not recommended to use it in cases where:
+include_docs
and larger document sizes (for example > 10 kiB).In these cases use-case specific control over the number of change requests made and the content size of the responses
+may be achieved by using the SDK's POST _changes
API.
The changes follower does not checkpoint since it has no information about whether a change item has been
+processed by the consuming application after being received. It is the application developer's responsibility
+to store the sequence IDs to have appropriate checkpoints and to re-initialize the follower with the required
+since
value after, for example, the application restarts.
The frequency and conditions for checkpointing are application specific and some applications may be tolerant +of dropped changes. This section is intended only to provide general guidance on how to avoid missing changes.
+To guarantee processing of all changes the sequence ID from a change item must not be persisted until after
+the processing of the change item by the application has completed. As indicated previously change items are
+delivered at least once so application code must be able to handle repeated changes already and it is
+preferable to restart from an older since
value and receive changes again than risk missing them.
The sequence IDs are available on each change item by default, but may be omitted from some change items when
+using the seq_interval
configuration option. Infrequent sequence IDs may improve performance by reducing
+the amount of data that needs to be transferred, but the trade-off is that more changes will be repeated if
+it is necessary to resume the changes follower.
Extreme care should be taken with persisting sequences if choosing to process change items in parallel as there +is a considerable risk of missing changes on a restart if the sequence is recorded out of order.
+import { ChangesFollower, CloudantV1 } from '@ibm-cloud/cloudant';
import { PostChangesParams } from '@ibm-cloud/cloudant/cloudant/v1';
+
+
+const client = CloudantV1.newInstance({});
const changesParams: PostChangesParams = {
db: 'example', // Required: the database name.
limit: 100, // Optional: return only 100 changes (including duplicates).
since: '3-g1AG3...' // Optional: start from this sequence ID (e.g. with a value read from persistent storage).
};
const errorTolerance: number = 10000; // 10 second duration to suppress transient errors
const changesFollower: ChangesFollower = new ChangesFollower(
client, // Required: the Cloudant service client instance.
changesParams, // Required: changes feed configuration options dict.
10000 // Optional: suppress transient errors for at least 10 seconds before terminating.
);
+
+
+import { ChangesFollower, CloudantV1 } from '@ibm-cloud/cloudant';
+
+
+const client = CloudantV1.newInstance();
const changesParams = {
db: 'example', // Required: the database name.
limit: 100, // Optional: return only 100 changes (including duplicates).
since: '3-g1AG3...' // Optional: start from this sequence ID (e.g. with a value read from persistent storage).
};
const changesFollower = new ChangesFollower(
client, // Required: the Cloudant service client instance.
changesParams, // Required: changes feed configuration options dict.
10000 // Optional: suppress transient errors for at least 10 seconds before terminating.
);
+
+
+import { ChangesFollower, CloudantV1, Stream } from '@ibm-cloud/cloudant';
import { ChangesResultItem, PostChangesParams } from '@ibm-cloud/cloudant/cloudant/v1';
+
+
+const client = CloudantV1.newInstance({});
const changesParams: PostChangesParams = {
db: 'example'
};
const changesFollower: ChangesFollower = new ChangesFollower(client, changesParams);
const changesItemsStream: Stream<ChangesResultItem> = changesFollower.start();
// Create for-async-loop or pipeline to begin the flow of changes
// e.g. pipeline(changesItemsStream, destinationStream).then(() => { ... }).catch((err) => { ... });
+
+
+import { ChangesFollower, CloudantV1 } from '@ibm-cloud/cloudant';
+
+
+const client = CloudantV1.newInstance();
const changesParams = {
db: 'example'
};
const changesFollower = new ChangesFollower(client, changesParams);
const changesItemsStream = changesFollower.start();
// Create for-async-loop or pipeline to begin the flow of changes
// e.g. pipeline(changesItemsStream, destinationStream).then(() => { ... }).catch((err) => { ... });
+
+
+import { ChangesFollower, CloudantV1, Stream } from '@ibm-cloud/cloudant';
import { ChangesResultItem, PostChangesParams } from '@ibm-cloud/cloudant/cloudant/v1';
+
+
+const client = CloudantV1.newInstance({});
const changesParams: PostChangesParams = {
db: 'example'
};
const changesFollower: ChangesFollower = new ChangesFollower(client, changesParams);
const changesItemsStream: Stream<ChangesResultItem> = changesFollower.startOneOff();
// Create for-async-loop or pipeline to begin the flow of changes
// e.g. pipeline(changesItemsStream, destinationStream).then(() => { ... }).catch((err) => { ... });
+
+
+import { ChangesFollower, CloudantV1 } from '@ibm-cloud/cloudant';
+
+
+const client = CloudantV1.newInstance();
const changesParams = {
db: 'example'
};
const changesFollower = new ChangesFollower(client, changesParams);
const changesItemsStream = changesFollower.startOneOff();
// Create for-async-loop or pipeline to begin the flow of changes
// e.g. pipeline(changesItemsStream, destinationStream).then(() => { ... }).catch((err) => { ... });
+
+
+import { ChangesFollower, CloudantV1, Stream } from '@ibm-cloud/cloudant';
import { ChangesResultItem, PostChangesParams } from '@ibm-cloud/cloudant/cloudant/v1';
import { Writable } from 'node:stream';
import { pipeline } from 'node:stream/promises';
+
+
+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: PostChangesParams = {
db: 'example',
since: previouslyPersistedSeq
};
const changesFollower = new ChangesFollower(client, changesParams);
const changesItemsStream: Stream<ChangesResultItem> = changesFollower.start();
const destinationStream = new Writable({
objectMode: true,
write(changesItem: CloudantV1.ChangesResultItem, _, 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();
}
});
// A pipeline to keep processing changes until the follower is stopped or some other stop condition is reached
pipeline(changesItemsStream, destinationStream)
.then(() => {
console.log('Stopped');
})
.catch((err) => {
console.log(err);
});
+
+
+import { ChangesFollower, CloudantV1 } from '@ibm-cloud/cloudant';
import { Writable } from 'node:stream';
import { pipeline } from 'node:stream/promises';
+
+
+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.start();
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();
}
});
// A pipeline to keep processing changes until the follower is stopped or some other stop condition is reached
pipeline(changesItemsStream, destinationStream)
.then(() => {
console.log('Stopped');
})
.catch((err) => {
console.log(err);
});
+
+
+import { ChangesFollower, CloudantV1, Stream } from '@ibm-cloud/cloudant';
import { ChangesResultItem, PostChangesParams } from '@ibm-cloud/cloudant/cloudant/v1';
import { Writable } from 'node:stream';
import { pipeline } from 'node:stream/promises';
+
+
+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: PostChangesParams = {
db: 'example',
since: previouslyPersistedSeq
};
const changesFollower: ChangesFollower = new ChangesFollower(client, changesParams);
const changesItemsStream: Stream<ChangesResultItem> = changesFollower.startOneOff();
const destinationStream = new Writable({
objectMode: true,
write(changesItem: CloudantV1.ChangesResultItem, _, 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: Stream<CloudantV1.ChangesResultItem>) {
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, CloudantV1 } from '@ibm-cloud/cloudant';
import { Writable } from 'node:stream';
import { pipeline } from 'node:stream/promises';
+
+
+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, CloudantV1, Stream } from '@ibm-cloud/cloudant';
import { ChangesResultItem, PostChangesParams } from '@ibm-cloud/cloudant/cloudant/v1';
import { Writable } from 'node:stream';
import { pipeline } from 'node:stream/promises';
+
+
+const client = CloudantV1.newInstance({});
const changesParams: PostChangesParams = {
db: 'example'
};
const changesFollower: ChangesFollower = new ChangesFollower(client, changesParams);
const changesItemsStream: Stream<ChangesResultItem> = changesFollower.start();
const destinationStream = new Writable({
objectMode: true,
write(changesItem: CloudantV1.ChangesResultItem, _, callback) {
// Option 1: call stop after some condition
// Note that at least one item
// must be returned to reach to this point.
// Additional changes may be processed before the iterator stops.
changesFollower.stop();
callback();
}
});
pipeline(changesItemsStream, destinationStream)
.then(() => {
console.log('Stopped');
})
.catch((err) => {
console.log(err);
});
// Option 2: call stop method when you want to end the continuous loop from
// outside the pipeline.
// Normally the call would be made from some other application function
// executing later.
// For example, stop the changesFollower after 1 minute of listening for changes
setTimeout(() => {
changesFollower.stop();
}, 60000);
+
+
+import { ChangesFollower, CloudantV1 } from '@ibm-cloud/cloudant';
import { Writable } from 'node:stream';
import { pipeline } from 'node:stream/promises';
+
+
+const client = CloudantV1.newInstance();
const changesParams = {
db: 'example'
};
const changesFollower = new ChangesFollower(client, changesParams);
const changesItemsStream = changesFollower.start();
const destinationStream = new Writable({
objectMode: true,
write(changesItem, _, callback) {
// Option 1: call stop after some condition
// Note that at least one item
// must be returned to reach to this point.
// Additional changes may be processed before the iterator stops.
changesFollower.stop();
callback();
}
});
pipeline(changesItemsStream, destinationStream)
.then(() =>{
console.log('Stopped');
})
.catch((err) => {
console.log(err);
});
// Option 2: call stop method when you want to end the continuous loop from
// outside the pipeline.
// Normally the call would be made from some other application function
// executing later.
// For example, stop the changesFollower after 1 minute of listening for changes
setTimeout(() => {
changesFollower.stop();
}, 60000);
+
+
+If you are having difficulties using this SDK or have a question about the +IBM Cloud services, ask a question on +Stack Overflow.
+If you encounter an issue with the project, you are welcome to submit a +bug report.
+Before you submit a bug report, search for +similar issues and review the +KNOWN_ISSUES file to verify that your issue hasn't been reported yet.
+Please consult the security policy before opening security related issues.
+This SDK follows semantic versioning with respect to the definition of user facing APIs. +This means under some circumstances breaking changes may occur within a major or minor version +of the SDK related to changes in supported language platforms.
+The SDK is supported on the available LTS releases of the language platform. +The LTS language versions are listed in the prerequisites:
+ +Incompatible changes from new language versions are not added to the SDK +until they are available in the minimum supported language version.
+When language LTS versions move out of support the following will happen:
+Find more open source projects on the IBM GitHub page.
+For more information, see CONTRIBUTING.
+This SDK is released under the Apache 2.0 license. To read the full text of the license, see LICENSE.
+Optional
bulk_Optional
bulk_Optional
changes_Optional
changes_Optional
checkpoint_Optional
checkpointed_Optional
continuousOptional
design_Optional
doc_Optional
doc_Optional
docs_Optional
docs_Optional
indexOptional
indexer_Optional
missing_Optional
phaseOptional
process_Optional
progressOptional
replication_Optional
retryOptional
revisions_Optional
sourceOptional
source_Optional
targetOptional
through_Optional
total_Optional
userOptional
viewOptional
att_Optional
attachmentsOptional
conflictsOptional
descendingOptional
end_Optional
include_Optional
inclusive_Optional
keyOptional
keysOptional
limitOptional
skipOptional
start_Optional
update_Optional
committed_Optional
compacted_Optional
engineOptional
partitioned_Optional
uuidParameters for the deleteAttachment
operation.
Path parameter to specify the attachment name.
+Optional
batchQuery parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted +response code immediately.
+Path parameter to specify the database name.
+Path parameter to specify the document ID.
+Optional
headersOptional
ifHeader parameter for a conditional HTTP request matching an ETag.
+Optional
revQuery parameter to specify a document revision.
+Parameters for the deleteDesignDocument
operation.
Optional
batchQuery parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted +response code immediately.
+Path parameter to specify the database name.
+Path parameter to specify the design document name. The design document name is the design document ID
+excluding the _design/
prefix.
Optional
headersOptional
ifHeader parameter for a conditional HTTP request matching an ETag.
+Optional
revQuery parameter to specify a document revision.
+Parameters for the deleteDocument
operation.
Optional
batchQuery parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted +response code immediately.
+Path parameter to specify the database name.
+Path parameter to specify the document ID.
+Optional
headersOptional
ifHeader parameter for a conditional HTTP request matching an ETag.
+Optional
revQuery parameter to specify a document revision.
+Parameters for the deleteIndex
operation.
Path parameter to specify the database name.
+Path parameter to specify the design document name. The design document name is the design document ID
+excluding the _design/
prefix.
Optional
headersPath parameter to specify the index name.
+Path parameter to specify the index type.
+Parameters for the deleteLocalDocument
operation.
Optional
batchQuery parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted +response code immediately.
+Path parameter to specify the database name.
+Path parameter to specify the document ID.
+Optional
headersParameters for the deleteReplicationDocument
operation.
Optional
batchQuery parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted +response code immediately.
+Path parameter to specify the document ID.
+Optional
headersOptional
ifHeader parameter for a conditional HTTP request matching an ETag.
+Optional
revQuery parameter to specify a document revision.
+DesignDocument.DesignDocument.Transport accepts additional properties of type any.
+Optional
_attachmentsOptional
_conflictsOptional
_deletedOptional
_deleted_Optional
_idOptional
_local_Optional
_revOptional
_revisionsOptional
_revs_Optional
autoupdateOptional
filtersOptional
indexesOptional
languageOptional
optionsOptional
validate_Optional
viewsDocument.Document.Transport accepts additional properties of type any.
+The body of a service request that returns no response data.
+Optional
conflictsOptional
directionOptional
end_Optional
include_Optional
partitionOptional
reduceOptional
stableOptional
start_Optional
updateOptional
view_Parameters for the getAllDbs
operation.
Optional
descendingQuery parameter to specify whether to return the documents in descending by key order.
+Optional
endQuery 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.
+Optional
headersOptional
limitQuery parameter to specify the number of returned documents to limit the result to.
+Optional
skipQuery parameter to specify the number of records before starting to return the results.
+Optional
startQuery 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.
+Parameters for the getAttachment
operation.
Optional
acceptThe type of the response: or /.
+Path parameter to specify the attachment name.
+Path parameter to specify the database name.
+Path parameter to specify the document ID.
+Optional
headersOptional
ifHeader parameter for a conditional HTTP request matching an ETag.
+Optional
ifHeader parameter for a conditional HTTP request not matching an ETag.
+Optional
rangeHeader 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.
+Optional
revQuery parameter to specify a document revision.
+Parameters for the getDatabaseInformation
operation.
Parameters for the getDbUpdates
operation.
Optional
descendingQuery parameter to specify whether to return the documents in descending by key order.
+Optional
feedQuery parameter to specify the changes feed type.
+Optional
headersOptional
heartbeatQuery parameter to specify the period in milliseconds after which an empty line is sent in the results. Off
+by default and only applicable for
+continuous
and eventsource
feeds. Overrides any timeout to keep the feed alive indefinitely. May also be
+true
to use a value of 60000
.
Note: Delivery of heartbeats cannot be relied on at specific intervals. If your application runs in an
+environment where idle network connections may break, heartbeat
is not suitable as a keepalive mechanism.
+Instead, consider one of the following options:
timeout
parameter with a value that is compatible with your network environment.normal
or longpoll
).Optional
limitQuery parameter to specify the number of returned documents to limit the result to.
+Optional
sinceQuery parameter to specify to start the results from the change immediately after the given update sequence.
+Can be a valid update sequence or now
value. Default is 0
i.e. all changes.
Optional
timeoutQuery parameter to specify the maximum period in milliseconds to wait for a change before the response is
+sent, even if there are no results. Only applicable for longpoll
or continuous
feeds. Default value is
+specified by httpd/changes_timeout
configuration option. Note that 60000
value is also the default maximum
+timeout to prevent undetected dead connections.
Parameters for the getDesignDocument
operation.
Optional
attQuery parameter to specify whether to include the encoding information in attachment stubs if the particular +attachment is compressed.
+Optional
attachmentsQuery parameter to specify whether to include attachments bodies in a response.
+Optional
conflictsQuery parameter to specify whether to include a list of conflicted revisions in each returned document.
+Active only when include_docs
is true
.
Path parameter to specify the database name.
+Path parameter to specify the design document name. The design document name is the design document ID
+excluding the _design/
prefix.
Optional
deletedQuery parameter to specify whether to include a list of deleted conflicted revisions in the
+_deleted_conflicts
property of the returned document.
Optional
headersOptional
ifHeader parameter for a conditional HTTP request not matching an ETag.
+Optional
latestQuery parameter to specify whether to force retrieving latest leaf revision, no matter what rev was +requested.
+Optional
localQuery parameter to specify whether to include the last update sequence for the document.
+Optional
metaQuery 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.
+Optional
revQuery parameter to specify a document revision.
+Optional
revsQuery parameter to specify whether to include a list of all known document revisions.
+Optional
revsQuery parameter to specify whether to includes detailed information for all known document revisions.
+Parameters for the getDocumentAsMixed
operation.
Optional
attQuery parameter to specify whether to include the encoding information in attachment stubs if the particular +attachment is compressed.
+Optional
attachmentsQuery parameter to specify whether to include attachments bodies in a response.
+Optional
conflictsQuery parameter to specify whether to include a list of conflicted revisions in each returned document.
+Active only when include_docs
is true
.
Path parameter to specify the database name.
+Optional
deletedQuery parameter to specify whether to include a list of deleted conflicted revisions in the
+_deleted_conflicts
property of the returned document.
Path parameter to specify the document ID.
+Optional
headersOptional
ifHeader parameter for a conditional HTTP request not matching an ETag.
+Optional
latestQuery parameter to specify whether to force retrieving latest leaf revision, no matter what rev was +requested.
+Optional
localQuery parameter to specify whether to include the last update sequence for the document.
+Optional
metaQuery 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.
+Optional
revQuery parameter to specify a document revision.
+Optional
revsQuery parameter to specify whether to include a list of all known document revisions.
+Optional
revsQuery parameter to specify whether to includes detailed information for all known document revisions.
+Parameters for the getDocumentAsRelated
operation.
Optional
attQuery parameter to specify whether to include the encoding information in attachment stubs if the particular +attachment is compressed.
+Optional
attachmentsQuery parameter to specify whether to include attachments bodies in a response.
+Optional
conflictsQuery parameter to specify whether to include a list of conflicted revisions in each returned document.
+Active only when include_docs
is true
.
Path parameter to specify the database name.
+Optional
deletedQuery parameter to specify whether to include a list of deleted conflicted revisions in the
+_deleted_conflicts
property of the returned document.
Path parameter to specify the document ID.
+Optional
headersOptional
ifHeader parameter for a conditional HTTP request not matching an ETag.
+Optional
latestQuery parameter to specify whether to force retrieving latest leaf revision, no matter what rev was +requested.
+Optional
localQuery parameter to specify whether to include the last update sequence for the document.
+Optional
metaQuery 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.
+Optional
revQuery parameter to specify a document revision.
+Optional
revsQuery parameter to specify whether to include a list of all known document revisions.
+Optional
revsQuery parameter to specify whether to includes detailed information for all known document revisions.
+Parameters for the getDocumentAsStream
operation.
Optional
attQuery parameter to specify whether to include the encoding information in attachment stubs if the particular +attachment is compressed.
+Optional
attachmentsQuery parameter to specify whether to include attachments bodies in a response.
+Optional
conflictsQuery parameter to specify whether to include a list of conflicted revisions in each returned document.
+Active only when include_docs
is true
.
Path parameter to specify the database name.
+Optional
deletedQuery parameter to specify whether to include a list of deleted conflicted revisions in the
+_deleted_conflicts
property of the returned document.
Path parameter to specify the document ID.
+Optional
headersOptional
ifHeader parameter for a conditional HTTP request not matching an ETag.
+Optional
latestQuery parameter to specify whether to force retrieving latest leaf revision, no matter what rev was +requested.
+Optional
localQuery parameter to specify whether to include the last update sequence for the document.
+Optional
metaQuery 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.
+Optional
revQuery parameter to specify a document revision.
+Optional
revsQuery parameter to specify whether to include a list of all known document revisions.
+Optional
revsQuery parameter to specify whether to includes detailed information for all known document revisions.
+Parameters for the getDocument
operation.
Optional
attQuery parameter to specify whether to include the encoding information in attachment stubs if the particular +attachment is compressed.
+Optional
attachmentsQuery parameter to specify whether to include attachments bodies in a response.
+Optional
conflictsQuery parameter to specify whether to include a list of conflicted revisions in each returned document.
+Active only when include_docs
is true
.
Path parameter to specify the database name.
+Optional
deletedQuery parameter to specify whether to include a list of deleted conflicted revisions in the
+_deleted_conflicts
property of the returned document.
Path parameter to specify the document ID.
+Optional
headersOptional
ifHeader parameter for a conditional HTTP request not matching an ETag.
+Optional
latestQuery parameter to specify whether to force retrieving latest leaf revision, no matter what rev was +requested.
+Optional
localQuery parameter to specify whether to include the last update sequence for the document.
+Optional
metaQuery 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.
+Optional
revQuery parameter to specify a document revision.
+Optional
revsQuery parameter to specify whether to include a list of all known document revisions.
+Optional
revsQuery parameter to specify whether to includes detailed information for all known document revisions.
+Parameters for the getDocumentShardsInfo
operation.
Parameters for the getIndexesInformation
operation.
Parameters for the getLocalDocument
operation.
Optional
acceptThe type of the response: application/json, multipart/mixed, multipart/related, or application/octet-stream.
+Optional
attQuery parameter to specify whether to include the encoding information in attachment stubs if the particular +attachment is compressed.
+Optional
attachmentsQuery parameter to specify whether to include attachments bodies in a response.
+Path parameter to specify the database name.
+Path parameter to specify the document ID.
+Optional
headersOptional
ifHeader parameter for a conditional HTTP request not matching an ETag.
+Optional
localQuery parameter to specify whether to include the last update sequence for the document.
+Parameters for the getPartitionInformation
operation.
Parameters for the getReplicationDocument
operation.
Optional
attQuery parameter to specify whether to include the encoding information in attachment stubs if the particular +attachment is compressed.
+Optional
attachmentsQuery parameter to specify whether to include attachments bodies in a response.
+Optional
conflictsQuery parameter to specify whether to include a list of conflicted revisions in each returned document.
+Active only when include_docs
is true
.
Optional
deletedQuery parameter to specify whether to include a list of deleted conflicted revisions in the
+_deleted_conflicts
property of the returned document.
Path parameter to specify the document ID.
+Optional
headersOptional
ifHeader parameter for a conditional HTTP request not matching an ETag.
+Optional
latestQuery parameter to specify whether to force retrieving latest leaf revision, no matter what rev was +requested.
+Optional
localQuery parameter to specify whether to include the last update sequence for the document.
+Optional
metaQuery 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.
+Optional
revQuery parameter to specify a document revision.
+Optional
revsQuery parameter to specify whether to include a list of all known document revisions.
+Optional
revsQuery parameter to specify whether to includes detailed information for all known document revisions.
+Parameters for the getSchedulerDocs
operation.
Optional
headersOptional
limitQuery parameter to specify the number of returned documents to limit the result to.
+Optional
skipQuery parameter to specify the number of records before starting to return the results.
+Optional
statesQuery parameter to include only replication documents in the specified states. String must be a +comma-delimited string.
+Parameters for the getSchedulerDocument
operation.
Parameters for the getSchedulerJob
operation.
Parameters for the getSchedulerJobs
operation.
Parameters for the getSearchInfo
operation.
Path parameter to specify the database name.
+Path parameter to specify the design document name. The design document name is the design document ID
+excluding the _design/
prefix.
Optional
headersPath parameter to specify the index name.
+Parameters for the getShardsInformation
operation.
Parameters for the getUuids
operation.
Parameters for the headAttachment
operation.
Path parameter to specify the attachment name.
+Path parameter to specify the database name.
+Path parameter to specify the document ID.
+Optional
headersOptional
ifHeader parameter for a conditional HTTP request matching an ETag.
+Optional
ifHeader parameter for a conditional HTTP request not matching an ETag.
+Optional
revQuery parameter to specify a document revision.
+Parameters for the headDesignDocument
operation.
Path parameter to specify the database name.
+Path parameter to specify the design document name. The design document name is the design document ID
+excluding the _design/
prefix.
Optional
headersOptional
ifHeader parameter for a conditional HTTP request not matching an ETag.
+Parameters for the headDocument
operation.
Path parameter to specify the database name.
+Path parameter to specify the document ID.
+Optional
headersOptional
ifHeader parameter for a conditional HTTP request not matching an ETag.
+Optional
latestQuery parameter to specify whether to force retrieving latest leaf revision, no matter what rev was +requested.
+Optional
revQuery parameter to specify a document revision.
+Parameters for the headLocalDocument
operation.
Parameters for the headReplicationDocument
operation.
Parameters for the headSchedulerDocument
operation.
Parameters for the headSchedulerJob
operation.
Parameters for the postActivityTrackerEvents
operation.
Parameters for the postAllDocsAsStream
operation.
Optional
attParameter to specify whether to include the encoding information in attachment stubs if the particular +attachment is compressed.
+Optional
attachmentsParameter to specify whether to include attachments bodies in a response.
+Optional
conflictsParameter to specify whether to include a list of conflicted revisions in each returned document. Active
+only when include_docs
is true
.
Path parameter to specify the database name.
+Optional
descendingParameter to specify whether to return the documents in descending by key order.
+Optional
endSchema for a document ID.
+Optional
headersOptional
includeParameter to specify whether to include the full content of the documents in the response.
+Optional
inclusiveParameter to specify whether the specified end key should be included in the result.
+Optional
keySchema for a document ID.
+Optional
keysSchema for a list of document IDs.
+Optional
limitParameter to specify the number of returned documents to limit the result to.
+Optional
skipParameter to specify the number of records before starting to return the results.
+Optional
startSchema for a document ID.
+Optional
updateParameter to specify whether to include in the response an update_seq value indicating the sequence id of +the database the view reflects.
+Parameters for the postAllDocs
operation.
Optional
attParameter to specify whether to include the encoding information in attachment stubs if the particular +attachment is compressed.
+Optional
attachmentsParameter to specify whether to include attachments bodies in a response.
+Optional
conflictsParameter to specify whether to include a list of conflicted revisions in each returned document. Active
+only when include_docs
is true
.
Path parameter to specify the database name.
+Optional
descendingParameter to specify whether to return the documents in descending by key order.
+Optional
endSchema for a document ID.
+Optional
headersOptional
includeParameter to specify whether to include the full content of the documents in the response.
+Optional
inclusiveParameter to specify whether the specified end key should be included in the result.
+Optional
keySchema for a document ID.
+Optional
keysSchema for a list of document IDs.
+Optional
limitParameter to specify the number of returned documents to limit the result to.
+Optional
skipParameter to specify the number of records before starting to return the results.
+Optional
startSchema for a document ID.
+Optional
updateParameter to specify whether to include in the response an update_seq value indicating the sequence id of +the database the view reflects.
+Parameters for the postAllDocsQueriesAsStream
operation.
Path parameter to specify the database name.
+Optional
headersAn array of query objects with fields for the parameters of each individual view query to be executed. The
+field names and their meaning are the same as the query parameters of a regular /_all_docs
request.
Parameters for the postAllDocsQueries
operation.
Path parameter to specify the database name.
+Optional
headersAn array of query objects with fields for the parameters of each individual view query to be executed. The
+field names and their meaning are the same as the query parameters of a regular /_all_docs
request.
Parameters for the postBulkDocs
operation.
Parameters for the postBulkGetAsMixed
operation.
Optional
attQuery parameter to specify whether to include the encoding information in attachment stubs if the particular +attachment is compressed.
+Optional
attachmentsQuery parameter to specify whether to include attachments bodies in a response.
+Path parameter to specify the database name.
+List of document items to get in bulk.
+Optional
headersOptional
latestQuery parameter to specify whether to force retrieving latest leaf revision, no matter what rev was +requested.
+Optional
revsQuery parameter to specify whether to include a list of all known document revisions.
+Parameters for the postBulkGetAsRelated
operation.
Optional
attQuery parameter to specify whether to include the encoding information in attachment stubs if the particular +attachment is compressed.
+Optional
attachmentsQuery parameter to specify whether to include attachments bodies in a response.
+Path parameter to specify the database name.
+List of document items to get in bulk.
+Optional
headersOptional
latestQuery parameter to specify whether to force retrieving latest leaf revision, no matter what rev was +requested.
+Optional
revsQuery parameter to specify whether to include a list of all known document revisions.
+Parameters for the postBulkGetAsStream
operation.
Optional
attQuery parameter to specify whether to include the encoding information in attachment stubs if the particular +attachment is compressed.
+Optional
attachmentsQuery parameter to specify whether to include attachments bodies in a response.
+Path parameter to specify the database name.
+List of document items to get in bulk.
+Optional
headersOptional
latestQuery parameter to specify whether to force retrieving latest leaf revision, no matter what rev was +requested.
+Optional
revsQuery parameter to specify whether to include a list of all known document revisions.
+Parameters for the postBulkGet
operation.
Optional
attQuery parameter to specify whether to include the encoding information in attachment stubs if the particular +attachment is compressed.
+Optional
attachmentsQuery parameter to specify whether to include attachments bodies in a response.
+Path parameter to specify the database name.
+List of document items to get in bulk.
+Optional
headersOptional
latestQuery parameter to specify whether to force retrieving latest leaf revision, no matter what rev was +requested.
+Optional
revsQuery parameter to specify whether to include a list of all known document revisions.
+Parameters for the postChangesAsStream
operation.
Optional
attQuery parameter to specify whether to include the encoding information in attachment stubs if the particular +attachment is compressed.
+Optional
attachmentsQuery parameter to specify whether to include attachments bodies in a response.
+Optional
conflictsQuery parameter to specify whether to include a list of conflicted revisions in each returned document.
+Active only when include_docs
is true
.
Path parameter to specify the database name.
+Optional
descendingQuery parameter to specify whether to return the documents in descending by key order.
+Optional
docSchema for a list of document IDs.
+Optional
feedQuery parameter to specify the changes feed type.
+Optional
fieldsJSON 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.
+Optional
filterQuery 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 in
+doc_ids
request body parameter. (POST
only)_selector
- Returns changes for documents that match the selector
+request body parameter. The selector syntax is the same as used for
+_find
. (POST
only)_view
- Returns changes for documents that match an existing map
+function in the view specified by the query parameter view
.Additionally, the value can be the name of a JS filter function from a design document. For example:
+design_doc/filtername
.
Note: For better performance use the built-in _selector
, _design
or _doc_ids
filters rather than JS
+based _view
or design document filters. If you need to pass values to change the filtered content use the
+_selector
filter type.
Optional
headersOptional
heartbeatQuery parameter to specify the period in milliseconds after which an empty line is sent in the results. Off
+by default and only applicable for
+continuous
and eventsource
feeds. Overrides any timeout to keep the feed alive indefinitely. May also be
+true
to use a value of 60000
.
Note: Delivery of heartbeats cannot be relied on at specific intervals. If your application runs in an
+environment where idle network connections may break, heartbeat
is not suitable as a keepalive mechanism.
+Instead, consider one of the following options:
timeout
parameter with a value that is compatible with your network environment.normal
or longpoll
).Optional
includeQuery parameter to specify whether to include the full content of the documents in the response.
+Optional
lastHeader parameter to specify the ID of the last events received by the server on a previous connection.
+Overrides since
query parameter.
Optional
limitQuery parameter to specify the number of returned documents to limit the result to.
+Optional
selectorJSON 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:
+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:
+$eq
operator matches when the specified field contains a value that is equal to the
+supplied argument. See the Cloudant Docs for a
+list of all available combination and conditional operators.$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.For further reference see +selector syntax.
+Optional
seqQuery 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.
Optional
sinceQuery parameter to specify to start the results from the change immediately after the given update sequence.
+Can be a valid update sequence or now
value. Default is 0
i.e. all changes.
Optional
styleQuery 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).
Optional
timeoutQuery parameter to specify the maximum period in milliseconds to wait for a change before the response is
+sent, even if there are no results. Only applicable for longpoll
or continuous
feeds. Default value is
+specified by httpd/changes_timeout
configuration option. Note that 60000
value is also the default maximum
+timeout to prevent undetected dead connections.
Optional
viewQuery 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.
+Parameters for the postChanges
operation.
Optional
attQuery parameter to specify whether to include the encoding information in attachment stubs if the particular +attachment is compressed.
+Optional
attachmentsQuery parameter to specify whether to include attachments bodies in a response.
+Optional
conflictsQuery parameter to specify whether to include a list of conflicted revisions in each returned document.
+Active only when include_docs
is true
.
Path parameter to specify the database name.
+Optional
descendingQuery parameter to specify whether to return the documents in descending by key order.
+Optional
docSchema for a list of document IDs.
+Optional
feedQuery parameter to specify the changes feed type.
+Optional
fieldsJSON 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.
+Optional
filterQuery 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 in
+doc_ids
request body parameter. (POST
only)_selector
- Returns changes for documents that match the selector
+request body parameter. The selector syntax is the same as used for
+_find
. (POST
only)_view
- Returns changes for documents that match an existing map
+function in the view specified by the query parameter view
.Additionally, the value can be the name of a JS filter function from a design document. For example:
+design_doc/filtername
.
Note: For better performance use the built-in _selector
, _design
or _doc_ids
filters rather than JS
+based _view
or design document filters. If you need to pass values to change the filtered content use the
+_selector
filter type.
Optional
headersOptional
heartbeatQuery parameter to specify the period in milliseconds after which an empty line is sent in the results. Off
+by default and only applicable for
+continuous
and eventsource
feeds. Overrides any timeout to keep the feed alive indefinitely. May also be
+true
to use a value of 60000
.
Note: Delivery of heartbeats cannot be relied on at specific intervals. If your application runs in an
+environment where idle network connections may break, heartbeat
is not suitable as a keepalive mechanism.
+Instead, consider one of the following options:
timeout
parameter with a value that is compatible with your network environment.normal
or longpoll
).Optional
includeQuery parameter to specify whether to include the full content of the documents in the response.
+Optional
lastHeader parameter to specify the ID of the last events received by the server on a previous connection.
+Overrides since
query parameter.
Optional
limitQuery parameter to specify the number of returned documents to limit the result to.
+Optional
selectorJSON 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:
+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:
+$eq
operator matches when the specified field contains a value that is equal to the
+supplied argument. See the Cloudant Docs for a
+list of all available combination and conditional operators.$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.For further reference see +selector syntax.
+Optional
seqQuery 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.
Optional
sinceQuery parameter to specify to start the results from the change immediately after the given update sequence.
+Can be a valid update sequence or now
value. Default is 0
i.e. all changes.
Optional
styleQuery 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).
Optional
timeoutQuery parameter to specify the maximum period in milliseconds to wait for a change before the response is
+sent, even if there are no results. Only applicable for longpoll
or continuous
feeds. Default value is
+specified by httpd/changes_timeout
configuration option. Note that 60000
value is also the default maximum
+timeout to prevent undetected dead connections.
Optional
viewQuery 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.
+Parameters for the postDesignDocs
operation.
Optional
attParameter to specify whether to include the encoding information in attachment stubs if the particular +attachment is compressed.
+Optional
attachmentsParameter to specify whether to include attachments bodies in a response.
+Optional
conflictsParameter to specify whether to include a list of conflicted revisions in each returned document. Active
+only when include_docs
is true
.
Path parameter to specify the database name.
+Optional
descendingParameter to specify whether to return the documents in descending by key order.
+Optional
endSchema for a document ID.
+Optional
headersOptional
includeParameter to specify whether to include the full content of the documents in the response.
+Optional
inclusiveParameter to specify whether the specified end key should be included in the result.
+Optional
keySchema for a document ID.
+Optional
keysSchema for a list of document IDs.
+Optional
limitParameter to specify the number of returned documents to limit the result to.
+Optional
skipParameter to specify the number of records before starting to return the results.
+Optional
startSchema for a document ID.
+Optional
updateParameter to specify whether to include in the response an update_seq value indicating the sequence id of +the database the view reflects.
+Parameters for the postDesignDocsQueries
operation.
Optional
acceptThe type of the response: application/json or application/octet-stream.
+Path parameter to specify the database name.
+Optional
headersAn array of query objects with fields for the parameters of each individual view query to be executed. The
+field names and their meaning are the same as the query parameters of a regular /_all_docs
request.
Parameters for the postDocument
operation.
Optional
batchQuery parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted +response code immediately.
+Optional
contentThe type of the input.
+Path parameter to specify the database name.
+HTTP request body for Document operations.
+Optional
headersParameters for the postExplain
operation.
Optional
bookmarkOpaque bookmark token used when paginating results.
+Optional
conflictsA boolean value that indicates whether or not to include information about existing conflicts in the +document.
+Path parameter to specify the database name.
+Optional
executionUse this option to find information about the query that was run. This information includes total key
+lookups, total document lookups (when include_docs=true
is used), and total quorum document lookups (when each
+document replica is fetched).
Optional
fieldsJSON 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.
+Optional
headersOptional
limitMaximum number of results returned. The type: text
indexes are limited to 200 results when queried.
Optional
rThe 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.
+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:
+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:
+$eq
operator matches when the specified field contains a value that is equal to the
+supplied argument. See the Cloudant Docs for a
+list of all available combination and conditional operators.$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.For further reference see +selector syntax.
+Optional
skipSkip the first 'n' results, where 'n' is the value that is specified.
+Optional
sortThe 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.
+Optional
stableWhether or not the view results should be returned from a "stable" set of shards.
+Optional
updateWhether to update the index prior to returning the result.
+Optional
useUse 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.
+Parameters for the postFindAsStream
operation.
Optional
bookmarkOpaque bookmark token used when paginating results.
+Optional
conflictsA boolean value that indicates whether or not to include information about existing conflicts in the +document.
+Path parameter to specify the database name.
+Optional
executionUse this option to find information about the query that was run. This information includes total key
+lookups, total document lookups (when include_docs=true
is used), and total quorum document lookups (when each
+document replica is fetched).
Optional
fieldsJSON 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.
+Optional
headersOptional
limitMaximum number of results returned. The type: text
indexes are limited to 200 results when queried.
Optional
rThe 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.
+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:
+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:
+$eq
operator matches when the specified field contains a value that is equal to the
+supplied argument. See the Cloudant Docs for a
+list of all available combination and conditional operators.$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.For further reference see +selector syntax.
+Optional
skipSkip the first 'n' results, where 'n' is the value that is specified.
+Optional
sortThe 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.
+Optional
stableWhether or not the view results should be returned from a "stable" set of shards.
+Optional
updateWhether to update the index prior to returning the result.
+Optional
useUse 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.
+Parameters for the postFind
operation.
Optional
bookmarkOpaque bookmark token used when paginating results.
+Optional
conflictsA boolean value that indicates whether or not to include information about existing conflicts in the +document.
+Path parameter to specify the database name.
+Optional
executionUse this option to find information about the query that was run. This information includes total key
+lookups, total document lookups (when include_docs=true
is used), and total quorum document lookups (when each
+document replica is fetched).
Optional
fieldsJSON 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.
+Optional
headersOptional
limitMaximum number of results returned. The type: text
indexes are limited to 200 results when queried.
Optional
rThe 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.
+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:
+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:
+$eq
operator matches when the specified field contains a value that is equal to the
+supplied argument. See the Cloudant Docs for a
+list of all available combination and conditional operators.$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.For further reference see +selector syntax.
+Optional
skipSkip the first 'n' results, where 'n' is the value that is specified.
+Optional
sortThe 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.
+Optional
stableWhether or not the view results should be returned from a "stable" set of shards.
+Optional
updateWhether to update the index prior to returning the result.
+Optional
useUse 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.
+Parameters for the postIndex
operation.
Path parameter to specify the database name.
+Optional
ddocSpecifies the design document name in which the index will be created. The design document name is the
+design document ID excluding the _design/
prefix.
Optional
headersSchema for a json
or text
query index definition. Indexes of type text
have additional configuration
+properties that do not apply to json
indexes, these are:
default_analyzer
- the default text analyzer to use * default_field
- whether to index the text in all
+document fields and what analyzer to use for that purpose.Optional
namename.
+Optional
partitionedThe default value is true
for databases with partitioned: true
and false
otherwise. For databases with
+partitioned: false
if this option is specified the value must be false
.
Optional
typeSchema for the type of an index.
+Parameters for the postPartitionAllDocsAsStream
operation.
Optional
attParameter to specify whether to include the encoding information in attachment stubs if the particular +attachment is compressed.
+Optional
attachmentsParameter to specify whether to include attachments bodies in a response.
+Optional
conflictsParameter to specify whether to include a list of conflicted revisions in each returned document. Active
+only when include_docs
is true
.
Path parameter to specify the database name.
+Optional
descendingParameter to specify whether to return the documents in descending by key order.
+Optional
endSchema for a document ID.
+Optional
headersOptional
includeParameter to specify whether to include the full content of the documents in the response.
+Optional
inclusiveParameter to specify whether the specified end key should be included in the result.
+Optional
keySchema for a document ID.
+Optional
keysSchema for a list of document IDs.
+Optional
limitParameter to specify the number of returned documents to limit the result to.
+Path parameter to specify the database partition key.
+Optional
skipParameter to specify the number of records before starting to return the results.
+Optional
startSchema for a document ID.
+Optional
updateParameter to specify whether to include in the response an update_seq value indicating the sequence id of +the database the view reflects.
+Parameters for the postPartitionAllDocs
operation.
Optional
attParameter to specify whether to include the encoding information in attachment stubs if the particular +attachment is compressed.
+Optional
attachmentsParameter to specify whether to include attachments bodies in a response.
+Optional
conflictsParameter to specify whether to include a list of conflicted revisions in each returned document. Active
+only when include_docs
is true
.
Path parameter to specify the database name.
+Optional
descendingParameter to specify whether to return the documents in descending by key order.
+Optional
endSchema for a document ID.
+Optional
headersOptional
includeParameter to specify whether to include the full content of the documents in the response.
+Optional
inclusiveParameter to specify whether the specified end key should be included in the result.
+Optional
keySchema for a document ID.
+Optional
keysSchema for a list of document IDs.
+Optional
limitParameter to specify the number of returned documents to limit the result to.
+Path parameter to specify the database partition key.
+Optional
skipParameter to specify the number of records before starting to return the results.
+Optional
startSchema for a document ID.
+Optional
updateParameter to specify whether to include in the response an update_seq value indicating the sequence id of +the database the view reflects.
+Parameters for the postPartitionExplain
operation.
Optional
bookmarkOpaque bookmark token used when paginating results.
+Optional
conflictsA boolean value that indicates whether or not to include information about existing conflicts in the +document.
+Path parameter to specify the database name.
+Optional
executionUse this option to find information about the query that was run. This information includes total key
+lookups, total document lookups (when include_docs=true
is used), and total quorum document lookups (when each
+document replica is fetched).
Optional
fieldsJSON 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.
+Optional
headersOptional
limitMaximum number of results returned. The type: text
indexes are limited to 200 results when queried.
Path parameter to specify the database partition key.
+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:
+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:
+$eq
operator matches when the specified field contains a value that is equal to the
+supplied argument. See the Cloudant Docs for a
+list of all available combination and conditional operators.$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.For further reference see +selector syntax.
+Optional
skipSkip the first 'n' results, where 'n' is the value that is specified.
+Optional
sortThe 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.
+Optional
stableWhether or not the view results should be returned from a "stable" set of shards.
+Optional
updateWhether to update the index prior to returning the result.
+Optional
useUse 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.
+Parameters for the postPartitionFindAsStream
operation.
Optional
bookmarkOpaque bookmark token used when paginating results.
+Optional
conflictsA boolean value that indicates whether or not to include information about existing conflicts in the +document.
+Path parameter to specify the database name.
+Optional
executionUse this option to find information about the query that was run. This information includes total key
+lookups, total document lookups (when include_docs=true
is used), and total quorum document lookups (when each
+document replica is fetched).
Optional
fieldsJSON 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.
+Optional
headersOptional
limitMaximum number of results returned. The type: text
indexes are limited to 200 results when queried.
Path parameter to specify the database partition key.
+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:
+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:
+$eq
operator matches when the specified field contains a value that is equal to the
+supplied argument. See the Cloudant Docs for a
+list of all available combination and conditional operators.$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.For further reference see +selector syntax.
+Optional
skipSkip the first 'n' results, where 'n' is the value that is specified.
+Optional
sortThe 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.
+Optional
stableWhether or not the view results should be returned from a "stable" set of shards.
+Optional
updateWhether to update the index prior to returning the result.
+Optional
useUse 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.
+Parameters for the postPartitionFind
operation.
Optional
bookmarkOpaque bookmark token used when paginating results.
+Optional
conflictsA boolean value that indicates whether or not to include information about existing conflicts in the +document.
+Path parameter to specify the database name.
+Optional
executionUse this option to find information about the query that was run. This information includes total key
+lookups, total document lookups (when include_docs=true
is used), and total quorum document lookups (when each
+document replica is fetched).
Optional
fieldsJSON 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.
+Optional
headersOptional
limitMaximum number of results returned. The type: text
indexes are limited to 200 results when queried.
Path parameter to specify the database partition key.
+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:
+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:
+$eq
operator matches when the specified field contains a value that is equal to the
+supplied argument. See the Cloudant Docs for a
+list of all available combination and conditional operators.$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.For further reference see +selector syntax.
+Optional
skipSkip the first 'n' results, where 'n' is the value that is specified.
+Optional
sortThe 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.
+Optional
stableWhether or not the view results should be returned from a "stable" set of shards.
+Optional
updateWhether to update the index prior to returning the result.
+Optional
useUse 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.
+Parameters for the postPartitionSearchAsStream
operation.
Optional
bookmarkOpaque bookmark token used when paginating results.
+Path parameter to specify the database name.
+Path parameter to specify the design document name. The design document name is the design document ID
+excluding the _design/
prefix.
Optional
headersOptional
highlightSpecifies which fields to highlight. If specified, the result object contains a highlights field with an +entry for each specified field.
+Optional
highlightNumber 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.
+Optional
highlightA string that is inserted after the highlighted word in the highlights output.
+Optional
highlightA string that is inserted before the highlighted word in the highlights output.
+Optional
highlightNumber of characters in each fragment for highlights.
+Optional
includeInclude the full content of the documents in the return.
+Optional
includeA 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.
+Path parameter to specify the index name.
+Optional
limitLimit the number of the returned documents to the specified number.
+Path parameter to specify the database partition key.
+The Lucene query to execute.
+Optional
sortSpecifies 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.
+Optional
staleDo not wait for the index to finish building to return results.
+Parameters for the postPartitionSearch
operation.
Optional
bookmarkOpaque bookmark token used when paginating results.
+Path parameter to specify the database name.
+Path parameter to specify the design document name. The design document name is the design document ID
+excluding the _design/
prefix.
Optional
headersOptional
highlightSpecifies which fields to highlight. If specified, the result object contains a highlights field with an +entry for each specified field.
+Optional
highlightNumber 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.
+Optional
highlightA string that is inserted after the highlighted word in the highlights output.
+Optional
highlightA string that is inserted before the highlighted word in the highlights output.
+Optional
highlightNumber of characters in each fragment for highlights.
+Optional
includeInclude the full content of the documents in the return.
+Optional
includeA 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.
+Path parameter to specify the index name.
+Optional
limitLimit the number of the returned documents to the specified number.
+Path parameter to specify the database partition key.
+The Lucene query to execute.
+Optional
sortSpecifies 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.
+Optional
staleDo not wait for the index to finish building to return results.
+Parameters for the postPartitionViewAsStream
operation.
Optional
attParameter to specify whether to include the encoding information in attachment stubs if the particular +attachment is compressed.
+Optional
attachmentsParameter to specify whether to include attachments bodies in a response.
+Optional
conflictsParameter to specify whether to include a list of conflicted revisions in each returned document. Active
+only when include_docs
is true
.
Path parameter to specify the database name.
+Path parameter to specify the design document name. The design document name is the design document ID
+excluding the _design/
prefix.
Optional
descendingParameter to specify whether to return the documents in descending by key order.
+Optional
endSchema for any JSON type.
+Optional
endSchema for a document ID.
+Optional
groupParameter to specify whether to group reduced results by key. Valid only if a reduce function defined in the
+view. If the view emits key in JSON array format, then it is possible to reduce groups further based on the
+number of array elements with the group_level
parameter.
Optional
groupParameter 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.
Optional
headersOptional
includeParameter to specify whether to include the full content of the documents in the response.
+Optional
inclusiveParameter to specify whether the specified end key should be included in the result.
+Optional
keySchema for any JSON type.
+Optional
keysParameter to specify returning only documents that match any of the specified keys. A JSON array of keys +that match the key type emitted by the view function.
+Optional
limitParameter to specify the number of returned documents to limit the result to.
+Path parameter to specify the database partition key.
+Optional
reduceParameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce +function is defined.
+Optional
skipParameter to specify the number of records before starting to return the results.
+Optional
startSchema for any JSON type.
+Optional
startSchema for a document ID.
+Optional
updateParameter 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.Optional
updateParameter to specify whether to include in the response an update_seq value indicating the sequence id of +the database the view reflects.
+Path parameter to specify the map reduce view function name.
+Parameters for the postPartitionView
operation.
Optional
attParameter to specify whether to include the encoding information in attachment stubs if the particular +attachment is compressed.
+Optional
attachmentsParameter to specify whether to include attachments bodies in a response.
+Optional
conflictsParameter to specify whether to include a list of conflicted revisions in each returned document. Active
+only when include_docs
is true
.
Path parameter to specify the database name.
+Path parameter to specify the design document name. The design document name is the design document ID
+excluding the _design/
prefix.
Optional
descendingParameter to specify whether to return the documents in descending by key order.
+Optional
endSchema for any JSON type.
+Optional
endSchema for a document ID.
+Optional
groupParameter to specify whether to group reduced results by key. Valid only if a reduce function defined in the
+view. If the view emits key in JSON array format, then it is possible to reduce groups further based on the
+number of array elements with the group_level
parameter.
Optional
groupParameter 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.
Optional
headersOptional
includeParameter to specify whether to include the full content of the documents in the response.
+Optional
inclusiveParameter to specify whether the specified end key should be included in the result.
+Optional
keySchema for any JSON type.
+Optional
keysParameter to specify returning only documents that match any of the specified keys. A JSON array of keys +that match the key type emitted by the view function.
+Optional
limitParameter to specify the number of returned documents to limit the result to.
+Path parameter to specify the database partition key.
+Optional
reduceParameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce +function is defined.
+Optional
skipParameter to specify the number of records before starting to return the results.
+Optional
startSchema for any JSON type.
+Optional
startSchema for a document ID.
+Optional
updateParameter 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.Optional
updateParameter to specify whether to include in the response an update_seq value indicating the sequence id of +the database the view reflects.
+Path parameter to specify the map reduce view function name.
+Parameters for the postRevsDiff
operation.
Parameters for the postSearchAsStream
operation.
Optional
bookmarkOpaque bookmark token used when paginating results.
+Optional
countsThis 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.
+Path parameter to specify the database name.
+Path parameter to specify the design document name. The design document name is the design document ID
+excluding the _design/
prefix.
Optional
drilldownRestrict 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.
+Optional
groupField 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.
+Optional
groupMaximum group count. This field can be used only if group_field is specified. This option is only available +when making global queries.
+Optional
groupThis 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.
+Optional
headersOptional
highlightSpecifies which fields to highlight. If specified, the result object contains a highlights field with an +entry for each specified field.
+Optional
highlightNumber 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.
+Optional
highlightA string that is inserted after the highlighted word in the highlights output.
+Optional
highlightA string that is inserted before the highlighted word in the highlights output.
+Optional
highlightNumber of characters in each fragment for highlights.
+Optional
includeInclude the full content of the documents in the return.
+Optional
includeA 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.
+Path parameter to specify the index name.
+Optional
limitLimit the number of the returned documents to the specified number.
+The Lucene query to execute.
+Optional
rangesThis field defines 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. The field names of the +JSON objects are names for ranges. The values are strings that describe the range, for example "[0 TO 10]". This +option is only available when making global queries.
+Optional
sortSpecifies 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.
+Optional
staleDo not wait for the index to finish building to return results.
+Parameters for the postSearch
operation.
Optional
bookmarkOpaque bookmark token used when paginating results.
+Optional
countsThis 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.
+Path parameter to specify the database name.
+Path parameter to specify the design document name. The design document name is the design document ID
+excluding the _design/
prefix.
Optional
drilldownRestrict 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.
+Optional
groupField 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.
+Optional
groupMaximum group count. This field can be used only if group_field is specified. This option is only available +when making global queries.
+Optional
groupThis 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.
+Optional
headersOptional
highlightSpecifies which fields to highlight. If specified, the result object contains a highlights field with an +entry for each specified field.
+Optional
highlightNumber 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.
+Optional
highlightA string that is inserted after the highlighted word in the highlights output.
+Optional
highlightA string that is inserted before the highlighted word in the highlights output.
+Optional
highlightNumber of characters in each fragment for highlights.
+Optional
includeInclude the full content of the documents in the return.
+Optional
includeA 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.
+Path parameter to specify the index name.
+Optional
limitLimit the number of the returned documents to the specified number.
+The Lucene query to execute.
+Optional
rangesThis field defines 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. The field names of the +JSON objects are names for ranges. The values are strings that describe the range, for example "[0 TO 10]". This +option is only available when making global queries.
+Optional
sortSpecifies 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.
+Optional
staleDo not wait for the index to finish building to return results.
+Parameters for the postViewAsStream
operation.
Optional
attParameter to specify whether to include the encoding information in attachment stubs if the particular +attachment is compressed.
+Optional
attachmentsParameter to specify whether to include attachments bodies in a response.
+Optional
conflictsParameter to specify whether to include a list of conflicted revisions in each returned document. Active
+only when include_docs
is true
.
Path parameter to specify the database name.
+Path parameter to specify the design document name. The design document name is the design document ID
+excluding the _design/
prefix.
Optional
descendingParameter to specify whether to return the documents in descending by key order.
+Optional
endSchema for any JSON type.
+Optional
endSchema for a document ID.
+Optional
groupParameter to specify whether to group reduced results by key. Valid only if a reduce function defined in the
+view. If the view emits key in JSON array format, then it is possible to reduce groups further based on the
+number of array elements with the group_level
parameter.
Optional
groupParameter 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.
Optional
headersOptional
includeParameter to specify whether to include the full content of the documents in the response.
+Optional
inclusiveParameter to specify whether the specified end key should be included in the result.
+Optional
keySchema for any JSON type.
+Optional
keysParameter to specify returning only documents that match any of the specified keys. A JSON array of keys +that match the key type emitted by the view function.
+Optional
limitParameter to specify the number of returned documents to limit the result to.
+Optional
reduceParameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce +function is defined.
+Optional
skipParameter to specify the number of records before starting to return the results.
+Optional
stableQuery parameter to specify whether use the same replica of the index on each request. The default value
+false
contacts all replicas and returns the result from the first, fastest, responder. Setting it to true
+when used in conjunction with update=false
may improve consistency at the expense of increased latency and
+decreased throughput if the selected replica is not the fastest of the available replicas.
Note: In general setting true
is discouraged and is strictly not recommended when using update=true
.
Optional
startSchema for any JSON type.
+Optional
startSchema for a document ID.
+Optional
updateParameter 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.Optional
updateParameter to specify whether to include in the response an update_seq value indicating the sequence id of +the database the view reflects.
+Path parameter to specify the map reduce view function name.
+Parameters for the postView
operation.
Optional
attParameter to specify whether to include the encoding information in attachment stubs if the particular +attachment is compressed.
+Optional
attachmentsParameter to specify whether to include attachments bodies in a response.
+Optional
conflictsParameter to specify whether to include a list of conflicted revisions in each returned document. Active
+only when include_docs
is true
.
Path parameter to specify the database name.
+Path parameter to specify the design document name. The design document name is the design document ID
+excluding the _design/
prefix.
Optional
descendingParameter to specify whether to return the documents in descending by key order.
+Optional
endSchema for any JSON type.
+Optional
endSchema for a document ID.
+Optional
groupParameter to specify whether to group reduced results by key. Valid only if a reduce function defined in the
+view. If the view emits key in JSON array format, then it is possible to reduce groups further based on the
+number of array elements with the group_level
parameter.
Optional
groupParameter 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.
Optional
headersOptional
includeParameter to specify whether to include the full content of the documents in the response.
+Optional
inclusiveParameter to specify whether the specified end key should be included in the result.
+Optional
keySchema for any JSON type.
+Optional
keysParameter to specify returning only documents that match any of the specified keys. A JSON array of keys +that match the key type emitted by the view function.
+Optional
limitParameter to specify the number of returned documents to limit the result to.
+Optional
reduceParameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce +function is defined.
+Optional
skipParameter to specify the number of records before starting to return the results.
+Optional
stableQuery parameter to specify whether use the same replica of the index on each request. The default value
+false
contacts all replicas and returns the result from the first, fastest, responder. Setting it to true
+when used in conjunction with update=false
may improve consistency at the expense of increased latency and
+decreased throughput if the selected replica is not the fastest of the available replicas.
Note: In general setting true
is discouraged and is strictly not recommended when using update=true
.
Optional
startSchema for any JSON type.
+Optional
startSchema for a document ID.
+Optional
updateParameter 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.Optional
updateParameter to specify whether to include in the response an update_seq value indicating the sequence id of +the database the view reflects.
+Path parameter to specify the map reduce view function name.
+Parameters for the postViewQueriesAsStream
operation.
Path parameter to specify the database name.
+Path parameter to specify the design document name. The design document name is the design document ID
+excluding the _design/
prefix.
Optional
headersAn 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.
+Path parameter to specify the map reduce view function name.
+Parameters for the postViewQueries
operation.
Path parameter to specify the database name.
+Path parameter to specify the design document name. The design document name is the design document ID
+excluding the _design/
prefix.
Optional
headersAn 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.
+Path parameter to specify the map reduce view function name.
+Parameters for the putAttachment
operation.
HTTP request body for attachment operations.
+Path parameter to specify the attachment name.
+Content-Type of the attachment.
+Path parameter to specify the database name.
+Path parameter to specify the document ID.
+Optional
headersOptional
ifHeader parameter for a conditional HTTP request matching an ETag.
+Optional
revQuery parameter to specify a document revision.
+Parameters for the putCloudantSecurityConfiguration
operation.
Optional
adminsSchema for names and roles to map to a database permission.
+Database permissions for Cloudant users and/or API keys.
+Optional
couchdbManage permissions using the _users
database only.
Path parameter to specify the database name.
+Optional
headersOptional
membersSchema for names and roles to map to a database permission.
+Parameters for the putCorsConfiguration
operation.
Optional
allowBoolean value to allow authentication credentials. If set to true, browser requests must be done by using +withCredentials = true.
+Optional
enableBoolean value to turn CORS on and off.
+Optional
headersAn 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.
+Parameters for the putDatabase
operation.
Path parameter to specify the database name.
+Optional
headersOptional
partitionedQuery parameter to specify whether to enable database partitions when creating a database.
+Optional
qThe 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.
+Parameters for the putDesignDocument
operation.
Optional
batchQuery parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted +response code immediately.
+Path parameter to specify the database name.
+Path parameter to specify the design document name. The design document name is the design document ID
+excluding the _design/
prefix.
HTTP request body for DesignDocument operations.
+Optional
headersOptional
ifHeader parameter for a conditional HTTP request matching an ETag.
+Optional
newQuery 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.
+Optional
revQuery parameter to specify a document revision.
+Parameters for the putDocument
operation.
Optional
batchQuery parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted +response code immediately.
+Optional
contentThe type of the input.
+Path parameter to specify the database name.
+Path parameter to specify the document ID.
+HTTP request body for Document operations.
+Optional
headersOptional
ifHeader parameter for a conditional HTTP request matching an ETag.
+Optional
newQuery 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.
+Optional
revQuery parameter to specify a document revision.
+Parameters for the putLocalDocument
operation.
Optional
batchQuery parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted +response code immediately.
+Optional
contentThe type of the input.
+Path parameter to specify the database name.
+Path parameter to specify the document ID.
+HTTP request body for Document operations.
+Optional
headersParameters for the putReplicationDocument
operation.
Optional
batchQuery parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted +response code immediately.
+Path parameter to specify the document ID.
+Optional
headersOptional
ifHeader parameter for a conditional HTTP request matching an ETag.
+Optional
newQuery 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.
+HTTP request body for replication operations.
+Optional
revQuery parameter to specify a document revision.
+Parameters for the putSecurity
operation.
Optional
adminsSchema for names and roles to map to a database permission.
+Optional
cloudantDatabase permissions for Cloudant users and/or API keys.
+Optional
couchdbManage permissions using the _users
database only.
Path parameter to specify the database name.
+Optional
headersOptional
membersSchema for names and roles to map to a database permission.
+ReplicationDocument.ReplicationDocument.Transport accepts additional properties of type any.
+Optional
_attachmentsOptional
_conflictsOptional
_deletedOptional
_deleted_Optional
_idOptional
_local_Optional
_revOptional
_revisionsOptional
_revs_Optional
cancelOptional
checkpoint_Optional
connection_Optional
continuousOptional
create_Optional
create_Optional
doc_Optional
filterOptional
http_Optional
ownerOptional
query_Optional
retries_Optional
selectorOptional
since_Optional
socket_Optional
source_Optional
target_Optional
use_Optional
use_Optional
user_Optional
winning_Optional
worker_Optional
worker_Optional
nodeOptional
sourceOptional
source_Optional
targetOptional
target_Optional
changes_Optional
checkpointed_Optional
doc_Optional
docs_Optional
docs_Optional
errorOptional
missing_Optional
revisions_Optional
source_Optional
through_ServerVendor.ServerVendor.Transport accepts additional properties of type string.
+Optional
att_Optional
attachmentsOptional
conflictsOptional
descendingOptional
end_Optional
end_Optional
groupOptional
group_Optional
include_Optional
inclusive_Optional
keyOptional
keysOptional
limitOptional
reduceOptional
skipOptional
stableOptional
start_Optional
start_Optional
updateOptional
update_Constants for the deleteAttachment
operation.
Constants for the deleteDesignDocument
operation.
Constants for the deleteDocument
operation.
Constants for the deleteLocalDocument
operation.
Constants for the deleteReplicationDocument
operation.
Constants for the getLocalDocument
operation.
Constants for the getSchedulerDocs
operation.
Constants for the postActivityTrackerEvents
operation.
Constants for the postChangesAsStream
operation.
Constants for the postDesignDocsQueries
operation.
Constants for the postDocument
operation.
Constants for the postPartitionSearchAsStream
operation.
Constants for the postPartitionSearch
operation.
Constants for the postPartitionViewAsStream
operation.
Constants for the postPartitionView
operation.
Constants for the postSearchAnalyze
operation.
Constants for the postSearchAsStream
operation.
Constants for the postViewAsStream
operation.
Constants for the putCloudantSecurityConfiguration
operation.
Constants for the putDesignDocument
operation.
Constants for the putDocument
operation.
Constants for the putLocalDocument
operation.
Constants for the putReplicationDocument
operation.
interfaces
+Configuration options for CouchDB session authentication.
+The password to be used in CouchDB session authentication.
+The username to be used in CouchDB session authentication.
+
A helper for using the changes feed.
+There are two modes of operation:
++- startOneOff to fetch the changes from the supplied since sequence
+until there are no further pending changes.
+- start to fetch the changes from the supplied since sequence and
+then continuing to listen indefinitely for further new changes.
+
+The starting sequence ID can be changed for either mode by using +CloudantV1.PostChangesParams.since. By default when using:
++- startOneOff the feed will start from the beginning.
+- start the feed will start from "now".
+
+In either mode the Stream of changes can be terminated early by calling +stop.
+By default ChangesFollower will suppress transient errors indefinitely and +endeavour to run to completion or listen forever. For applications where that +behaviour is not desirable an alternate constructor is available where a +errorTolerance may be specified to limit the time since the last successful +response that transient errors will be suppressed.
+It should be noted that errors considered terminal, for example, the database not +existing or invalid credentials are never suppressed and will throw an exception +immediately.
+The CloudantV1.PostChangesParams model of changes feed options is used to configure +the behaviour of the ChangesFollower. However, a subset of the options are +invalid as they are configured internally by the implementation and will cause +an Error to be thrown if supplied. These invalid +options are:
++- CloudantV1.PostChangesParams.descending
+- CloudantV1.PostChangesParams.feed
+- CloudantV1.PostChangesParams.heartbeat
+- CloudantV1.PostChangesParams.lastEventId
+(use CloudantV1.PostChangesParams.since instead)
+- CloudantV1.PostChangesParams.timeout
+
+Only the value of
+_selector
is permitted for +the CloudantV1.PostChangesParams.filter option. +Selector based filters perform better than JS based filters and using one +of the alternative JS based +filter types will cause ChangesFollower to throw an Error.It should also be noted that the CloudantV1.PostChangesParams.limit +parameter will truncate the stream at the given number of changes in either +operating mode.
+The ChangesFollower requires the CloudantV1 client to have +HTTP call and read timeouts of at least 1 minute. The default client +configuration has sufficiently long timeouts.
+