NoSQL database based on Apache CouchDB

See: https://cloud.ibm.com/docs/services/Cloudant/

Hierarchy

  • default
    • CloudantV1

Constructors

Properties

Methods

configureService createRequest deleteAttachment deleteDatabase deleteDesignDocument deleteDocument deleteIndex deleteLocalDocument deleteReplicationDocument getActiveTasks getActivityTrackerEvents getAllDbs getAttachment getCapacityThroughputInformation getCorsInformation getCurrentThroughputInformation getDatabaseInformation getDbUpdates getDesignDocument getDesignDocumentInformation getDocument getDocumentAsMixed getDocumentAsRelated getDocumentAsStream getDocumentShardsInfo getIndexesInformation getLocalDocument getMembershipInformation getPartitionInformation getReplicationDocument getSchedulerDocs getSchedulerDocument getSchedulerJob getSchedulerJobs getSearchDiskSize getSearchInfo getSecurity getServerInformation getSessionInformation getShardsInformation getTimeout getUpInformation getUuids headAttachment headDatabase headDesignDocument headDocument headLocalDocument headReplicationDocument headSchedulerDocument headSchedulerJob headUpInformation postActivityTrackerEvents postAllDocs postAllDocsAsStream postAllDocsQueries postAllDocsQueriesAsStream postApiKeys postBulkDocs postBulkGet postBulkGetAsMixed postBulkGetAsRelated postBulkGetAsStream postChanges postChangesAsStream postDbsInfo postDesignDocs postDesignDocsQueries postDocument postExplain postFind postFindAsStream postIndex postPartitionAllDocs postPartitionAllDocsAsStream postPartitionExplain postPartitionFind postPartitionFindAsStream postPartitionSearch postPartitionSearchAsStream postPartitionView postPartitionViewAsStream postReplicator postRevsDiff postSearch postSearchAnalyze postSearchAsStream postView postViewAsStream postViewQueries postViewQueriesAsStream putAttachment putCapacityThroughputConfiguration putCloudantSecurityConfiguration putCorsConfiguration putDatabase putDesignDocument putDocument putLocalDocument putReplicationDocument putSecurity setEnableGzipCompression setServiceUrl newInstance

Constructors

  • Construct a CloudantV1 object.

    Parameters

    • options: UserOptions

      Options for the service.

      • serviceUrl

        The base URL for the service

      • headers

        Default headers that shall be included with every request to the service.

      • authenticator

        The Authenticator object used to authenticate requests to the service

    Returns CloudantV1

Properties

timeout: number
_logger: SDKLogger = ...
DEFAULT_SERVICE_NAME: string = 'cloudant'
DEFAULT_SERVICE_URL: string = 'https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud'

Methods

  • Configure the service using external configuration Cloudant specific extensions:

    • Apply the new base service options on CouchdbSessionAuthenticator.

    Parameters

    • serviceName: string

      The name of the service. Will be used to read from external configuration.

    Returns void

  • Extend createRequest to handle document and attachment validation.

    Parameters

    • parameters: any

    Returns Promise<any>

  • Delete an attachment.

    Deletes the attachment with the filename, {attachment_name}, from the specified doc. You must supply the rev query parameter or If-Match header with the current revision to delete the attachment.

    Parameters

    • params: DeleteAttachmentParams

      The parameters to send to the service.

      Parameters for the deleteAttachment operation.

      • attachmentName: string

        Path parameter to specify the attachment name.

      • Optionalbatch?: string

        Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.

      • db: string

        Path parameter to specify the database name.

      • docId: string

        Path parameter to specify the document ID.

      • Optionalheaders?: OutgoingHttpHeaders
      • OptionalifMatch?: string

        Header parameter for a conditional HTTP request matching an ETag.

      • Optionalrev?: string

        Query parameter to specify a document revision.

    Returns Promise<Response<CloudantV1.DocumentResult>>

  • 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.

    Parameters

    • params: DeleteDatabaseParams

      The parameters to send to the service.

      Parameters for the deleteDatabase operation.

      • db: string

        Path parameter to specify the database name.

      • Optionalheaders?: OutgoingHttpHeaders

    Returns Promise<Response<CloudantV1.Ok>>

  • 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.

    Parameters

    • params: DeleteDesignDocumentParams

      The parameters to send to the service.

      Parameters for the deleteDesignDocument operation.

      • Optionalbatch?: string

        Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.

      • db: string

        Path parameter to specify the database name.

      • ddoc: string

        Path parameter to specify the design document name. The design document name is the design document ID excluding the _design/ prefix.

      • Optionalheaders?: OutgoingHttpHeaders
      • OptionalifMatch?: string

        Header parameter for a conditional HTTP request matching an ETag.

      • Optionalrev?: string

        Query parameter to specify a document revision.

    Returns Promise<Response<CloudantV1.DocumentResult>>

  • 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.

    Parameters

    • params: DeleteDocumentParams

      The parameters to send to the service.

      Parameters for the deleteDocument operation.

      • Optionalbatch?: string

        Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.

      • db: string

        Path parameter to specify the database name.

      • docId: string

        Path parameter to specify the document ID.

      • Optionalheaders?: OutgoingHttpHeaders
      • OptionalifMatch?: string

        Header parameter for a conditional HTTP request matching an ETag.

      • Optionalrev?: string

        Query parameter to specify a document revision.

    Returns Promise<Response<CloudantV1.DocumentResult>>

  • Delete an index.

    Delete the index functions from the design document and index files on the server.

    Parameters

    • params: DeleteIndexParams

      The parameters to send to the service.

      Parameters for the deleteIndex operation.

      • db: string

        Path parameter to specify the database name.

      • ddoc: string

        Path parameter to specify the design document name. The design document name is the design document ID excluding the _design/ prefix.

      • Optionalheaders?: OutgoingHttpHeaders
      • index: string

        Path parameter to specify the index name.

      • type: string

        Path parameter to specify the index type.

    Returns Promise<Response<CloudantV1.Ok>>

  • 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.

    Parameters

    • params: DeleteLocalDocumentParams

      The parameters to send to the service.

      Parameters for the deleteLocalDocument operation.

      • Optionalbatch?: string

        Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.

      • db: string

        Path parameter to specify the database name.

      • docId: string

        Path parameter to specify the document ID.

      • Optionalheaders?: OutgoingHttpHeaders

    Returns Promise<Response<CloudantV1.DocumentResult>>

  • Cancel a persistent replication.

    Cancels a replication by deleting the document that describes it from the _replicator database.

    Parameters

    • params: DeleteReplicationDocumentParams

      The parameters to send to the service.

      Parameters for the deleteReplicationDocument operation.

      • Optionalbatch?: string

        Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.

      • docId: string

        Path parameter to specify the ID of the stored replication configuration in the _replicator database.

      • Optionalheaders?: OutgoingHttpHeaders
      • OptionalifMatch?: string

        Header parameter for a conditional HTTP request matching an ETag.

      • Optionalrev?: string

        Query parameter to specify a document revision.

    Returns Promise<Response<CloudantV1.DocumentResult>>

  • 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.

    Parameters

    • Optionalparams: GetActiveTasksParams

      The parameters to send to the service.

      Parameters for the getActiveTasks operation.

      • Optionalheaders?: OutgoingHttpHeaders

    Returns Promise<Response<CloudantV1.ActiveTask[]>>

  • Query a list of all database names in the instance.

    Query to retrieve a list of database names from the instance.

    Parameters

    • Optionalparams: GetAllDbsParams

      The parameters to send to the service.

      Parameters for the getAllDbs operation.

      • Optionaldescending?: boolean

        Query parameter to specify whether to return the documents in descending by key order.

      • OptionalendKey?: string

        Query parameter to specify to stop returning records when the specified key is reached. String representation of any JSON type that matches the key type emitted by the view function.

      • Optionalheaders?: OutgoingHttpHeaders
      • Optionallimit?: number

        Query parameter to specify the number of returned documents to limit the result to.

      • Optionalskip?: number

        Query parameter to specify the number of records before starting to return the results.

      • OptionalstartKey?: string

        Query parameter to specify to start returning records from the specified key. String representation of any JSON type that matches the key type emitted by the view function.

    Returns Promise<Response<string[]>>

  • 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.

    Parameters

    • params: GetAttachmentParams

      The parameters to send to the service.

      Parameters for the getAttachment operation.

      • Optionalaccept?: string

        The type of the response: /.

      • attachmentName: string

        Path parameter to specify the attachment name.

      • db: string

        Path parameter to specify the database name.

      • docId: string

        Path parameter to specify the document ID.

      • Optionalheaders?: OutgoingHttpHeaders
      • OptionalifMatch?: string

        Header parameter for a conditional HTTP request matching an ETag.

      • OptionalifNoneMatch?: string

        Header parameter for a conditional HTTP request not matching an ETag.

      • Optionalrange?: string

        Header parameter to specify the byte range for a request. This allows the implementation of resumable downloads and skippable streams. This is available for all attachments inside CouchDB.

      • Optionalrev?: string

        Query parameter to specify a document revision.

    Returns Promise<Response<ReadableStream>>

  • 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.

    Parameters

    • Optionalparams: GetDbUpdatesParams

      The parameters to send to the service.

      Parameters for the getDbUpdates operation.

      • Optionaldescending?: boolean

        Query parameter to specify whether to return the documents in descending by key order.

      • Optionalfeed?: string

        Query parameter to specify the changes feed type.

      • Optionalheaders?: OutgoingHttpHeaders
      • Optionalheartbeat?: number

        Query parameter to specify the period in milliseconds after which an empty line is sent in the results. Off by default and only applicable for continuous 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:

        • Use the timeout parameter with a value that is compatible with your network environment.
        • Switch to scheduled usage of one of the non-continuous changes feed types (normal or longpoll).
        • Use TCP keepalive.
      • Optionallimit?: number

        Query parameter to specify the number of returned documents to limit the result to.

      • Optionalsince?: string

        Query parameter to specify to start the results from the change immediately after the given update sequence. Can be a valid update sequence or now value. Default is 0 i.e. all changes.

      • Optionaltimeout?: number

        Query parameter to specify the maximum period in milliseconds to wait for a change before the response is sent, even if there are no results. Only applicable for longpoll 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.

    Returns Promise<Response<CloudantV1.DbUpdates>>

    this method is deprecated and may be removed in a future release

  • 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.

    Parameters

    • params: GetDesignDocumentParams

      The parameters to send to the service.

      Parameters for the getDesignDocument operation.

      • Optionalattachments?: boolean

        Query parameter to specify whether to include attachments bodies in a response.

      • OptionalattEncodingInfo?: boolean

        Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.

      • Optionalconflicts?: boolean

        Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when include_docs is true.

      • db: string

        Path parameter to specify the database name.

      • ddoc: string

        Path parameter to specify the design document name. The design document name is the design document ID excluding the _design/ prefix.

      • OptionaldeletedConflicts?: boolean

        Query parameter to specify whether to include a list of deleted conflicted revisions in the _deleted_conflicts property of the returned document.

      • Optionalheaders?: OutgoingHttpHeaders
      • OptionalifNoneMatch?: string

        Header parameter for a conditional HTTP request not matching an ETag.

      • Optionallatest?: boolean

        Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.

      • OptionallocalSeq?: boolean

        Query parameter to specify whether to include the last update sequence for the document.

      • Optionalmeta?: boolean

        Query parameter to specify whether to include document meta information. Acts the same as specifying all of the conflicts, deleted_conflicts and open_revs query parameters.

      • Optionalrev?: string

        Query parameter to specify a document revision.

      • Optionalrevs?: boolean

        Query parameter to specify whether to include a list of all known document revisions.

      • OptionalrevsInfo?: boolean

        Query parameter to specify whether to includes detailed information for all known document revisions.

    Returns Promise<Response<CloudantV1.DesignDocument>>

  • 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.

    Parameters

    • params: GetDocumentParams

      The parameters to send to the service.

      Parameters for the getDocument operation.

      • Optionalattachments?: boolean

        Query parameter to specify whether to include attachments bodies in a response.

      • OptionalattEncodingInfo?: boolean

        Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.

      • Optionalconflicts?: boolean

        Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when include_docs is true.

      • db: string

        Path parameter to specify the database name.

      • OptionaldeletedConflicts?: boolean

        Query parameter to specify whether to include a list of deleted conflicted revisions in the _deleted_conflicts property of the returned document.

      • docId: string

        Path parameter to specify the document ID.

      • Optionalheaders?: OutgoingHttpHeaders
      • OptionalifNoneMatch?: string

        Header parameter for a conditional HTTP request not matching an ETag.

      • Optionallatest?: boolean

        Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.

      • OptionallocalSeq?: boolean

        Query parameter to specify whether to include the last update sequence for the document.

      • Optionalmeta?: boolean

        Query parameter to specify whether to include document meta information. Acts the same as specifying all of the conflicts, deleted_conflicts and open_revs query parameters.

      • Optionalrev?: string

        Query parameter to specify a document revision.

      • Optionalrevs?: boolean

        Query parameter to specify whether to include a list of all known document revisions.

      • OptionalrevsInfo?: boolean

        Query parameter to specify whether to includes detailed information for all known document revisions.

    Returns Promise<Response<CloudantV1.Document>>

  • 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.

    Parameters

    • params: GetDocumentAsMixedParams

      The parameters to send to the service.

      Parameters for the getDocumentAsMixed operation.

      • Optionalattachments?: boolean

        Query parameter to specify whether to include attachments bodies in a response.

      • OptionalattEncodingInfo?: boolean

        Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.

      • Optionalconflicts?: boolean

        Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when include_docs is true.

      • db: string

        Path parameter to specify the database name.

      • OptionaldeletedConflicts?: boolean

        Query parameter to specify whether to include a list of deleted conflicted revisions in the _deleted_conflicts property of the returned document.

      • docId: string

        Path parameter to specify the document ID.

      • Optionalheaders?: OutgoingHttpHeaders
      • OptionalifNoneMatch?: string

        Header parameter for a conditional HTTP request not matching an ETag.

      • Optionallatest?: boolean

        Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.

      • OptionallocalSeq?: boolean

        Query parameter to specify whether to include the last update sequence for the document.

      • Optionalmeta?: boolean

        Query parameter to specify whether to include document meta information. Acts the same as specifying all of the conflicts, deleted_conflicts and open_revs query parameters.

      • Optionalrev?: string

        Query parameter to specify a document revision.

      • Optionalrevs?: boolean

        Query parameter to specify whether to include a list of all known document revisions.

      • OptionalrevsInfo?: boolean

        Query parameter to specify whether to includes detailed information for all known document revisions.

    Returns Promise<Response<ReadableStream>>

  • 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.

    Parameters

    • params: GetDocumentAsRelatedParams

      The parameters to send to the service.

      Parameters for the getDocumentAsRelated operation.

      • Optionalattachments?: boolean

        Query parameter to specify whether to include attachments bodies in a response.

      • OptionalattEncodingInfo?: boolean

        Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.

      • Optionalconflicts?: boolean

        Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when include_docs is true.

      • db: string

        Path parameter to specify the database name.

      • OptionaldeletedConflicts?: boolean

        Query parameter to specify whether to include a list of deleted conflicted revisions in the _deleted_conflicts property of the returned document.

      • docId: string

        Path parameter to specify the document ID.

      • Optionalheaders?: OutgoingHttpHeaders
      • OptionalifNoneMatch?: string

        Header parameter for a conditional HTTP request not matching an ETag.

      • Optionallatest?: boolean

        Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.

      • OptionallocalSeq?: boolean

        Query parameter to specify whether to include the last update sequence for the document.

      • Optionalmeta?: boolean

        Query parameter to specify whether to include document meta information. Acts the same as specifying all of the conflicts, deleted_conflicts and open_revs query parameters.

      • Optionalrev?: string

        Query parameter to specify a document revision.

      • Optionalrevs?: boolean

        Query parameter to specify whether to include a list of all known document revisions.

      • OptionalrevsInfo?: boolean

        Query parameter to specify whether to includes detailed information for all known document revisions.

    Returns Promise<Response<ReadableStream>>

  • 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.

    Parameters

    • params: GetDocumentAsStreamParams

      The parameters to send to the service.

      Parameters for the getDocumentAsStream operation.

      • Optionalattachments?: boolean

        Query parameter to specify whether to include attachments bodies in a response.

      • OptionalattEncodingInfo?: boolean

        Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.

      • Optionalconflicts?: boolean

        Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when include_docs is true.

      • db: string

        Path parameter to specify the database name.

      • OptionaldeletedConflicts?: boolean

        Query parameter to specify whether to include a list of deleted conflicted revisions in the _deleted_conflicts property of the returned document.

      • docId: string

        Path parameter to specify the document ID.

      • Optionalheaders?: OutgoingHttpHeaders
      • OptionalifNoneMatch?: string

        Header parameter for a conditional HTTP request not matching an ETag.

      • Optionallatest?: boolean

        Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.

      • OptionallocalSeq?: boolean

        Query parameter to specify whether to include the last update sequence for the document.

      • Optionalmeta?: boolean

        Query parameter to specify whether to include document meta information. Acts the same as specifying all of the conflicts, deleted_conflicts and open_revs query parameters.

      • Optionalrev?: string

        Query parameter to specify a document revision.

      • Optionalrevs?: boolean

        Query parameter to specify whether to include a list of all known document revisions.

      • OptionalrevsInfo?: boolean

        Query parameter to specify whether to includes detailed information for all known document revisions.

    Returns Promise<Response<ReadableStream>>

  • 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.

    Parameters

    • params: GetIndexesInformationParams

      The parameters to send to the service.

      Parameters for the getIndexesInformation operation.

      • db: string

        Path parameter to specify the database name.

      • Optionalheaders?: OutgoingHttpHeaders

    Returns Promise<Response<CloudantV1.IndexesInformation>>

  • 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.

    Parameters

    • params: GetLocalDocumentParams

      The parameters to send to the service.

      Parameters for the getLocalDocument operation.

      • Optionalaccept?: string

        The type of the response: application/json, multipart/mixed, multipart/related, or application/octet-stream.

      • Optionalattachments?: boolean

        Query parameter to specify whether to include attachments bodies in a response.

      • OptionalattEncodingInfo?: boolean

        Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.

      • db: string

        Path parameter to specify the database name.

      • docId: string

        Path parameter to specify the document ID.

      • Optionalheaders?: OutgoingHttpHeaders
      • OptionalifNoneMatch?: string

        Header parameter for a conditional HTTP request not matching an ETag.

      • OptionallocalSeq?: boolean

        Query parameter to specify whether to include the last update sequence for the document.

    Returns Promise<Response<CloudantV1.Document>>

  • Retrieve the configuration for a persistent replication.

    Retrieves a replication document from the _replicator database to view the configuration of the replication. The status of the replication is no longer recorded in the document but can be checked via the replication scheduler.

    Parameters

    • params: GetReplicationDocumentParams

      The parameters to send to the service.

      Parameters for the getReplicationDocument operation.

      • Optionalattachments?: boolean

        Query parameter to specify whether to include attachments bodies in a response.

      • OptionalattEncodingInfo?: boolean

        Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.

      • Optionalconflicts?: boolean

        Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when include_docs is true.

      • OptionaldeletedConflicts?: boolean

        Query parameter to specify whether to include a list of deleted conflicted revisions in the _deleted_conflicts property of the returned document.

      • docId: string

        Path parameter to specify the ID of the stored replication configuration in the _replicator database.

      • Optionalheaders?: OutgoingHttpHeaders
      • OptionalifNoneMatch?: string

        Header parameter for a conditional HTTP request not matching an ETag.

      • Optionallatest?: boolean

        Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.

      • OptionallocalSeq?: boolean

        Query parameter to specify whether to include the last update sequence for the document.

      • Optionalmeta?: boolean

        Query parameter to specify whether to include document meta information. Acts the same as specifying all of the conflicts, deleted_conflicts and open_revs query parameters.

      • Optionalrev?: string

        Query parameter to specify a document revision.

      • Optionalrevs?: boolean

        Query parameter to specify whether to include a list of all known document revisions.

      • OptionalrevsInfo?: boolean

        Query parameter to specify whether to includes detailed information for all known document revisions.

    Returns Promise<Response<CloudantV1.ReplicationDocument>>

  • 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.

    Parameters

    • Optionalparams: GetSchedulerDocsParams

      The parameters to send to the service.

      Parameters for the getSchedulerDocs operation.

      • Optionalheaders?: OutgoingHttpHeaders
      • Optionallimit?: number

        Query parameter to specify the number of returned documents to limit the result to.

      • Optionalskip?: number

        Query parameter to specify the number of records before starting to return the results.

      • Optionalstates?: string[] | States[]

        Query parameter to include only replication documents in the specified states. String must be a comma-delimited string.

    Returns Promise<Response<CloudantV1.SchedulerDocsResult>>

  • 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.

    Parameters

    • Optionalparams: GetSchedulerJobsParams

      The parameters to send to the service.

      Parameters for the getSchedulerJobs operation.

      • Optionalheaders?: OutgoingHttpHeaders
      • Optionallimit?: number

        Query parameter to specify the number of returned jobs to limit the result to.

      • Optionalskip?: number

        Query parameter to specify the number of records before starting to return the results.

    Returns Promise<Response<CloudantV1.SchedulerJobsResult>>

  • Retrieve information about a search index.

    Retrieve search index metadata information, such as the size of the index on disk.

    Parameters

    • params: GetSearchInfoParams

      The parameters to send to the service.

      Parameters for the getSearchInfo operation.

      • db: string

        Path parameter to specify the database name.

      • ddoc: string

        Path parameter to specify the design document name. The design document name is the design document ID excluding the _design/ prefix.

      • Optionalheaders?: OutgoingHttpHeaders
      • index: string

        Path parameter to specify the index name.

    Returns Promise<Response<CloudantV1.SearchInfoResult>>

  • 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.

    Parameters

    • params: GetSecurityParams

      The parameters to send to the service.

      Parameters for the getSecurity operation.

      • db: string

        Path parameter to specify the database name.

      • Optionalheaders?: OutgoingHttpHeaders

    Returns Promise<Response<CloudantV1.Security>>

  • 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.

    Parameters

    • Optionalparams: GetServerInformationParams

      The parameters to send to the service.

      Parameters for the getServerInformation operation.

      • Optionalheaders?: OutgoingHttpHeaders

    Returns Promise<Response<CloudantV1.ServerInformation>>

  • 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.

    Parameters

    • Optionalparams: GetUpInformationParams

      The parameters to send to the service.

      Parameters for the getUpInformation operation.

      • Optionalheaders?: OutgoingHttpHeaders

    Returns Promise<Response<CloudantV1.UpInformation>>

  • 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.

    Parameters

    • Optionalparams: GetUuidsParams

      The parameters to send to the service.

      Parameters for the getUuids operation.

      • Optionalcount?: number

        Query parameter to specify the number of UUIDs to return.

      • Optionalheaders?: OutgoingHttpHeaders

    Returns Promise<Response<CloudantV1.UuidsResult>>

  • 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.

    Parameters

    • params: HeadAttachmentParams

      The parameters to send to the service.

      Parameters for the headAttachment operation.

      • attachmentName: string

        Path parameter to specify the attachment name.

      • db: string

        Path parameter to specify the database name.

      • docId: string

        Path parameter to specify the document ID.

      • Optionalheaders?: OutgoingHttpHeaders
      • OptionalifMatch?: string

        Header parameter for a conditional HTTP request matching an ETag.

      • OptionalifNoneMatch?: string

        Header parameter for a conditional HTTP request not matching an ETag.

      • Optionalrev?: string

        Query parameter to specify a document revision.

    Returns Promise<Response<EmptyObject>>

  • 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.

    Parameters

    • params: HeadDatabaseParams

      The parameters to send to the service.

      Parameters for the headDatabase operation.

      • db: string

        Path parameter to specify the database name.

      • Optionalheaders?: OutgoingHttpHeaders

    Returns Promise<Response<EmptyObject>>

  • 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.

    Parameters

    • params: HeadDesignDocumentParams

      The parameters to send to the service.

      Parameters for the headDesignDocument operation.

      • db: string

        Path parameter to specify the database name.

      • ddoc: string

        Path parameter to specify the design document name. The design document name is the design document ID excluding the _design/ prefix.

      • Optionalheaders?: OutgoingHttpHeaders
      • OptionalifNoneMatch?: string

        Header parameter for a conditional HTTP request not matching an ETag.

    Returns Promise<Response<EmptyObject>>

  • 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.

    Parameters

    • params: HeadDocumentParams

      The parameters to send to the service.

      Parameters for the headDocument operation.

      • db: string

        Path parameter to specify the database name.

      • docId: string

        Path parameter to specify the document ID.

      • Optionalheaders?: OutgoingHttpHeaders
      • OptionalifNoneMatch?: string

        Header parameter for a conditional HTTP request not matching an ETag.

      • Optionallatest?: boolean

        Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.

      • Optionalrev?: string

        Query parameter to specify a document revision.

    Returns Promise<Response<EmptyObject>>

  • 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.

    Parameters

    • params: HeadLocalDocumentParams

      The parameters to send to the service.

      Parameters for the headLocalDocument operation.

      • db: string

        Path parameter to specify the database name.

      • docId: string

        Path parameter to specify the document ID.

      • Optionalheaders?: OutgoingHttpHeaders
      • OptionalifNoneMatch?: string

        Header parameter for a conditional HTTP request not matching an ETag.

    Returns Promise<Response<EmptyObject>>

  • Retrieve the HTTP headers for a persistent replication.

    Retrieves the HTTP headers containing minimal amount of information about the specified replication document from the _replicator database. The method supports the same query arguments as the GET /_replicator/{doc_id} method, but only headers like content length and the revision (ETag header) are returned.

    Parameters

    • params: HeadReplicationDocumentParams

      The parameters to send to the service.

      Parameters for the headReplicationDocument operation.

      • docId: string

        Path parameter to specify the ID of the stored replication configuration in the _replicator database.

      • Optionalheaders?: OutgoingHttpHeaders
      • OptionalifNoneMatch?: string

        Header parameter for a conditional HTTP request not matching an ETag.

    Returns Promise<Response<EmptyObject>>

  • 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.

    Parameters

    • params: HeadSchedulerDocumentParams

      The parameters to send to the service.

      Parameters for the headSchedulerDocument operation.

      • docId: string

        Path parameter to specify the document ID.

      • Optionalheaders?: OutgoingHttpHeaders

    Returns Promise<Response<EmptyObject>>

  • 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.

    Parameters

    • params: HeadSchedulerJobParams

      The parameters to send to the service.

      Parameters for the headSchedulerJob operation.

      • Optionalheaders?: OutgoingHttpHeaders
      • jobId: string

        Path parameter to specify the replication job id.

    Returns Promise<Response<EmptyObject>>

  • 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.

    Parameters

    • params: PostAllDocsParams

      The parameters to send to the service.

      Parameters for the postAllDocs operation.

      • Optionalattachments?: boolean

        Parameter to specify whether to include attachments bodies in a response.

      • OptionalattEncodingInfo?: boolean

        Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.

      • Optionalconflicts?: boolean

        Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when include_docs is true.

      • db: string

        Path parameter to specify the database name.

      • Optionaldescending?: boolean

        Parameter to specify whether to return the documents in descending by key order.

      • OptionalendKey?: string

        Schema for a document ID.

      • Optionalheaders?: OutgoingHttpHeaders
      • OptionalincludeDocs?: boolean

        Parameter to specify whether to include the full content of the documents in the response.

      • OptionalinclusiveEnd?: boolean

        Parameter to specify whether the specified end key should be included in the result.

      • Optionalkey?: string

        Schema for a document ID.

      • Optionalkeys?: string[]

        Schema for a list of document IDs.

      • Optionallimit?: number

        Parameter to specify the number of returned documents to limit the result to.

      • Optionalskip?: number

        Parameter to specify the number of records before starting to return the results.

      • OptionalstartKey?: string

        Schema for a document ID.

      • OptionalupdateSeq?: boolean

        Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.

    Returns Promise<Response<CloudantV1.AllDocsResult>>

  • 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.

    Parameters

    • params: PostAllDocsAsStreamParams

      The parameters to send to the service.

      Parameters for the postAllDocsAsStream operation.

      • Optionalattachments?: boolean

        Parameter to specify whether to include attachments bodies in a response.

      • OptionalattEncodingInfo?: boolean

        Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.

      • Optionalconflicts?: boolean

        Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when include_docs is true.

      • db: string

        Path parameter to specify the database name.

      • Optionaldescending?: boolean

        Parameter to specify whether to return the documents in descending by key order.

      • OptionalendKey?: string

        Schema for a document ID.

      • Optionalheaders?: OutgoingHttpHeaders
      • OptionalincludeDocs?: boolean

        Parameter to specify whether to include the full content of the documents in the response.

      • OptionalinclusiveEnd?: boolean

        Parameter to specify whether the specified end key should be included in the result.

      • Optionalkey?: string

        Schema for a document ID.

      • Optionalkeys?: string[]

        Schema for a list of document IDs.

      • Optionallimit?: number

        Parameter to specify the number of returned documents to limit the result to.

      • Optionalskip?: number

        Parameter to specify the number of records before starting to return the results.

      • OptionalstartKey?: string

        Schema for a document ID.

      • OptionalupdateSeq?: boolean

        Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.

    Returns Promise<Response<ReadableStream>>

  • 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.

    Parameters

    • params: PostAllDocsQueriesParams

      The parameters to send to the service.

      Parameters for the postAllDocsQueries operation.

      • db: string

        Path parameter to specify the database name.

      • Optionalheaders?: OutgoingHttpHeaders
      • queries: CloudantV1.AllDocsQuery[]

        An array of query objects with fields for the parameters of each individual view query to be executed. The field names and their meaning are the same as the query parameters of a regular /_all_docs request.

    Returns Promise<Response<CloudantV1.AllDocsQueriesResult>>

  • 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.

    Parameters

    • params: PostAllDocsQueriesAsStreamParams

      The parameters to send to the service.

      Parameters for the postAllDocsQueriesAsStream operation.

      • db: string

        Path parameter to specify the database name.

      • Optionalheaders?: OutgoingHttpHeaders
      • queries: CloudantV1.AllDocsQuery[]

        An array of query objects with fields for the parameters of each individual view query to be executed. The field names and their meaning are the same as the query parameters of a regular /_all_docs request.

    Returns Promise<Response<ReadableStream>>

  • 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.

    Parameters

    • Optionalparams: PostApiKeysParams

      The parameters to send to the service.

      Parameters for the postApiKeys operation.

      • Optionalheaders?: OutgoingHttpHeaders

    Returns Promise<Response<CloudantV1.ApiKeysResult>>

  • 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.

    Parameters

    • params: PostBulkDocsParams

      The parameters to send to the service.

      Parameters for the postBulkDocs operation.

      • bulkDocs: Buffer | ReadableStream | CloudantV1.BulkDocs

        HTTP request body for postBulkDocs.

      • db: string

        Path parameter to specify the database name.

      • Optionalheaders?: OutgoingHttpHeaders

    Returns Promise<Response<CloudantV1.DocumentResult[]>>

  • Bulk query revision information for multiple documents.

    Fetch specific revisions or revision histories for multiple documents in bulk as replicators do.

    Parameters

    • params: PostBulkGetParams

      The parameters to send to the service.

      Parameters for the postBulkGet operation.

      • Optionalattachments?: boolean

        Query parameter to specify whether to include attachments bodies in a response.

      • OptionalattEncodingInfo?: boolean

        Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.

      • db: string

        Path parameter to specify the database name.

      • docs: CloudantV1.BulkGetQueryDocument[]

        List of document items to get in bulk.

      • Optionalheaders?: OutgoingHttpHeaders
      • Optionallatest?: boolean

        Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.

      • Optionalrevs?: boolean

        Query parameter to specify whether to include a list of all known document revisions.

    Returns Promise<Response<CloudantV1.BulkGetResult>>

  • Bulk query revision information for multiple documents as mixed.

    Fetch specific revisions or revision histories for multiple documents in bulk as replicators do.

    Parameters

    • params: PostBulkGetAsMixedParams

      The parameters to send to the service.

      Parameters for the postBulkGetAsMixed operation.

      • Optionalattachments?: boolean

        Query parameter to specify whether to include attachments bodies in a response.

      • OptionalattEncodingInfo?: boolean

        Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.

      • db: string

        Path parameter to specify the database name.

      • docs: CloudantV1.BulkGetQueryDocument[]

        List of document items to get in bulk.

      • Optionalheaders?: OutgoingHttpHeaders
      • Optionallatest?: boolean

        Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.

      • Optionalrevs?: boolean

        Query parameter to specify whether to include a list of all known document revisions.

    Returns Promise<Response<ReadableStream>>

  • Bulk query revision information for multiple documents as related.

    Fetch specific revisions or revision histories for multiple documents in bulk as replicators do.

    Parameters

    • params: PostBulkGetAsRelatedParams

      The parameters to send to the service.

      Parameters for the postBulkGetAsRelated operation.

      • Optionalattachments?: boolean

        Query parameter to specify whether to include attachments bodies in a response.

      • OptionalattEncodingInfo?: boolean

        Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.

      • db: string

        Path parameter to specify the database name.

      • docs: CloudantV1.BulkGetQueryDocument[]

        List of document items to get in bulk.

      • Optionalheaders?: OutgoingHttpHeaders
      • Optionallatest?: boolean

        Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.

      • Optionalrevs?: boolean

        Query parameter to specify whether to include a list of all known document revisions.

    Returns Promise<Response<ReadableStream>>

  • Bulk query revision information for multiple documents as stream.

    Fetch specific revisions or revision histories for multiple documents in bulk as replicators do.

    Parameters

    • params: PostBulkGetAsStreamParams

      The parameters to send to the service.

      Parameters for the postBulkGetAsStream operation.

      • Optionalattachments?: boolean

        Query parameter to specify whether to include attachments bodies in a response.

      • OptionalattEncodingInfo?: boolean

        Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.

      • db: string

        Path parameter to specify the database name.

      • docs: CloudantV1.BulkGetQueryDocument[]

        List of document items to get in bulk.

      • Optionalheaders?: OutgoingHttpHeaders
      • Optionallatest?: boolean

        Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.

      • Optionalrevs?: boolean

        Query parameter to specify whether to include a list of all known document revisions.

    Returns Promise<Response<ReadableStream>>

  • 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.

    Parameters

    • params: PostChangesParams

      The parameters to send to the service.

      Parameters for the postChanges operation.

      • Optionalattachments?: boolean

        Query parameter to specify whether to include attachments bodies in a response.

      • OptionalattEncodingInfo?: boolean

        Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.

      • Optionalconflicts?: boolean

        Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when include_docs is true.

      • db: string

        Path parameter to specify the database name.

      • Optionaldescending?: boolean

        Query parameter to specify whether to return the documents in descending by key order.

      • OptionaldocIds?: string[]

        Schema for a list of document IDs.

      • Optionalfeed?: string

        Query parameter to specify the changes feed type.

      • Optionalfields?: string[]

        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.

      • Optionalfilter?: string

        Query parameter to specify a filter to emit only specific events from the changes stream.

        The built-in filter types are:

        • _design - Returns only changes to design documents.
        • _doc_ids - Returns changes for documents with an ID matching one specified 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.

      • Optionalheaders?: OutgoingHttpHeaders
      • Optionalheartbeat?: number

        Query parameter to specify the period in milliseconds after which an empty line is sent in the results. Off by default and only applicable for continuous 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:

        • Use the timeout parameter with a value that is compatible with your network environment.
        • Switch to scheduled usage of one of the non-continuous changes feed types (normal or longpoll).
        • Use TCP keepalive.
      • OptionalincludeDocs?: boolean

        Query parameter to specify whether to include the full content of the documents in the response.

      • OptionallastEventId?: string

        Header parameter to specify the ID of the last events received by the server on a previous connection. Overrides since query parameter.

      • Optionallimit?: number

        Query parameter to specify the number of returned documents to limit the result to.

      • Optionalselector?: JsonObject

        JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.

        The selector object must:

        • Be structured as valid JSON.
        • Contain a valid query expression.

        Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.

        Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.

        Operators are identified by the use of a dollar sign $ prefix in the name field.

        There are two core types of operators in the selector syntax:

        • Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
        • Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic $eq operator matches when the specified field contains a value that is equal to the supplied argument.

        It is important for query performance to use appropriate selectors:

        • Only equality operators such as $eq, $gt, $gte, $lt, and $lte (but not $ne) can be used as the basis of a query. You should include at least one of these in a selector.
        • Some operators such as $not, $or, $in, and $regex cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.

        See the Cloudant Docsfor a list of all available combination and conditional operators.

        For further reference see selector syntax.

      • OptionalseqInterval?: number

        Query parameter to specify that the update seq should only be calculated with every Nth result returned. When fetching changes in a batch, setting seq_interval=<batch size>, where <batch size> is the number of results requested per batch, load can be reduced on the source database as computing the seq value across many shards (especially in highly-sharded databases) is expensive.

      • Optionalsince?: string

        Query parameter to specify to start the results from the change immediately after the given update sequence. Can be a valid update sequence or now value. Default is 0 i.e. all changes.

      • Optionalstyle?: string

        Query parameter to specify how many revisions are returned in the changes array. The default, main_only, will only return the current "winning" revision; all_docs will return all leaf revisions (including conflicts and deleted former conflicts).

      • Optionaltimeout?: number

        Query parameter to specify the maximum period in milliseconds to wait for a change before the response is sent, even if there are no results. Only applicable for longpoll 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.

      • Optionalview?: string

        Query parameter to specify a view function as a filter. Documents pass the filter if the view's map function emits at least one record for them.

    Returns Promise<Response<CloudantV1.ChangesResult>>

  • 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.

    Parameters

    • params: PostChangesAsStreamParams

      The parameters to send to the service.

      Parameters for the postChangesAsStream operation.

      • Optionalattachments?: boolean

        Query parameter to specify whether to include attachments bodies in a response.

      • OptionalattEncodingInfo?: boolean

        Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.

      • Optionalconflicts?: boolean

        Query parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when include_docs is true.

      • db: string

        Path parameter to specify the database name.

      • Optionaldescending?: boolean

        Query parameter to specify whether to return the documents in descending by key order.

      • OptionaldocIds?: string[]

        Schema for a list of document IDs.

      • Optionalfeed?: string

        Query parameter to specify the changes feed type.

      • Optionalfields?: string[]

        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.

      • Optionalfilter?: string

        Query parameter to specify a filter to emit only specific events from the changes stream.

        The built-in filter types are:

        • _design - Returns only changes to design documents.
        • _doc_ids - Returns changes for documents with an ID matching one specified 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.

      • Optionalheaders?: OutgoingHttpHeaders
      • Optionalheartbeat?: number

        Query parameter to specify the period in milliseconds after which an empty line is sent in the results. Off by default and only applicable for continuous 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:

        • Use the timeout parameter with a value that is compatible with your network environment.
        • Switch to scheduled usage of one of the non-continuous changes feed types (normal or longpoll).
        • Use TCP keepalive.
      • OptionalincludeDocs?: boolean

        Query parameter to specify whether to include the full content of the documents in the response.

      • OptionallastEventId?: string

        Header parameter to specify the ID of the last events received by the server on a previous connection. Overrides since query parameter.

      • Optionallimit?: number

        Query parameter to specify the number of returned documents to limit the result to.

      • Optionalselector?: JsonObject

        JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.

        The selector object must:

        • Be structured as valid JSON.
        • Contain a valid query expression.

        Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.

        Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.

        Operators are identified by the use of a dollar sign $ prefix in the name field.

        There are two core types of operators in the selector syntax:

        • Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
        • Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic $eq operator matches when the specified field contains a value that is equal to the supplied argument.

        It is important for query performance to use appropriate selectors:

        • Only equality operators such as $eq, $gt, $gte, $lt, and $lte (but not $ne) can be used as the basis of a query. You should include at least one of these in a selector.
        • Some operators such as $not, $or, $in, and $regex cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.

        See the Cloudant Docsfor a list of all available combination and conditional operators.

        For further reference see selector syntax.

      • OptionalseqInterval?: number

        Query parameter to specify that the update seq should only be calculated with every Nth result returned. When fetching changes in a batch, setting seq_interval=<batch size>, where <batch size> is the number of results requested per batch, load can be reduced on the source database as computing the seq value across many shards (especially in highly-sharded databases) is expensive.

      • Optionalsince?: string

        Query parameter to specify to start the results from the change immediately after the given update sequence. Can be a valid update sequence or now value. Default is 0 i.e. all changes.

      • Optionalstyle?: string

        Query parameter to specify how many revisions are returned in the changes array. The default, main_only, will only return the current "winning" revision; all_docs will return all leaf revisions (including conflicts and deleted former conflicts).

      • Optionaltimeout?: number

        Query parameter to specify the maximum period in milliseconds to wait for a change before the response is sent, even if there are no results. Only applicable for longpoll 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.

      • Optionalview?: string

        Query parameter to specify a view function as a filter. Documents pass the filter if the view's map function emits at least one record for them.

    Returns Promise<Response<ReadableStream>>

  • 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.

    Parameters

    • params: PostDbsInfoParams

      The parameters to send to the service.

      Parameters for the postDbsInfo operation.

      • Optionalheaders?: OutgoingHttpHeaders
      • keys: string[]

        A list of database names.

    Returns Promise<Response<CloudantV1.DbsInfoResult[]>>

  • 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.

    Parameters

    • params: PostDesignDocsParams

      The parameters to send to the service.

      Parameters for the postDesignDocs operation.

      • Optionalattachments?: boolean

        Parameter to specify whether to include attachments bodies in a response.

      • OptionalattEncodingInfo?: boolean

        Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.

      • Optionalconflicts?: boolean

        Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when include_docs is true.

      • db: string

        Path parameter to specify the database name.

      • Optionaldescending?: boolean

        Parameter to specify whether to return the documents in descending by key order.

      • OptionalendKey?: string

        Schema for a document ID.

      • Optionalheaders?: OutgoingHttpHeaders
      • OptionalincludeDocs?: boolean

        Parameter to specify whether to include the full content of the documents in the response.

      • OptionalinclusiveEnd?: boolean

        Parameter to specify whether the specified end key should be included in the result.

      • Optionalkey?: string

        Schema for a document ID.

      • Optionalkeys?: string[]

        Schema for a list of document IDs.

      • Optionallimit?: number

        Parameter to specify the number of returned documents to limit the result to.

      • Optionalskip?: number

        Parameter to specify the number of records before starting to return the results.

      • OptionalstartKey?: string

        Schema for a document ID.

      • OptionalupdateSeq?: boolean

        Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.

    Returns Promise<Response<CloudantV1.AllDocsResult>>

  • 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.

    Parameters

    • params: PostDesignDocsQueriesParams

      The parameters to send to the service.

      Parameters for the postDesignDocsQueries operation.

      • Optionalaccept?: string

        The type of the response: application/json or application/octet-stream.

      • db: string

        Path parameter to specify the database name.

      • Optionalheaders?: OutgoingHttpHeaders
      • queries: CloudantV1.AllDocsQuery[]

        An array of query objects with fields for the parameters of each individual view query to be executed. The field names and their meaning are the same as the query parameters of a regular /_all_docs request.

    Returns Promise<Response<CloudantV1.AllDocsQueriesResult>>

  • 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.

    Parameters

    • params: PostDocumentParams

      The parameters to send to the service.

      Parameters for the postDocument operation.

      • Optionalbatch?: string

        Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.

      • OptionalcontentType?: string

        The type of the input.

      • db: string

        Path parameter to specify the database name.

      • document: Buffer | ReadableStream | CloudantV1.Document

        HTTP request body for Document operations.

      • Optionalheaders?: OutgoingHttpHeaders

    Returns Promise<Response<CloudantV1.DocumentResult>>

  • 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.

    Parameters

    • params: PostExplainParams

      The parameters to send to the service.

      Parameters for the postExplain operation.

      • OptionalallowFallback?: boolean

        Whether to allow fallback to other indexes. Default is true.

      • Optionalbookmark?: string

        Opaque bookmark token used when paginating results.

      • Optionalconflicts?: boolean

        A boolean value that indicates whether or not to include information about existing conflicts in the document.

      • db: string

        Path parameter to specify the database name.

      • OptionalexecutionStats?: boolean

        Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when include_docs=true is used), and total quorum document lookups (when each document replica is fetched).

      • Optionalfields?: string[]

        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.

      • Optionalheaders?: OutgoingHttpHeaders
      • Optionallimit?: number

        Maximum number of results returned. The type: text indexes are limited to 200 results when queried.

      • Optionalr?: number

        The read quorum that is needed for the result. The value defaults to 1, in which case the document that was found in the index is returned. If set to a higher value, each document is read from at least that many replicas before it is returned in the results. The request will take more time than using only the document that is stored locally with the index.

      • selector: JsonObject

        JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.

        The selector object must:

        • Be structured as valid JSON.
        • Contain a valid query expression.

        Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.

        Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.

        Operators are identified by the use of a dollar sign $ prefix in the name field.

        There are two core types of operators in the selector syntax:

        • Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
        • Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic $eq operator matches when the specified field contains a value that is equal to the supplied argument.

        It is important for query performance to use appropriate selectors:

        • Only equality operators such as $eq, $gt, $gte, $lt, and $lte (but not $ne) can be used as the basis of a query. You should include at least one of these in a selector.
        • Some operators such as $not, $or, $in, and $regex cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.

        See the Cloudant Docsfor a list of all available combination and conditional operators.

        For further reference see selector syntax.

      • Optionalskip?: number

        Skip the first 'n' results, where 'n' is the value that is specified.

      • Optionalsort?: JsonObject[]

        The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields.

        For example in JSON: [{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]

        When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields must use the same sort direction, either all ascending or all descending.

      • Optionalstable?: boolean

        Whether or not the view results should be returned from a "stable" set of shards.

      • Optionalupdate?: string

        Whether to update the index prior to returning the result.

      • OptionaluseIndex?: string[]

        Use this option to identify a specific index to answer the query, rather than letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id followed by index name, for example ["my_design_doc", "my_index"].

        It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later.

        If the specified index doesn't exist or can't answer the query then the server ignores the value and answers using another index or a full scan of all documents. To change this behavior set allow_fallback to false and the server responds instead with a 400 status code if the requested index is unsuitable to answer the query.

    Returns Promise<Response<CloudantV1.ExplainResult>>

  • Query an index by using selector syntax.

    Query documents by using a declarative JSON querying syntax. It's best practice to create an appropriate index for all fields in selector by using the _index endpoint.

    Queries without an appropriate backing index by default fallback to using the built-in _all_docs index. This isn't recommended because it has a significant performance impact causing a full scan of the database with each request. In this case the response body includes a warning field recommending the creation of an index.

    To avoid the fallback behavior set the allow_fallback option to false and the server responds with a 400 status code if no suitable index exists. If you want to use only a specific index for your query set allow_fallback to false and set the use_index option.

    Parameters

    • params: PostFindParams

      The parameters to send to the service.

      Parameters for the postFind operation.

      • OptionalallowFallback?: boolean

        Whether to allow fallback to other indexes. Default is true.

      • Optionalbookmark?: string

        Opaque bookmark token used when paginating results.

      • Optionalconflicts?: boolean

        A boolean value that indicates whether or not to include information about existing conflicts in the document.

      • db: string

        Path parameter to specify the database name.

      • OptionalexecutionStats?: boolean

        Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when include_docs=true is used), and total quorum document lookups (when each document replica is fetched).

      • Optionalfields?: string[]

        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.

      • Optionalheaders?: OutgoingHttpHeaders
      • Optionallimit?: number

        Maximum number of results returned. The type: text indexes are limited to 200 results when queried.

      • Optionalr?: number

        The read quorum that is needed for the result. The value defaults to 1, in which case the document that was found in the index is returned. If set to a higher value, each document is read from at least that many replicas before it is returned in the results. The request will take more time than using only the document that is stored locally with the index.

      • selector: JsonObject

        JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.

        The selector object must:

        • Be structured as valid JSON.
        • Contain a valid query expression.

        Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.

        Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.

        Operators are identified by the use of a dollar sign $ prefix in the name field.

        There are two core types of operators in the selector syntax:

        • Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
        • Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic $eq operator matches when the specified field contains a value that is equal to the supplied argument.

        It is important for query performance to use appropriate selectors:

        • Only equality operators such as $eq, $gt, $gte, $lt, and $lte (but not $ne) can be used as the basis of a query. You should include at least one of these in a selector.
        • Some operators such as $not, $or, $in, and $regex cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.

        See the Cloudant Docsfor a list of all available combination and conditional operators.

        For further reference see selector syntax.

      • Optionalskip?: number

        Skip the first 'n' results, where 'n' is the value that is specified.

      • Optionalsort?: JsonObject[]

        The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields.

        For example in JSON: [{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]

        When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields must use the same sort direction, either all ascending or all descending.

      • Optionalstable?: boolean

        Whether or not the view results should be returned from a "stable" set of shards.

      • Optionalupdate?: string

        Whether to update the index prior to returning the result.

      • OptionaluseIndex?: string[]

        Use this option to identify a specific index to answer the query, rather than letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id followed by index name, for example ["my_design_doc", "my_index"].

        It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later.

        If the specified index doesn't exist or can't answer the query then the server ignores the value and answers using another index or a full scan of all documents. To change this behavior set allow_fallback to false and the server responds instead with a 400 status code if the requested index is unsuitable to answer the query.

    Returns Promise<Response<CloudantV1.FindResult>>

  • 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 by default fallback to using the built-in _all_docs index. This isn't recommended because it has a significant performance impact causing a full scan of the database with each request. In this case the response body includes a warning field recommending the creation of an index.

    To avoid the fallback behavior set the allow_fallback option to false and the server responds with a 400 status code if no suitable index exists. If you want to use only a specific index for your query set allow_fallback to false and set the use_index option.

    Parameters

    • params: PostFindAsStreamParams

      The parameters to send to the service.

      Parameters for the postFindAsStream operation.

      • OptionalallowFallback?: boolean

        Whether to allow fallback to other indexes. Default is true.

      • Optionalbookmark?: string

        Opaque bookmark token used when paginating results.

      • Optionalconflicts?: boolean

        A boolean value that indicates whether or not to include information about existing conflicts in the document.

      • db: string

        Path parameter to specify the database name.

      • OptionalexecutionStats?: boolean

        Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when include_docs=true is used), and total quorum document lookups (when each document replica is fetched).

      • Optionalfields?: string[]

        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.

      • Optionalheaders?: OutgoingHttpHeaders
      • Optionallimit?: number

        Maximum number of results returned. The type: text indexes are limited to 200 results when queried.

      • Optionalr?: number

        The read quorum that is needed for the result. The value defaults to 1, in which case the document that was found in the index is returned. If set to a higher value, each document is read from at least that many replicas before it is returned in the results. The request will take more time than using only the document that is stored locally with the index.

      • selector: JsonObject

        JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.

        The selector object must:

        • Be structured as valid JSON.
        • Contain a valid query expression.

        Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.

        Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.

        Operators are identified by the use of a dollar sign $ prefix in the name field.

        There are two core types of operators in the selector syntax:

        • Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
        • Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic $eq operator matches when the specified field contains a value that is equal to the supplied argument.

        It is important for query performance to use appropriate selectors:

        • Only equality operators such as $eq, $gt, $gte, $lt, and $lte (but not $ne) can be used as the basis of a query. You should include at least one of these in a selector.
        • Some operators such as $not, $or, $in, and $regex cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.

        See the Cloudant Docsfor a list of all available combination and conditional operators.

        For further reference see selector syntax.

      • Optionalskip?: number

        Skip the first 'n' results, where 'n' is the value that is specified.

      • Optionalsort?: JsonObject[]

        The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields.

        For example in JSON: [{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]

        When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields must use the same sort direction, either all ascending or all descending.

      • Optionalstable?: boolean

        Whether or not the view results should be returned from a "stable" set of shards.

      • Optionalupdate?: string

        Whether to update the index prior to returning the result.

      • OptionaluseIndex?: string[]

        Use this option to identify a specific index to answer the query, rather than letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id followed by index name, for example ["my_design_doc", "my_index"].

        It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later.

        If the specified index doesn't exist or can't answer the query then the server ignores the value and answers using another index or a full scan of all documents. To change this behavior set allow_fallback to false and the server responds instead with a 400 status code if the requested index is unsuitable to answer the query.

    Returns Promise<Response<ReadableStream>>

  • Create a new index on a database.

    Create a new index on a database.

    Parameters

    • params: PostIndexParams

      The parameters to send to the service.

      Parameters for the postIndex operation.

      • db: string

        Path parameter to specify the database name.

      • Optionalddoc?: string

        Specifies the design document name in which the index will be created. The design document name is the design document ID excluding the _design/ prefix.

      • Optionalheaders?: OutgoingHttpHeaders
      • index: CloudantV1.IndexDefinition

        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.
      • Optionalname?: string

        name.

      • Optionalpartitioned?: boolean

        The 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.

      • Optionaltype?: string

        Schema for the type of an index.

    Returns Promise<Response<CloudantV1.IndexResult>>

  • 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.

    Parameters

    • params: PostPartitionAllDocsParams

      The parameters to send to the service.

      Parameters for the postPartitionAllDocs operation.

      • Optionalattachments?: boolean

        Parameter to specify whether to include attachments bodies in a response.

      • OptionalattEncodingInfo?: boolean

        Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.

      • Optionalconflicts?: boolean

        Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when include_docs is true.

      • db: string

        Path parameter to specify the database name.

      • Optionaldescending?: boolean

        Parameter to specify whether to return the documents in descending by key order.

      • OptionalendKey?: string

        Schema for a document ID.

      • Optionalheaders?: OutgoingHttpHeaders
      • OptionalincludeDocs?: boolean

        Parameter to specify whether to include the full content of the documents in the response.

      • OptionalinclusiveEnd?: boolean

        Parameter to specify whether the specified end key should be included in the result.

      • Optionalkey?: string

        Schema for a document ID.

      • Optionalkeys?: string[]

        Schema for a list of document IDs.

      • Optionallimit?: number

        Parameter to specify the number of returned documents to limit the result to.

      • partitionKey: string

        Path parameter to specify the database partition key.

      • Optionalskip?: number

        Parameter to specify the number of records before starting to return the results.

      • OptionalstartKey?: string

        Schema for a document ID.

      • OptionalupdateSeq?: boolean

        Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.

    Returns Promise<Response<CloudantV1.AllDocsResult>>

  • 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.

    Parameters

    • params: PostPartitionAllDocsAsStreamParams

      The parameters to send to the service.

      Parameters for the postPartitionAllDocsAsStream operation.

      • Optionalattachments?: boolean

        Parameter to specify whether to include attachments bodies in a response.

      • OptionalattEncodingInfo?: boolean

        Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.

      • Optionalconflicts?: boolean

        Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when include_docs is true.

      • db: string

        Path parameter to specify the database name.

      • Optionaldescending?: boolean

        Parameter to specify whether to return the documents in descending by key order.

      • OptionalendKey?: string

        Schema for a document ID.

      • Optionalheaders?: OutgoingHttpHeaders
      • OptionalincludeDocs?: boolean

        Parameter to specify whether to include the full content of the documents in the response.

      • OptionalinclusiveEnd?: boolean

        Parameter to specify whether the specified end key should be included in the result.

      • Optionalkey?: string

        Schema for a document ID.

      • Optionalkeys?: string[]

        Schema for a list of document IDs.

      • Optionallimit?: number

        Parameter to specify the number of returned documents to limit the result to.

      • partitionKey: string

        Path parameter to specify the database partition key.

      • Optionalskip?: number

        Parameter to specify the number of records before starting to return the results.

      • OptionalstartKey?: string

        Schema for a document ID.

      • OptionalupdateSeq?: boolean

        Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.

    Returns Promise<Response<ReadableStream>>

  • 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.

    Parameters

    • params: PostPartitionExplainParams

      The parameters to send to the service.

      Parameters for the postPartitionExplain operation.

      • OptionalallowFallback?: boolean

        Whether to allow fallback to other indexes. Default is true.

      • Optionalbookmark?: string

        Opaque bookmark token used when paginating results.

      • Optionalconflicts?: boolean

        A boolean value that indicates whether or not to include information about existing conflicts in the document.

      • db: string

        Path parameter to specify the database name.

      • OptionalexecutionStats?: boolean

        Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when include_docs=true is used), and total quorum document lookups (when each document replica is fetched).

      • Optionalfields?: string[]

        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.

      • Optionalheaders?: OutgoingHttpHeaders
      • Optionallimit?: number

        Maximum number of results returned. The type: text indexes are limited to 200 results when queried.

      • partitionKey: string

        Path parameter to specify the database partition key.

      • selector: JsonObject

        JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.

        The selector object must:

        • Be structured as valid JSON.
        • Contain a valid query expression.

        Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.

        Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.

        Operators are identified by the use of a dollar sign $ prefix in the name field.

        There are two core types of operators in the selector syntax:

        • Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
        • Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic $eq operator matches when the specified field contains a value that is equal to the supplied argument.

        It is important for query performance to use appropriate selectors:

        • Only equality operators such as $eq, $gt, $gte, $lt, and $lte (but not $ne) can be used as the basis of a query. You should include at least one of these in a selector.
        • Some operators such as $not, $or, $in, and $regex cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.

        See the Cloudant Docsfor a list of all available combination and conditional operators.

        For further reference see selector syntax.

      • Optionalskip?: number

        Skip the first 'n' results, where 'n' is the value that is specified.

      • Optionalsort?: JsonObject[]

        The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields.

        For example in JSON: [{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]

        When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields must use the same sort direction, either all ascending or all descending.

      • Optionalstable?: boolean

        Whether or not the view results should be returned from a "stable" set of shards.

      • Optionalupdate?: string

        Whether to update the index prior to returning the result.

      • OptionaluseIndex?: string[]

        Use this option to identify a specific index to answer the query, rather than letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id followed by index name, for example ["my_design_doc", "my_index"].

        It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later.

        If the specified index doesn't exist or can't answer the query then the server ignores the value and answers using another index or a full scan of all documents. To change this behavior set allow_fallback to false and the server responds instead with a 400 status code if the requested index is unsuitable to answer the query.

    Returns Promise<Response<CloudantV1.ExplainResult>>

  • Query a database partition index by using selector syntax.

    Query documents by using a declarative JSON querying syntax. It's best practice to create an appropriate index for all fields in selector by using the _index endpoint.

    Queries without an appropriate backing index by default fallback to using the built-in _all_docs index. This isn't recommended because it has a significant performance impact causing a full scan of the partition with each request. In this case the response body includes a warning field recommending the creation of an index.

    To avoid the fallback behavior set the allow_fallback option to false and the server responds with a 400 status code if no suitable index exists. If you want to use only a specific index for your query set allow_fallback to false and set the use_index option.

    Before using read the FAQs to understand the limitations and appropriate use cases.

    Parameters

    • params: PostPartitionFindParams

      The parameters to send to the service.

      Parameters for the postPartitionFind operation.

      • OptionalallowFallback?: boolean

        Whether to allow fallback to other indexes. Default is true.

      • Optionalbookmark?: string

        Opaque bookmark token used when paginating results.

      • Optionalconflicts?: boolean

        A boolean value that indicates whether or not to include information about existing conflicts in the document.

      • db: string

        Path parameter to specify the database name.

      • OptionalexecutionStats?: boolean

        Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when include_docs=true is used), and total quorum document lookups (when each document replica is fetched).

      • Optionalfields?: string[]

        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.

      • Optionalheaders?: OutgoingHttpHeaders
      • Optionallimit?: number

        Maximum number of results returned. The type: text indexes are limited to 200 results when queried.

      • partitionKey: string

        Path parameter to specify the database partition key.

      • selector: JsonObject

        JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.

        The selector object must:

        • Be structured as valid JSON.
        • Contain a valid query expression.

        Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.

        Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.

        Operators are identified by the use of a dollar sign $ prefix in the name field.

        There are two core types of operators in the selector syntax:

        • Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
        • Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic $eq operator matches when the specified field contains a value that is equal to the supplied argument.

        It is important for query performance to use appropriate selectors:

        • Only equality operators such as $eq, $gt, $gte, $lt, and $lte (but not $ne) can be used as the basis of a query. You should include at least one of these in a selector.
        • Some operators such as $not, $or, $in, and $regex cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.

        See the Cloudant Docsfor a list of all available combination and conditional operators.

        For further reference see selector syntax.

      • Optionalskip?: number

        Skip the first 'n' results, where 'n' is the value that is specified.

      • Optionalsort?: JsonObject[]

        The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields.

        For example in JSON: [{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]

        When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields must use the same sort direction, either all ascending or all descending.

      • Optionalstable?: boolean

        Whether or not the view results should be returned from a "stable" set of shards.

      • Optionalupdate?: string

        Whether to update the index prior to returning the result.

      • OptionaluseIndex?: string[]

        Use this option to identify a specific index to answer the query, rather than letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id followed by index name, for example ["my_design_doc", "my_index"].

        It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later.

        If the specified index doesn't exist or can't answer the query then the server ignores the value and answers using another index or a full scan of all documents. To change this behavior set allow_fallback to false and the server responds instead with a 400 status code if the requested index is unsuitable to answer the query.

    Returns Promise<Response<CloudantV1.FindResult>>

  • 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 by default fallback to using the built-in _all_docs index. This isn't recommended because it has a significant performance impact causing a full scan of the partition with each request. In this case the response body includes a warning field recommending the creation of an index.

    To avoid the fallback behavior set the allow_fallback option to false and the server responds with a 400 status code if no suitable index exists. If you want to use only a specific index for your query set allow_fallback to false and set the use_index option.

    Before using read the FAQs to understand the limitations and appropriate use cases.

    Parameters

    • params: PostPartitionFindAsStreamParams

      The parameters to send to the service.

      Parameters for the postPartitionFindAsStream operation.

      • OptionalallowFallback?: boolean

        Whether to allow fallback to other indexes. Default is true.

      • Optionalbookmark?: string

        Opaque bookmark token used when paginating results.

      • Optionalconflicts?: boolean

        A boolean value that indicates whether or not to include information about existing conflicts in the document.

      • db: string

        Path parameter to specify the database name.

      • OptionalexecutionStats?: boolean

        Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when include_docs=true is used), and total quorum document lookups (when each document replica is fetched).

      • Optionalfields?: string[]

        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.

      • Optionalheaders?: OutgoingHttpHeaders
      • Optionallimit?: number

        Maximum number of results returned. The type: text indexes are limited to 200 results when queried.

      • partitionKey: string

        Path parameter to specify the database partition key.

      • selector: JsonObject

        JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data.

        The selector object must:

        • Be structured as valid JSON.
        • Contain a valid query expression.

        Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only.

        Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators.

        Operators are identified by the use of a dollar sign $ prefix in the name field.

        There are two core types of operators in the selector syntax:

        • Combination operators: applied at the topmost level of selection. They are used to combine selectors. A combination operator takes a single argument. The argument is either another selector, or an array of selectors.
        • Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic $eq operator matches when the specified field contains a value that is equal to the supplied argument.

        It is important for query performance to use appropriate selectors:

        • Only equality operators such as $eq, $gt, $gte, $lt, and $lte (but not $ne) can be used as the basis of a query. You should include at least one of these in a selector.
        • Some operators such as $not, $or, $in, and $regex cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned.

        See the Cloudant Docsfor a list of all available combination and conditional operators.

        For further reference see selector syntax.

      • Optionalskip?: number

        Skip the first 'n' results, where 'n' is the value that is specified.

      • Optionalsort?: JsonObject[]

        The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields.

        For example in JSON: [{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]

        When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields must use the same sort direction, either all ascending or all descending.

      • Optionalstable?: boolean

        Whether or not the view results should be returned from a "stable" set of shards.

      • Optionalupdate?: string

        Whether to update the index prior to returning the result.

      • OptionaluseIndex?: string[]

        Use this option to identify a specific index to answer the query, rather than letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id followed by index name, for example ["my_design_doc", "my_index"].

        It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later.

        If the specified index doesn't exist or can't answer the query then the server ignores the value and answers using another index or a full scan of all documents. To change this behavior set allow_fallback to false and the server responds instead with a 400 status code if the requested index is unsuitable to answer the query.

    Returns Promise<Response<ReadableStream>>

  • Query a database partition search index.

    Partitioned Search indexes, which are defined in design documents, allow partition databases to be queried by using Lucene Query Parser Syntax. Search indexes are defined by an index function, similar to a map function in MapReduce views. The index function decides what data to index and store in the index.

    Before using read the FAQs to understand the limitations and appropriate use cases.

    Parameters

    • params: PostPartitionSearchParams

      The parameters to send to the service.

      Parameters for the postPartitionSearch operation.

      • Optionalbookmark?: string

        Opaque bookmark token used when paginating results.

      • db: string

        Path parameter to specify the database name.

      • ddoc: string

        Path parameter to specify the design document name. The design document name is the design document ID excluding the _design/ prefix.

      • Optionalheaders?: OutgoingHttpHeaders
      • OptionalhighlightFields?: string[]

        Specifies which fields to highlight. If specified, the result object contains a highlights field with an entry for each specified field.

      • OptionalhighlightNumber?: number

        Number of fragments that are returned in highlights. If the search term occurs less often than the number of fragments that are specified, longer fragments are returned.

      • OptionalhighlightPostTag?: string

        A string that is inserted after the highlighted word in the highlights output.

      • OptionalhighlightPreTag?: string

        A string that is inserted before the highlighted word in the highlights output.

      • OptionalhighlightSize?: number

        Number of characters in each fragment for highlights.

      • OptionalincludeDocs?: boolean

        Include the full content of the documents in the return.

      • OptionalincludeFields?: string[]

        A JSON array of field names to include in search results. Any fields that are included must be indexed with the store:true option. The default is all fields.

      • index: string

        Path parameter to specify the index name.

      • Optionallimit?: number

        Limit the number of the returned documents to the specified number.

      • partitionKey: string

        Path parameter to specify the database partition key.

      • query: string

        The Lucene query to execute.

      • Optionalsort?: string[]

        Specifies the sort order of the results. In a grouped search (when group_field is used), this parameter specifies the sort order within a group. The default sort order is relevance. A JSON string of the form "fieldname<type>" or "-fieldname<type>" for descending order, where fieldname is the name of a string or number field, and type is either a number, a string, or a JSON array of strings. The type part is optional, and defaults to number. Some examples are "foo", "-foo", "bar<string>", "-foo<number>" and ["-foo<number>", "bar<string>"]. String fields that are used for sorting must not be analyzed fields. Fields that are used for sorting must be indexed by the same indexer that is used for the search query.

      • Optionalstale?: string

        Do not wait for the index to finish building to return results.

    Returns Promise<Response<CloudantV1.SearchResult>>

  • 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.

    Before using read the FAQs to understand the limitations and appropriate use cases.

    Parameters

    • params: PostPartitionSearchAsStreamParams

      The parameters to send to the service.

      Parameters for the postPartitionSearchAsStream operation.

      • Optionalbookmark?: string

        Opaque bookmark token used when paginating results.

      • db: string

        Path parameter to specify the database name.

      • ddoc: string

        Path parameter to specify the design document name. The design document name is the design document ID excluding the _design/ prefix.

      • Optionalheaders?: OutgoingHttpHeaders
      • OptionalhighlightFields?: string[]

        Specifies which fields to highlight. If specified, the result object contains a highlights field with an entry for each specified field.

      • OptionalhighlightNumber?: number

        Number of fragments that are returned in highlights. If the search term occurs less often than the number of fragments that are specified, longer fragments are returned.

      • OptionalhighlightPostTag?: string

        A string that is inserted after the highlighted word in the highlights output.

      • OptionalhighlightPreTag?: string

        A string that is inserted before the highlighted word in the highlights output.

      • OptionalhighlightSize?: number

        Number of characters in each fragment for highlights.

      • OptionalincludeDocs?: boolean

        Include the full content of the documents in the return.

      • OptionalincludeFields?: string[]

        A JSON array of field names to include in search results. Any fields that are included must be indexed with the store:true option. The default is all fields.

      • index: string

        Path parameter to specify the index name.

      • Optionallimit?: number

        Limit the number of the returned documents to the specified number.

      • partitionKey: string

        Path parameter to specify the database partition key.

      • query: string

        The Lucene query to execute.

      • Optionalsort?: string[]

        Specifies the sort order of the results. In a grouped search (when group_field is used), this parameter specifies the sort order within a group. The default sort order is relevance. A JSON string of the form "fieldname<type>" or "-fieldname<type>" for descending order, where fieldname is the name of a string or number field, and type is either a number, a string, or a JSON array of strings. The type part is optional, and defaults to number. Some examples are "foo", "-foo", "bar<string>", "-foo<number>" and ["-foo<number>", "bar<string>"]. String fields that are used for sorting must not be analyzed fields. Fields that are used for sorting must be indexed by the same indexer that is used for the search query.

      • Optionalstale?: string

        Do not wait for the index to finish building to return results.

    Returns Promise<Response<ReadableStream>>

  • Query a database partition MapReduce view function.

    Runs the specified view function from the specified design document. Unlike GET /{db}/_design/{ddoc}/_view/{view} for accessing views, the POST method supports the specification of explicit keys to be retrieved from the view results. The remainder of the POST view functionality is identical to the GET /{db}/_design/{ddoc}/_view/{view} API.

    Before using read the FAQs to understand the limitations and appropriate use cases.

    Parameters

    • params: PostPartitionViewParams

      The parameters to send to the service.

      Parameters for the postPartitionView operation.

      • Optionalattachments?: boolean

        Parameter to specify whether to include attachments bodies in a response.

      • OptionalattEncodingInfo?: boolean

        Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.

      • Optionalconflicts?: boolean

        Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when include_docs is true.

      • db: string

        Path parameter to specify the database name.

      • ddoc: string

        Path parameter to specify the design document name. The design document name is the design document ID excluding the _design/ prefix.

      • Optionaldescending?: boolean

        Parameter to specify whether to return the documents in descending by key order.

      • OptionalendKey?: any

        Schema for any JSON type.

      • OptionalendKeyDocId?: string

        Schema for a document ID.

      • Optionalgroup?: boolean

        Parameter to specify whether to group reduced results by key. Valid only if a reduce function defined in the view. If the view emits key in JSON array format, then it is possible to reduce groups further based on the number of array elements with the group_level parameter.

      • OptionalgroupLevel?: number

        Parameter to specify a group level to be used. Only applicable if the view uses keys that are JSON arrays. Implies group is true. Group level groups the reduced results by the specified number of array elements. If unset, results are grouped by the entire array key, returning a reduced value for each complete key.

      • Optionalheaders?: OutgoingHttpHeaders
      • OptionalincludeDocs?: boolean

        Parameter to specify whether to include the full content of the documents in the response.

      • OptionalinclusiveEnd?: boolean

        Parameter to specify whether the specified end key should be included in the result.

      • Optionalkey?: any

        Schema for any JSON type.

      • Optionalkeys?: any[]

        Parameter to specify returning only documents that match any of the specified keys. A JSON array of keys that match the key type emitted by the view function.

      • Optionallimit?: number

        Parameter to specify the number of returned documents to limit the result to.

      • partitionKey: string

        Path parameter to specify the database partition key.

      • Optionalreduce?: boolean

        Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined.

        A default reduce view type can be disabled to behave like a map by setting reduce=false explicitly.

        Be aware that include_docs=true can only be used with map views.

      • Optionalskip?: number

        Parameter to specify the number of records before starting to return the results.

      • OptionalstartKey?: any

        Schema for any JSON type.

      • OptionalstartKeyDocId?: string

        Schema for a document ID.

      • Optionalupdate?: string

        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.
      • OptionalupdateSeq?: boolean

        Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.

      • view: string

        Path parameter to specify the map reduce view function name.

    Returns Promise<Response<CloudantV1.ViewResult>>

  • 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.

    Before using read the FAQs to understand the limitations and appropriate use cases.

    Parameters

    • params: PostPartitionViewAsStreamParams

      The parameters to send to the service.

      Parameters for the postPartitionViewAsStream operation.

      • Optionalattachments?: boolean

        Parameter to specify whether to include attachments bodies in a response.

      • OptionalattEncodingInfo?: boolean

        Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.

      • Optionalconflicts?: boolean

        Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when include_docs is true.

      • db: string

        Path parameter to specify the database name.

      • ddoc: string

        Path parameter to specify the design document name. The design document name is the design document ID excluding the _design/ prefix.

      • Optionaldescending?: boolean

        Parameter to specify whether to return the documents in descending by key order.

      • OptionalendKey?: any

        Schema for any JSON type.

      • OptionalendKeyDocId?: string

        Schema for a document ID.

      • Optionalgroup?: boolean

        Parameter to specify whether to group reduced results by key. Valid only if a reduce function defined in the view. If the view emits key in JSON array format, then it is possible to reduce groups further based on the number of array elements with the group_level parameter.

      • OptionalgroupLevel?: number

        Parameter to specify a group level to be used. Only applicable if the view uses keys that are JSON arrays. Implies group is true. Group level groups the reduced results by the specified number of array elements. If unset, results are grouped by the entire array key, returning a reduced value for each complete key.

      • Optionalheaders?: OutgoingHttpHeaders
      • OptionalincludeDocs?: boolean

        Parameter to specify whether to include the full content of the documents in the response.

      • OptionalinclusiveEnd?: boolean

        Parameter to specify whether the specified end key should be included in the result.

      • Optionalkey?: any

        Schema for any JSON type.

      • Optionalkeys?: any[]

        Parameter to specify returning only documents that match any of the specified keys. A JSON array of keys that match the key type emitted by the view function.

      • Optionallimit?: number

        Parameter to specify the number of returned documents to limit the result to.

      • partitionKey: string

        Path parameter to specify the database partition key.

      • Optionalreduce?: boolean

        Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined.

        A default reduce view type can be disabled to behave like a map by setting reduce=false explicitly.

        Be aware that include_docs=true can only be used with map views.

      • Optionalskip?: number

        Parameter to specify the number of records before starting to return the results.

      • OptionalstartKey?: any

        Schema for any JSON type.

      • OptionalstartKeyDocId?: string

        Schema for a document ID.

      • Optionalupdate?: string

        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.
      • OptionalupdateSeq?: boolean

        Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.

      • view: string

        Path parameter to specify the map reduce view function name.

    Returns Promise<Response<ReadableStream>>

  • Create a persistent replication with a generated ID.

    Creates or modifies a document in the _replicator database to start a new replication or to edit an existing replication.

    Parameters

    • params: PostReplicatorParams

      The parameters to send to the service.

      Parameters for the postReplicator operation.

      • Optionalbatch?: string

        Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.

      • Optionalheaders?: OutgoingHttpHeaders
      • replicationDocument: CloudantV1.ReplicationDocument

        HTTP request body for replication operations.

    Returns Promise<Response<CloudantV1.DocumentResult>>

  • 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.

    Parameters

    • params: PostRevsDiffParams

      The parameters to send to the service.

      Parameters for the postRevsDiff operation.

      • db: string

        Path parameter to specify the database name.

      • documentRevisions: JsonObject

        HTTP request body for operations with Document revisions.

      • Optionalheaders?: OutgoingHttpHeaders

    Returns Promise<Response<JsonObject>>

  • 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.

    Parameters

    • params: PostSearchParams

      The parameters to send to the service.

      Parameters for the postSearch operation.

      • Optionalbookmark?: string

        Opaque bookmark token used when paginating results.

      • Optionalcounts?: string[]

        This field defines an array of names of string fields, for which counts are requested. The response contains counts for each unique value of this field name among the documents that match the search query. Faceting must be enabled for this parameter to function. This option is only available when making global queries.

      • db: string

        Path parameter to specify the database name.

      • ddoc: string

        Path parameter to specify the design document name. The design document name is the design document ID excluding the _design/ prefix.

      • Optionaldrilldown?: string[][]

        Restrict results to documents with a dimension equal to the specified label(s). The search matches only documents containing the value that was provided in the named field. It differs from using "fieldname:value" in the q parameter only in that the values are not analyzed. Faceting must be enabled for this parameter to function.

      • OptionalgroupField?: string

        Field by which to group search matches. A string that contains the name of a string field. Fields containing other data such as numbers, objects, or arrays cannot be used. This option is only available when making global queries.

      • OptionalgroupLimit?: number

        Maximum group count. This field can be used only if group_field is specified. This option is only available when making global queries.

      • OptionalgroupSort?: string[]

        This field defines the order of the groups in a search that uses group_field. The default sort order is relevance. This field can have the same values as the sort field, so single fields and arrays of fields are supported. This option is only available when making global queries.

      • Optionalheaders?: OutgoingHttpHeaders
      • OptionalhighlightFields?: string[]

        Specifies which fields to highlight. If specified, the result object contains a highlights field with an entry for each specified field.

      • OptionalhighlightNumber?: number

        Number of fragments that are returned in highlights. If the search term occurs less often than the number of fragments that are specified, longer fragments are returned.

      • OptionalhighlightPostTag?: string

        A string that is inserted after the highlighted word in the highlights output.

      • OptionalhighlightPreTag?: string

        A string that is inserted before the highlighted word in the highlights output.

      • OptionalhighlightSize?: number

        Number of characters in each fragment for highlights.

      • OptionalincludeDocs?: boolean

        Include the full content of the documents in the return.

      • OptionalincludeFields?: string[]

        A JSON array of field names to include in search results. Any fields that are included must be indexed with the store:true option. The default is all fields.

      • index: string

        Path parameter to specify the index name.

      • Optionallimit?: number

        Limit the number of the returned documents to the specified number.

      • query: string

        The Lucene query to execute.

      • Optionalranges?: JsonObject

        Object mapping faceted, numeric search field names to the required ranges. Each key is a field name and each value is another object defining the ranges by mapping range name keys to string values describing the numeric ranges, for example "[0 TO 10]". This option is only available when making global queries.

      • Optionalsort?: string[]

        Specifies the sort order of the results. In a grouped search (when group_field is used), this parameter specifies the sort order within a group. The default sort order is relevance. A JSON string of the form "fieldname<type>" or "-fieldname<type>" for descending order, where fieldname is the name of a string or number field, and type is either a number, a string, or a JSON array of strings. The type part is optional, and defaults to number. Some examples are "foo", "-foo", "bar<string>", "-foo<number>" and ["-foo<number>", "bar<string>"]. String fields that are used for sorting must not be analyzed fields. Fields that are used for sorting must be indexed by the same indexer that is used for the search query.

      • Optionalstale?: string

        Do not wait for the index to finish building to return results.

    Returns Promise<Response<CloudantV1.SearchResult>>

  • 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.

    Parameters

    • params: PostSearchAsStreamParams

      The parameters to send to the service.

      Parameters for the postSearchAsStream operation.

      • Optionalbookmark?: string

        Opaque bookmark token used when paginating results.

      • Optionalcounts?: string[]

        This field defines an array of names of string fields, for which counts are requested. The response contains counts for each unique value of this field name among the documents that match the search query. Faceting must be enabled for this parameter to function. This option is only available when making global queries.

      • db: string

        Path parameter to specify the database name.

      • ddoc: string

        Path parameter to specify the design document name. The design document name is the design document ID excluding the _design/ prefix.

      • Optionaldrilldown?: string[][]

        Restrict results to documents with a dimension equal to the specified label(s). The search matches only documents containing the value that was provided in the named field. It differs from using "fieldname:value" in the q parameter only in that the values are not analyzed. Faceting must be enabled for this parameter to function.

      • OptionalgroupField?: string

        Field by which to group search matches. A string that contains the name of a string field. Fields containing other data such as numbers, objects, or arrays cannot be used. This option is only available when making global queries.

      • OptionalgroupLimit?: number

        Maximum group count. This field can be used only if group_field is specified. This option is only available when making global queries.

      • OptionalgroupSort?: string[]

        This field defines the order of the groups in a search that uses group_field. The default sort order is relevance. This field can have the same values as the sort field, so single fields and arrays of fields are supported. This option is only available when making global queries.

      • Optionalheaders?: OutgoingHttpHeaders
      • OptionalhighlightFields?: string[]

        Specifies which fields to highlight. If specified, the result object contains a highlights field with an entry for each specified field.

      • OptionalhighlightNumber?: number

        Number of fragments that are returned in highlights. If the search term occurs less often than the number of fragments that are specified, longer fragments are returned.

      • OptionalhighlightPostTag?: string

        A string that is inserted after the highlighted word in the highlights output.

      • OptionalhighlightPreTag?: string

        A string that is inserted before the highlighted word in the highlights output.

      • OptionalhighlightSize?: number

        Number of characters in each fragment for highlights.

      • OptionalincludeDocs?: boolean

        Include the full content of the documents in the return.

      • OptionalincludeFields?: string[]

        A JSON array of field names to include in search results. Any fields that are included must be indexed with the store:true option. The default is all fields.

      • index: string

        Path parameter to specify the index name.

      • Optionallimit?: number

        Limit the number of the returned documents to the specified number.

      • query: string

        The Lucene query to execute.

      • Optionalranges?: JsonObject

        Object mapping faceted, numeric search field names to the required ranges. Each key is a field name and each value is another object defining the ranges by mapping range name keys to string values describing the numeric ranges, for example "[0 TO 10]". This option is only available when making global queries.

      • Optionalsort?: string[]

        Specifies the sort order of the results. In a grouped search (when group_field is used), this parameter specifies the sort order within a group. The default sort order is relevance. A JSON string of the form "fieldname<type>" or "-fieldname<type>" for descending order, where fieldname is the name of a string or number field, and type is either a number, a string, or a JSON array of strings. The type part is optional, and defaults to number. Some examples are "foo", "-foo", "bar<string>", "-foo<number>" and ["-foo<number>", "bar<string>"]. String fields that are used for sorting must not be analyzed fields. Fields that are used for sorting must be indexed by the same indexer that is used for the search query.

      • Optionalstale?: string

        Do not wait for the index to finish building to return results.

    Returns Promise<Response<ReadableStream>>

  • 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.

    Parameters

    • params: PostViewParams

      The parameters to send to the service.

      Parameters for the postView operation.

      • Optionalattachments?: boolean

        Parameter to specify whether to include attachments bodies in a response.

      • OptionalattEncodingInfo?: boolean

        Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.

      • Optionalconflicts?: boolean

        Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when include_docs is true.

      • db: string

        Path parameter to specify the database name.

      • ddoc: string

        Path parameter to specify the design document name. The design document name is the design document ID excluding the _design/ prefix.

      • Optionaldescending?: boolean

        Parameter to specify whether to return the documents in descending by key order.

      • OptionalendKey?: any

        Schema for any JSON type.

      • OptionalendKeyDocId?: string

        Schema for a document ID.

      • Optionalgroup?: boolean

        Parameter to specify whether to group reduced results by key. Valid only if a reduce function defined in the view. If the view emits key in JSON array format, then it is possible to reduce groups further based on the number of array elements with the group_level parameter.

      • OptionalgroupLevel?: number

        Parameter to specify a group level to be used. Only applicable if the view uses keys that are JSON arrays. Implies group is true. Group level groups the reduced results by the specified number of array elements. If unset, results are grouped by the entire array key, returning a reduced value for each complete key.

      • Optionalheaders?: OutgoingHttpHeaders
      • OptionalincludeDocs?: boolean

        Parameter to specify whether to include the full content of the documents in the response.

      • OptionalinclusiveEnd?: boolean

        Parameter to specify whether the specified end key should be included in the result.

      • Optionalkey?: any

        Schema for any JSON type.

      • Optionalkeys?: any[]

        Parameter to specify returning only documents that match any of the specified keys. A JSON array of keys that match the key type emitted by the view function.

      • Optionallimit?: number

        Parameter to specify the number of returned documents to limit the result to.

      • Optionalreduce?: boolean

        Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined.

        A default reduce view type can be disabled to behave like a map by setting reduce=false explicitly.

        Be aware that include_docs=true can only be used with map views.

      • Optionalskip?: number

        Parameter to specify the number of records before starting to return the results.

      • Optionalstable?: boolean

        Query parameter to specify whether use the same replica of the index on each request. The default value false contacts all replicas and returns the result from the first, fastest, responder. Setting it 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.

      • OptionalstartKey?: any

        Schema for any JSON type.

      • OptionalstartKeyDocId?: string

        Schema for a document ID.

      • Optionalupdate?: string

        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.
      • OptionalupdateSeq?: boolean

        Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.

      • view: string

        Path parameter to specify the map reduce view function name.

    Returns Promise<Response<CloudantV1.ViewResult>>

  • 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.

    Parameters

    • params: PostViewAsStreamParams

      The parameters to send to the service.

      Parameters for the postViewAsStream operation.

      • Optionalattachments?: boolean

        Parameter to specify whether to include attachments bodies in a response.

      • OptionalattEncodingInfo?: boolean

        Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.

      • Optionalconflicts?: boolean

        Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when include_docs is true.

      • db: string

        Path parameter to specify the database name.

      • ddoc: string

        Path parameter to specify the design document name. The design document name is the design document ID excluding the _design/ prefix.

      • Optionaldescending?: boolean

        Parameter to specify whether to return the documents in descending by key order.

      • OptionalendKey?: any

        Schema for any JSON type.

      • OptionalendKeyDocId?: string

        Schema for a document ID.

      • Optionalgroup?: boolean

        Parameter to specify whether to group reduced results by key. Valid only if a reduce function defined in the view. If the view emits key in JSON array format, then it is possible to reduce groups further based on the number of array elements with the group_level parameter.

      • OptionalgroupLevel?: number

        Parameter to specify a group level to be used. Only applicable if the view uses keys that are JSON arrays. Implies group is true. Group level groups the reduced results by the specified number of array elements. If unset, results are grouped by the entire array key, returning a reduced value for each complete key.

      • Optionalheaders?: OutgoingHttpHeaders
      • OptionalincludeDocs?: boolean

        Parameter to specify whether to include the full content of the documents in the response.

      • OptionalinclusiveEnd?: boolean

        Parameter to specify whether the specified end key should be included in the result.

      • Optionalkey?: any

        Schema for any JSON type.

      • Optionalkeys?: any[]

        Parameter to specify returning only documents that match any of the specified keys. A JSON array of keys that match the key type emitted by the view function.

      • Optionallimit?: number

        Parameter to specify the number of returned documents to limit the result to.

      • Optionalreduce?: boolean

        Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined.

        A default reduce view type can be disabled to behave like a map by setting reduce=false explicitly.

        Be aware that include_docs=true can only be used with map views.

      • Optionalskip?: number

        Parameter to specify the number of records before starting to return the results.

      • Optionalstable?: boolean

        Query parameter to specify whether use the same replica of the index on each request. The default value false contacts all replicas and returns the result from the first, fastest, responder. Setting it 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.

      • OptionalstartKey?: any

        Schema for any JSON type.

      • OptionalstartKeyDocId?: string

        Schema for a document ID.

      • Optionalupdate?: string

        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.
      • OptionalupdateSeq?: boolean

        Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.

      • view: string

        Path parameter to specify the map reduce view function name.

    Returns Promise<Response<ReadableStream>>

  • Multi-query a MapReduce view.

    This operation runs multiple specified view queries against the view function from the specified design document.

    Parameters

    • params: PostViewQueriesParams

      The parameters to send to the service.

      Parameters for the postViewQueries operation.

      • db: string

        Path parameter to specify the database name.

      • ddoc: string

        Path parameter to specify the design document name. The design document name is the design document ID excluding the _design/ prefix.

      • Optionalheaders?: OutgoingHttpHeaders
      • queries: CloudantV1.ViewQuery[]

        An array of query objects with fields for the parameters of each individual view query to be executed. The field names and their meaning are the same as the query parameters of a regular view request.

      • view: string

        Path parameter to specify the map reduce view function name.

    Returns Promise<Response<CloudantV1.ViewQueriesResult>>

  • Multi-query a MapReduce view as stream.

    This operation runs multiple specified view queries against the view function from the specified design document.

    Parameters

    • params: PostViewQueriesAsStreamParams

      The parameters to send to the service.

      Parameters for the postViewQueriesAsStream operation.

      • db: string

        Path parameter to specify the database name.

      • ddoc: string

        Path parameter to specify the design document name. The design document name is the design document ID excluding the _design/ prefix.

      • Optionalheaders?: OutgoingHttpHeaders
      • queries: CloudantV1.ViewQuery[]

        An array of query objects with fields for the parameters of each individual view query to be executed. The field names and their meaning are the same as the query parameters of a regular view request.

      • view: string

        Path parameter to specify the map reduce view function name.

    Returns Promise<Response<ReadableStream>>

  • 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.

    Parameters

    • params: PutAttachmentParams

      The parameters to send to the service.

      Parameters for the putAttachment operation.

      • attachment: Buffer | ReadableStream

        HTTP request body for attachment operations.

      • attachmentName: string

        Path parameter to specify the attachment name.

      • contentType: string

        Content-Type of the attachment.

      • db: string

        Path parameter to specify the database name.

      • docId: string

        Path parameter to specify the document ID.

      • Optionalheaders?: OutgoingHttpHeaders
      • OptionalifMatch?: string

        Header parameter for a conditional HTTP request matching an ETag.

      • Optionalrev?: string

        Query parameter to specify a document revision.

    Returns Promise<Response<CloudantV1.DocumentResult>>

  • 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.

    Parameters

    • params: PutCloudantSecurityConfigurationParams

      The parameters to send to the service.

      Parameters for the putCloudantSecurityConfiguration operation.

      • Optionaladmins?: CloudantV1.SecurityObject

        Schema for names and roles to map to a database permission.

      • cloudant: JsonObject

        Database permissions for Cloudant users and/or API keys.

      • OptionalcouchdbAuthOnly?: boolean

        Manage permissions using the _users database only.

      • db: string

        Path parameter to specify the database name.

      • Optionalheaders?: OutgoingHttpHeaders
      • Optionalmembers?: CloudantV1.SecurityObject

        Schema for names and roles to map to a database permission.

    Returns Promise<Response<CloudantV1.Ok>>

  • Modify CORS configuration.

    Sets the CORS configuration. The configuration applies to all databases and all account level endpoints in your account.

    Parameters

    • params: PutCorsConfigurationParams

      The parameters to send to the service.

      Parameters for the putCorsConfiguration operation.

      • OptionalallowCredentials?: boolean

        Boolean value to allow authentication credentials. If set to true, browser requests must be done by using withCredentials = true.

      • OptionalenableCors?: boolean

        Boolean value to turn CORS on and off.

      • Optionalheaders?: OutgoingHttpHeaders
      • origins: string[]

        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.

    Returns Promise<Response<CloudantV1.Ok>>

  • Create a database.

    Create a new database with the requested properties.

    Parameters

    • params: PutDatabaseParams

      The parameters to send to the service.

      Parameters for the putDatabase operation.

      • db: string

        Path parameter to specify the database name.

      • Optionalheaders?: OutgoingHttpHeaders
      • Optionalpartitioned?: boolean

        Query parameter to specify whether to enable database partitions when creating a database.

        Before using read the FAQs to understand the limitations and appropriate use cases.

      • Optionalq?: number

        The number of shards in the database. Each shard is a partition of the hash value range. Cloudant recommends using the default value for most databases. However, if your database is expected to be larger than 250 GB or have a lot of indexes, you may need to adjust the settings. In these cases, it's best to reach out to IBM Cloudant customer support for guidance on how to meet your specific needs and requirements.

    Returns Promise<Response<CloudantV1.Ok>>

  • 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.

    Parameters

    • params: PutDesignDocumentParams

      The parameters to send to the service.

      Parameters for the putDesignDocument operation.

      • Optionalbatch?: string

        Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.

      • db: string

        Path parameter to specify the database name.

      • ddoc: string

        Path parameter to specify the design document name. The design document name is the design document ID excluding the _design/ prefix.

      • designDocument: CloudantV1.DesignDocument

        HTTP request body for DesignDocument operations.

      • Optionalheaders?: OutgoingHttpHeaders
      • OptionalifMatch?: string

        Header parameter for a conditional HTTP request matching an ETag.

      • OptionalnewEdits?: boolean

        Query parameter to specify whether to prevent insertion of conflicting document revisions. If false, a well-formed _rev must be included in the document. False is used by the replicator to insert documents into the target database even if that leads to the creation of conflicts.

        Avoid using this parameter, since this option applies document revisions without checking for conflicts, so it is very easy to accidentally end up with a large number of conflicts.

      • Optionalrev?: string

        Query parameter to specify a document revision.

    Returns Promise<Response<CloudantV1.DocumentResult>>

  • 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.

    Parameters

    • params: PutDocumentParams

      The parameters to send to the service.

      Parameters for the putDocument operation.

      • Optionalbatch?: string

        Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.

      • OptionalcontentType?: string

        The type of the input.

      • db: string

        Path parameter to specify the database name.

      • docId: string

        Path parameter to specify the document ID.

      • document: Buffer | ReadableStream | CloudantV1.Document

        HTTP request body for Document operations.

      • Optionalheaders?: OutgoingHttpHeaders
      • OptionalifMatch?: string

        Header parameter for a conditional HTTP request matching an ETag.

      • OptionalnewEdits?: boolean

        Query parameter to specify whether to prevent insertion of conflicting document revisions. If false, a well-formed _rev must be included in the document. False is used by the replicator to insert documents into the target database even if that leads to the creation of conflicts.

        Avoid using this parameter, since this option applies document revisions without checking for conflicts, so it is very easy to accidentally end up with a large number of conflicts.

      • Optionalrev?: string

        Query parameter to specify a document revision.

    Returns Promise<Response<CloudantV1.DocumentResult>>

  • 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.

    Parameters

    • params: PutLocalDocumentParams

      The parameters to send to the service.

      Parameters for the putLocalDocument operation.

      • Optionalbatch?: string

        Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.

      • OptionalcontentType?: string

        The type of the input.

      • db: string

        Path parameter to specify the database name.

      • docId: string

        Path parameter to specify the document ID.

      • document: Buffer | ReadableStream | CloudantV1.Document

        HTTP request body for Document operations.

      • Optionalheaders?: OutgoingHttpHeaders

    Returns Promise<Response<CloudantV1.DocumentResult>>

  • Create or modify a persistent replication.

    Creates or modifies a document in the _replicator database to start a new replication or to edit an existing replication.

    Parameters

    • params: PutReplicationDocumentParams

      The parameters to send to the service.

      Parameters for the putReplicationDocument operation.

      • Optionalbatch?: string

        Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.

      • docId: string

        Path parameter to specify the ID of the stored replication configuration in the _replicator database.

      • Optionalheaders?: OutgoingHttpHeaders
      • OptionalifMatch?: string

        Header parameter for a conditional HTTP request matching an ETag.

      • OptionalnewEdits?: boolean

        Query parameter to specify whether to prevent insertion of conflicting document revisions. If false, a well-formed _rev must be included in the document. False is used by the replicator to insert documents into the target database even if that leads to the creation of conflicts.

        Avoid using this parameter, since this option applies document revisions without checking for conflicts, so it is very easy to accidentally end up with a large number of conflicts.

      • replicationDocument: CloudantV1.ReplicationDocument

        HTTP request body for replication operations.

      • Optionalrev?: string

        Query parameter to specify a document revision.

    Returns Promise<Response<CloudantV1.DocumentResult>>

  • 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.

    Parameters

    • params: PutSecurityParams

      The parameters to send to the service.

      Parameters for the putSecurity operation.

      • Optionaladmins?: CloudantV1.SecurityObject

        Schema for names and roles to map to a database permission.

      • Optionalcloudant?: JsonObject

        Database permissions for Cloudant users and/or API keys.

      • OptionalcouchdbAuthOnly?: boolean

        Manage permissions using the _users database only.

      • db: string

        Path parameter to specify the database name.

      • Optionalheaders?: OutgoingHttpHeaders
      • Optionalmembers?: CloudantV1.SecurityObject

        Schema for names and roles to map to a database permission.

    Returns Promise<Response<CloudantV1.Ok>>

  • Turn request body compression on or off. Cloudant specific extensions:

    • Apply the gzip compression option on CouchdbSessionAuthenticator.

    Parameters

    • setting: boolean

      Will turn it on if 'true', off if 'false'.

    Returns void

  • Set the service URL to send requests to and use the new service URL for CouchDB Session Authentication to claim session token from.

    Parameters

    • url: string

      The base URL for the service.

    Returns void

  • Constructs an instance of CloudantV1 with passed in options and external configuration.

    Parameters

    • Optionaloptions: UserOptions

      The parameters to send to the service.

      • serviceName

        The name of the service to configure

      • authenticator

        The Authenticator object used to authenticate requests to the service

      • serviceUrl

        The base URL for the service

    Returns CloudantV1