gpt4 book ai didi

azure - 如何使用 Azure CLI 创建新的 Cosmos DB 集合时指定 10GB 固定大小

转载 作者:行者123 更新时间:2023-12-02 07:08:09 25 4
gpt4 key购买 nike

我试图弄清楚如何在使用 Azure CLI 创建新的 Cosmos DB 集合时指定 10GB 固定大小。 az cosmosdb collection create 命令不允许您指定这一点。肯定就在我面前,但我不知道如何才能实现这一目标。

az cosmosdb collection create --collection-name
--db-name
[--default-ttl]
[--indexing-policy]
[--key]
[--name]
[--partition-key-path]
[--resource-group-name]
[--throughput]
[--url-connection]

文档链接:https://learn.microsoft.com/en-us/cli/azure/cosmosdb/collection?view=azure-cli-latest#az-cosmosdb-collection-create

最佳答案

使用 CLI 时,您可以创建固定 (10GB) 和无限的集合。主要区别在于您是否指定分区键(然后指定固定或无限收集的有效范围内的吞吐量)。无限集合需要分区键。

例如,我刚刚运行了这两个命令:

az cosmosdb collection create -d stackoverflow -c test1
--name <mycosmosaccountname> --key "<mycosmosaccountkey>"
--throughput 400

az cosmosdb collection create -d stackoverflow -c test2
--name <mycosmosaccountname> --key "<mycosmosaccountkey>"
--partition-key-path "/foo" --throughput 3000

这创建了 10GB 集合和无限集合:

example of collections via cli

关于azure - 如何使用 Azure CLI 创建新的 Cosmos DB 集合时指定 10GB 固定大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51459756/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com