az cosmosdb mongodb collection
Note
This reference is part of the cosmosdb-preview extension for the Azure CLI (version 2.17.1 or higher). The extension will automatically install the first time you run an az cosmosdb mongodb collection command. Learn more about extensions.
Manage Azure Cosmos DB MongoDB collections.
Commands
Name | Description | Type | Status |
---|---|---|---|
az cosmosdb mongodb collection merge |
Merges the partitions of a mongodb collection. |
Extension | Preview |
az cosmosdb mongodb collection redistribute-partition-throughput |
Redistributes the partition throughput of a mongodb collection. |
Extension | Preview |
az cosmosdb mongodb collection restore |
Restore a deleted mongodb collection within the same account. |
Extension | Preview |
az cosmosdb mongodb collection retrieve-partition-throughput |
Retrieve the partition throughput of a mongodb collection. |
Extension | Preview |
az cosmosdb mongodb collection merge
This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Merges the partitions of a mongodb collection.
az cosmosdb mongodb collection merge --account-name
--database-name
--name
--resource-group
Examples
merge partitions of collection my-mongodb-collection
az cosmosdb mongodb collection merge -g my-resource-group -a my-account -d my-db --name my-mongodb-collection
Required Parameters
Name of the CosmosDB database account.
Name of the mongoDB database.
Name of the mongoDB collection.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az cosmosdb mongodb collection redistribute-partition-throughput
This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Redistributes the partition throughput of a mongodb collection.
az cosmosdb mongodb collection redistribute-partition-throughput --account-name
--database-name
--name
--resource-group
[--evenly-distribute {false, true}]
[--source-partition-info]
[--target-partition-info]
Examples
Evenly distributes the partition throughput for a mongodb collection among all physical partitions
az cosmosdb mongodb collection redistribute-partition-throughput --account-name account_name --database-name db_name --name container_name --resource-group rg_name --evenly-distribute
Redistributes the partition throughput for a mongodb collection from source partitions to target partitions
az cosmosdb mongodb collection redistribute-partition-throughput --account-name account_name --database-name db_name --name container_name --resource-group rg_name --target-partition-info 8=1200 6=1200' --source-partition-info 9'
Required Parameters
Name of the CosmosDB database account.
Name of the CosmosDB database name.
Name of the CosmosDB collection.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Switch to distribute throughput equally among all physical partitions.
Space separated source physical partition ids eg: 1 2.
Information about desired target physical partition throughput eg: '0=1200 1=1200'.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az cosmosdb mongodb collection restore
This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Restore a deleted mongodb collection within the same account.
az cosmosdb mongodb collection restore --account-name
--database-name
--name
--resource-group
[--disable-ttl {false, true}]
[--restore-timestamp]
Examples
Restore a deleted mongodb collection within the same account.
az cosmosdb mongodb collection restore --resource-group resource_group --account-name database_account_name --database-name parent_database_name --name name_of_collection_needs_to_be_restored --restore-timestamp 2020-07-13T16:03:41+0000
Required Parameters
Cosmosdb account name.
Database name.
Collection name.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Enable or disable restoring with ttl disabled.
The timestamp to which the collection needs to be restored to.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az cosmosdb mongodb collection retrieve-partition-throughput
This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Retrieve the partition throughput of a mongodb collection.
az cosmosdb mongodb collection retrieve-partition-throughput --account-name
--database-name
--name
--resource-group
[--all-partitions {false, true}]
[--physical-partition-ids]
Examples
Retrieve container container_name's throughput for specific physical partitions
az cosmosdb mongodb collection retrieve-partition-throughput --account-name account_name --database-name db_name --name container_name --resource-group rg_name --physical-partition-ids 8 9
Retrieve container container_name's throughput for all physical partitions
az cosmosdb mongodb collection retrieve-partition-throughput --account-name account_name --database-name db_name --name container_name --resource-group rg_name --all-partitions
Required Parameters
Name of the CosmosDB database account.
Name of the CosmosDB database name.
Name of the CosmosDB container.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Switch to retrieve throughput for all physical partitions.
Space separated list of physical partition ids.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for