az cosmosdb mongodb database
Note
此命令群組具有 Azure CLI 和至少一個擴充功能中定義的命令。 安裝每個擴充功能以受益於其擴充功能。 深入了解擴充功能。
管理 Azure Cosmos DB MongoDB 資料庫。
命令
| 名稱 | Description | 類型 | 狀態 |
|---|---|---|---|
| az cosmosdb mongodb database create |
在 Azure Cosmos DB 帳戶下建立 MongoDB 資料庫。 |
Core | GA |
| az cosmosdb mongodb database delete |
刪除 Azure Cosmos DB 帳戶下的 MongoDB 資料庫。 |
Core | GA |
| az cosmosdb mongodb database exists |
檢查 Azure Cosmos DB MongoDB 資料庫是否存在。 |
Core | GA |
| az cosmosdb mongodb database list |
列出 Azure Cosmos DB 帳戶下的 MongoDB 資料庫。 |
Core | GA |
| az cosmosdb mongodb database merge |
合併 mongodb 資料庫的分割區。 |
Extension | Preview |
| az cosmosdb mongodb database restore |
還原相同帳戶內已刪除的 mongodb 資料庫。 |
Core | GA |
| az cosmosdb mongodb database restore (cosmosdb-preview 擴充功能) |
還原相同帳戶內已刪除的 mongodb 資料庫。 |
Extension | Preview |
| az cosmosdb mongodb database show |
在 Azure Cosmos DB 帳戶下顯示 MongoDB 資料庫的詳細數據。 |
Core | GA |
| az cosmosdb mongodb database throughput |
在 Azure Cosmos DB 帳戶下管理 MongoDB 資料庫的輸送量。 |
Core | GA |
| az cosmosdb mongodb database throughput migrate |
在自動調整和手動布建之間移轉 MongoDB 資料庫的輸送量。 |
Core | GA |
| az cosmosdb mongodb database throughput show |
取得 Azure Cosmos DB 帳戶下 MongoDB 資料庫的輸送量。 |
Core | GA |
| az cosmosdb mongodb database throughput update |
更新 Azure Cosmos DB 帳戶下 MongoDB 資料庫的輸送量。 |
Core | GA |
az cosmosdb mongodb database create
在 Azure Cosmos DB 帳戶下建立 MongoDB 資料庫。
az cosmosdb mongodb database create --account-name
--name
--resource-group
[--max-throughput]
[--throughput]
必要參數
Cosmosdb 帳戶名稱。
資料庫名稱。
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
輸送量資源上限可以調整為 (RU/秒)。 提供資源啟用自動調整時。 最小值可以是 4000 (RU/秒)。
MongoDB 資料庫的輸送量(RU/秒)。 預設值為 400。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az cosmosdb mongodb database delete
刪除 Azure Cosmos DB 帳戶下的 MongoDB 資料庫。
az cosmosdb mongodb database delete --account-name
--name
--resource-group
[--yes]
範例
刪除 Azure Cosmos DB 帳戶下的 MongoDB 資料庫。 (autogenerated)
az cosmosdb mongodb database delete --account-name MyAccount --name MyDatabase --resource-group MyResourceGroup
必要參數
Cosmosdb 帳戶名稱。
資料庫名稱。
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
請勿提示確認。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az cosmosdb mongodb database exists
檢查 Azure Cosmos DB MongoDB 資料庫是否存在。
az cosmosdb mongodb database exists --account-name
--name
--resource-group
必要參數
Cosmosdb 帳戶名稱。
資料庫名稱。
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az cosmosdb mongodb database list
列出 Azure Cosmos DB 帳戶下的 MongoDB 資料庫。
az cosmosdb mongodb database list --account-name
--resource-group
範例
列出 Azure Cosmos DB 帳戶下的 MongoDB 資料庫。 (autogenerated)
az cosmosdb mongodb database list --account-name MyAccount --resource-group MyResourceGroup
必要參數
Cosmosdb 帳戶名稱。
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az cosmosdb mongodb database merge
此命令處於預覽狀態,且正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus
合併 mongodb 資料庫的分割區。
az cosmosdb mongodb database merge --account-name
--name
--resource-group
範例
合併資料庫 my-mongodb-database 的數據分割
az cosmosdb mongodb database merge -g my-resource-group -a my-account --name my-mongodb-collection
必要參數
CosmosDB 資料庫帳戶的名稱。
mongoDB 資料庫的名稱。
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az cosmosdb mongodb database restore
還原相同帳戶內已刪除的 mongodb 資料庫。
az cosmosdb mongodb database restore --account-name
--name
--resource-group
[--disable-ttl]
[--restore-timestamp]
範例
還原相同帳戶內已刪除的 mongodb 資料庫。
az cosmosdb mongodb database restore --resource-group resource_group --account-name database_account_name --name name_of_database_needs_to_be_restored --restore-timestamp 2020-07-13T16:03:41+0000
必要參數
Cosmosdb 帳戶名稱。
資料庫名稱。
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
停用 TTL 還原的旗標。
使用方式:--disable-ttl True 預設值:false。
資料庫必須還原至的時間戳。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az cosmosdb mongodb database restore (cosmosdb-preview 擴充功能)
此命令處於預覽狀態,且正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus
還原相同帳戶內已刪除的 mongodb 資料庫。
az cosmosdb mongodb database restore --account-name
--name
--resource-group
[--disable-ttl {false, true}]
[--restore-timestamp]
範例
還原相同帳戶內已刪除的 mongodb 資料庫。
az cosmosdb mongodb database restore --resource-group resource_group --account-name database_account_name --name name_of_database_needs_to_be_restored --restore-timestamp 2020-07-13T16:03:41+0000
必要參數
Cosmosdb 帳戶名稱。
資料庫名稱。
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
啟用或停用已停用ttl還原。
| 屬性 | 值 |
|---|---|
| 接受的值: | false, true |
資料庫必須還原至的時間戳。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az cosmosdb mongodb database show
在 Azure Cosmos DB 帳戶下顯示 MongoDB 資料庫的詳細數據。
az cosmosdb mongodb database show --account-name
--name
--resource-group
必要參數
Cosmosdb 帳戶名稱。
資料庫名稱。
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |