- Navigation GuideYou are on a Client landing page. Commands (operations) are listed on this page. The Client constructor type is linked at the bottom.
DocDBClient
Amazon DocumentDB is a fast, reliable, and fully managed database service. Amazon DocumentDB makes it easy to set up, operate, and scale MongoDB-compatible databases in the cloud. With Amazon DocumentDB, you can run the same application code and use the same drivers and tools that you use with MongoDB.
Installation
npm install @aws-sdk/client-docdb
yarn add @aws-sdk/client-docdb
pnpm add @aws-sdk/client-docdb
DocDBClient Operations
Command | Summary |
---|
Command | Summary |
---|---|
AddSourceIdentifierToSubscriptionCommand | Adds a source identifier to an existing event notification subscription. |
AddTagsToResourceCommand | Adds metadata tags to an Amazon DocumentDB resource. You can use these tags with cost allocation reporting to track costs that are associated with Amazon DocumentDB resources or in a |
ApplyPendingMaintenanceActionCommand | Applies a pending maintenance action to a resource (for example, to an Amazon DocumentDB instance). |
CopyDBClusterParameterGroupCommand | Copies the specified cluster parameter group. |
CopyDBClusterSnapshotCommand | Copies a snapshot of a cluster. To copy a cluster snapshot from a shared manual cluster snapshot, To cancel the copy operation after it is in progress, delete the target cluster snapshot identified by |
CreateDBClusterCommand | Creates a new Amazon DocumentDB cluster. |
CreateDBClusterParameterGroupCommand | Creates a new cluster parameter group. Parameters in a cluster parameter group apply to all of the instances in a cluster. A cluster parameter group is initially created with the default parameters for the database engine used by instances in the cluster. In Amazon DocumentDB, you cannot make modifications directly to the |
CreateDBClusterSnapshotCommand | Creates a snapshot of a cluster. |
CreateDBInstanceCommand | Creates a new instance. |
CreateDBSubnetGroupCommand | Creates a new subnet group. subnet groups must contain at least one subnet in at least two Availability Zones in the Amazon Web Services Region. |
CreateEventSubscriptionCommand | Creates an Amazon DocumentDB event notification subscription. This action requires a topic Amazon Resource Name (ARN) created by using the Amazon DocumentDB console, the Amazon SNS console, or the Amazon SNS API. To obtain an ARN with Amazon SNS, you must create a topic in Amazon SNS and subscribe to the topic. The ARN is displayed in the Amazon SNS console. You can specify the type of source ( If you specify both the |
CreateGlobalClusterCommand | Creates an Amazon DocumentDB global cluster that can span multiple multiple Amazon Web Services Regions. The global cluster contains one primary cluster with read-write capability, and up-to give read-only secondary clusters. Global clusters uses storage-based fast replication across regions with latencies less than one second, using dedicated infrastructure with no impact to your workload’s performance. You can create a global cluster that is initially empty, and then add a primary and a secondary to it. Or you can specify an existing cluster during the create operation, and this cluster becomes the primary of the global cluster. This action only applies to Amazon DocumentDB clusters. |
DeleteDBClusterCommand | Deletes a previously provisioned cluster. When you delete a cluster, all automated backups for that cluster are deleted and can't be recovered. Manual DB cluster snapshots of the specified cluster are not deleted. |
DeleteDBClusterParameterGroupCommand | Deletes a specified cluster parameter group. The cluster parameter group to be deleted can't be associated with any clusters. |
DeleteDBClusterSnapshotCommand | Deletes a cluster snapshot. If the snapshot is being copied, the copy operation is terminated. The cluster snapshot must be in the |
DeleteDBInstanceCommand | Deletes a previously provisioned instance. |
DeleteDBSubnetGroupCommand | Deletes a subnet group. The specified database subnet group must not be associated with any DB instances. |
DeleteEventSubscriptionCommand | Deletes an Amazon DocumentDB event notification subscription. |
DeleteGlobalClusterCommand | Deletes a global cluster. The primary and secondary clusters must already be detached or deleted before attempting to delete a global cluster. This action only applies to Amazon DocumentDB clusters. |
DescribeCertificatesCommand | Returns a list of certificate authority (CA) certificates provided by Amazon DocumentDB for this Amazon Web Services account. |
DescribeDBClusterParameterGroupsCommand | Returns a list of |
DescribeDBClusterParametersCommand | Returns the detailed parameter list for a particular cluster parameter group. |
DescribeDBClusterSnapshotAttributesCommand | Returns a list of cluster snapshot attribute names and values for a manual DB cluster snapshot. When you share snapshots with other Amazon Web Services accounts, |
DescribeDBClusterSnapshotsCommand | Returns information about cluster snapshots. This API operation supports pagination. |
DescribeDBClustersCommand | Returns information about provisioned Amazon DocumentDB clusters. This API operation supports pagination. For certain management features such as cluster and instance lifecycle management, Amazon DocumentDB leverages operational technology that is shared with Amazon RDS and Amazon Neptune. Use the |
DescribeDBEngineVersionsCommand | Returns a list of the available engines. |
DescribeDBInstancesCommand | Returns information about provisioned Amazon DocumentDB instances. This API supports pagination. |
DescribeDBSubnetGroupsCommand | Returns a list of |
DescribeEngineDefaultClusterParametersCommand | Returns the default engine and system parameter information for the cluster database engine. |
DescribeEventCategoriesCommand | Displays a list of categories for all event source types, or, if specified, for a specified source type. |
DescribeEventSubscriptionsCommand | Lists all the subscription descriptions for a customer account. The description for a subscription includes If you specify a |
DescribeEventsCommand | Returns events related to instances, security groups, snapshots, and DB parameter groups for the past 14 days. You can obtain events specific to a particular DB instance, security group, snapshot, or parameter group by providing the name as a parameter. By default, the events of the past hour are returned. |
DescribeGlobalClustersCommand | Returns information about Amazon DocumentDB global clusters. This API supports pagination. This action only applies to Amazon DocumentDB clusters. |
DescribeOrderableDBInstanceOptionsCommand | Returns a list of orderable instance options for the specified engine. |
DescribePendingMaintenanceActionsCommand | Returns a list of resources (for example, instances) that have at least one pending maintenance action. |
FailoverDBClusterCommand | Forces a failover for a cluster. A failover for a cluster promotes one of the Amazon DocumentDB replicas (read-only instances) in the cluster to be the primary instance (the cluster writer). If the primary instance fails, Amazon DocumentDB automatically fails over to an Amazon DocumentDB replica, if one exists. You can force a failover when you want to simulate a failure of a primary instance for testing. |
FailoverGlobalClusterCommand | Promotes the specified secondary DB cluster to be the primary DB cluster in the global cluster when failing over a global cluster occurs. Use this operation to respond to an unplanned event, such as a regional disaster in the primary region. Failing over can result in a loss of write transaction data that wasn't replicated to the chosen secondary before the failover event occurred. However, the recovery process that promotes a DB instance on the chosen seconday DB cluster to be the primary writer DB instance guarantees that the data is in a transactionally consistent state. |
ListTagsForResourceCommand | Lists all tags on an Amazon DocumentDB resource. |
ModifyDBClusterCommand | Modifies a setting for an Amazon DocumentDB cluster. You can change one or more database configuration parameters by specifying these parameters and the new values in the request. |
ModifyDBClusterParameterGroupCommand | Modifies the parameters of a cluster parameter group. To modify more than one parameter, submit a list of the following: Changes to dynamic parameters are applied immediately. Changes to static parameters require a reboot or maintenance windowbefore the change can take effect. After you create a cluster parameter group, you should wait at least 5 minutes before creating your first cluster that uses that cluster parameter group as the default parameter group. This allows Amazon DocumentDB to fully complete the create action before the parameter group is used as the default for a new cluster. This step is especially important for parameters that are critical when creating the default database for a cluster, such as the character set for the default database defined by the |
ModifyDBClusterSnapshotAttributeCommand | Adds an attribute and values to, or removes an attribute and values from, a manual cluster snapshot. To share a manual cluster snapshot with other Amazon Web Services accounts, specify |
ModifyDBInstanceCommand | Modifies settings for an instance. You can change one or more database configuration parameters by specifying these parameters and the new values in the request. |
ModifyDBSubnetGroupCommand | Modifies an existing subnet group. subnet groups must contain at least one subnet in at least two Availability Zones in the Amazon Web Services Region. |
ModifyEventSubscriptionCommand | Modifies an existing Amazon DocumentDB event notification subscription. |
ModifyGlobalClusterCommand | Modify a setting for an Amazon DocumentDB global cluster. You can change one or more configuration parameters (for example: deletion protection), or the global cluster identifier by specifying these parameters and the new values in the request. This action only applies to Amazon DocumentDB clusters. |
RebootDBInstanceCommand | You might need to reboot your instance, usually for maintenance reasons. For example, if you make certain changes, or if you change the cluster parameter group that is associated with the instance, you must reboot the instance for the changes to take effect. Rebooting an instance restarts the database engine service. Rebooting an instance results in a momentary outage, during which the instance status is set to rebooting. |
RemoveFromGlobalClusterCommand | Detaches an Amazon DocumentDB secondary cluster from a global cluster. The cluster becomes a standalone cluster with read-write capability instead of being read-only and receiving data from a primary in a different region. This action only applies to Amazon DocumentDB clusters. |
RemoveSourceIdentifierFromSubscriptionCommand | Removes a source identifier from an existing Amazon DocumentDB event notification subscription. |
RemoveTagsFromResourceCommand | Removes metadata tags from an Amazon DocumentDB resource. |
ResetDBClusterParameterGroupCommand | Modifies the parameters of a cluster parameter group to the default value. To reset specific parameters, submit a list of the following: When you reset the entire group, dynamic parameters are updated immediately and static parameters are set to |
RestoreDBClusterFromSnapshotCommand | Creates a new cluster from a snapshot or cluster snapshot. If a snapshot is specified, the target cluster is created from the source DB snapshot with a default configuration and default security group. If a cluster snapshot is specified, the target cluster is created from the source cluster restore point with the same configuration as the original source DB cluster, except that the new cluster is created with the default security group. |
RestoreDBClusterToPointInTimeCommand | Restores a cluster to an arbitrary point in time. Users can restore to any point in time before |
StartDBClusterCommand | Restarts the stopped cluster that is specified by |
StopDBClusterCommand | Stops the running cluster that is specified by |
SwitchoverGlobalClusterCommand | Switches over the specified secondary Amazon DocumentDB cluster to be the new primary Amazon DocumentDB cluster in the global database cluster. |
DocDBClient Configuration
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
defaultsMode Optional | DefaultsMode | Provider<DefaultsMode> | The @smithy/smithy-client#DefaultsMode that will be used to determine how certain default configuration options are resolved in the SDK. |
disableHostPrefix Optional | boolean | Disable dynamically changing the endpoint of the client based on the hostPrefix trait of an operation. |
extensions Optional | RuntimeExtension[] | Optional extensions |
logger Optional | Logger | Optional logger for logging debug/info/warn/error. |
maxAttempts Optional | number | Provider<number> | Value for how many times a request will be made at most in case of retry. |
profile Optional | string | Setting a client profile is similar to setting a value for the AWS_PROFILE environment variable. Setting a profile on a client in code only affects the single client instance, unlike AWS_PROFILE.When set, and only for environments where an AWS configuration file exists, fields configurable by this file will be retrieved from the specified profile within that file. Conflicting code configuration and environment variables will still have higher priority.For client credential resolution that involves checking the AWS configuration file, the client's profile (this value) will be used unless a different profile is set in the credential provider options. |
region Optional | string | Provider<string> | The AWS region to which this client will send requests |
requestHandler Optional | __HttpHandlerUserInput | The HTTP handler to use or its constructor options. Fetch in browser and Https in Nodejs. |
retryMode Optional | string | Provider<string> | Specifies which retry algorithm to use. |
useDualstackEndpoint Optional | boolean | Provider<boolean> | Enables IPv6/IPv4 dualstack endpoint. |
useFipsEndpoint Optional | boolean | Provider<boolean> | Enables FIPS compatible endpoints. |
Additional config fields are described in the full configuration type: DocDBClientConfig