共用方式為


Microsoft.DocumentDB 資料庫Accounts/mongodbDatabases/collections 2019-08-01

Bicep 資源定義

databaseAccounts/mongodbDatabases/collections 資源類型可以使用目標作業來部署:

如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔

資源格式

若要建立 Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections 資源,請將下列 Bicep 新增至範本。

resource symbolicname 'Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections@2019-08-01' = {
  parent: resourceSymbolicName
  location: 'string'
  name: 'string'
  properties: {
    options: {
      {customized property}: 'string'
    }
    resource: {
      id: 'string'
      indexes: [
        {
          key: {
            keys: [
              'string'
            ]
          }
          options: {
            expireAfterSeconds: int
            unique: bool
          }
        }
      ]
      shardKey: {
        {customized property}: 'string'
      }
    }
  }
  tags: {
    {customized property}: 'string'
  }
}

屬性值

CreateUpdateOptions

名字 描述 價值

Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections

名字 描述 價值
位置 資源所屬資源群組的位置。 字串
名字 資源名稱 字串 (必要)
父母 在 Bicep 中,您可以指定子資源的父資源。 只有在父資源外部宣告子資源時,才需要新增這個屬性。

如需詳細資訊,請參閱 父資源外部的子資源
類型資源的符號名稱:databaseAccounts/mongodbDatabases
性能 用來建立及更新 Azure Cosmos DB MongoDB 集合的屬性。 MongoDBCollectionCreateUpdatePropertiesOrMongoDBCollectionGetProperties (必要)
標籤 資源標籤 標記名稱和值的字典。 請參閱範本中的 標籤

MongoDBCollectionCreateUpdatePropertiesOrMongoDBCollectionGetProperties

名字 描述 價值
選項 要套用要求之選項的索引鍵/值組。 這會對應至隨要求傳送的標頭。 CreateUpdateOptions (必要)
資源 MongoDB 集合的標準 JSON 格式 MongoDBCollectionResourceOrMongoDBCollectionGetPropertiesResource (必要)

MongoDBCollectionResourceOrMongoDBCollectionGetPropertiesResource

名字 描述 價值
id Cosmos DB MongoDB 集合的名稱 字串 (必要)
指標 索引鍵清單 MongoIndex[]
shardKey 要套用要求之分區索引鍵的索引鍵/值組。 ShardKeys

MongoIndex

名字 描述 價值
鑰匙 Cosmos DB MongoDB 集合索引鍵 MongoIndexKeys
選項 Cosmos DB MongoDB 集合索引鍵選項 MongoIndexOptions

MongoIndexKeys

名字 描述 價值
鑰匙 Azure Cosmos DB 服務中每個 MongoDB 集合的密鑰清單 string[]

MongoIndexOptions

名字 描述 價值
expireAfterSeconds 秒後到期 int
獨特 是唯一或不是唯一的 bool

ShardKeys

名字 描述 價值

標籤

名字 描述 價值

使用範例

Azure 快速入門範例

下列 Azure 快速入門範本 包含用於部署此資源類型的 Bicep 範例。

Bicep 檔案 描述
建立適用於 MongoDB API 的 Azure Cosmos 帳戶 此範本會在兩個區域中建立適用於 MongoDB API 4.2 的 Azure Cosmos DB 帳戶,並使用具有兩個集合的共用和專用輸送量。
建立適用於 MongoDB API 的 Azure Cosmos 帳戶自動調整 此範本會使用共用和專用的自動調整輸送量,在兩個區域中建立 MongoDB API 4.2 的 Azure Cosmos DB 帳戶。

ARM 樣本資源定義

databaseAccounts/mongodbDatabases/collections 資源類型可以使用目標作業來部署:

如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔

資源格式

若要建立 Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections 資源,請將下列 JSON 新增至範本。

{
  "type": "Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections",
  "apiVersion": "2019-08-01",
  "name": "string",
  "location": "string",
  "properties": {
    "options": {
      "{customized property}": "string"
    },
    "resource": {
      "id": "string",
      "indexes": [
        {
          "key": {
            "keys": [ "string" ]
          },
          "options": {
            "expireAfterSeconds": "int",
            "unique": "bool"
          }
        }
      ],
      "shardKey": {
        "{customized property}": "string"
      }
    }
  },
  "tags": {
    "{customized property}": "string"
  }
}

屬性值

CreateUpdateOptions

名字 描述 價值

Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections

名字 描述 價值
apiVersion API 版本 '2019-08-01'
位置 資源所屬資源群組的位置。 字串
名字 資源名稱 字串 (必要)
性能 用來建立及更新 Azure Cosmos DB MongoDB 集合的屬性。 MongoDBCollectionCreateUpdatePropertiesOrMongoDBCollectionGetProperties (必要)
標籤 資源標籤 標記名稱和值的字典。 請參閱範本中的 標籤
類型 資源類型 'Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections'

MongoDBCollectionCreateUpdatePropertiesOrMongoDBCollectionGetProperties

名字 描述 價值
選項 要套用要求之選項的索引鍵/值組。 這會對應至隨要求傳送的標頭。 CreateUpdateOptions (必要)
資源 MongoDB 集合的標準 JSON 格式 MongoDBCollectionResourceOrMongoDBCollectionGetPropertiesResource (必要)

MongoDBCollectionResourceOrMongoDBCollectionGetPropertiesResource

名字 描述 價值
id Cosmos DB MongoDB 集合的名稱 字串 (必要)
指標 索引鍵清單 MongoIndex[]
shardKey 要套用要求之分區索引鍵的索引鍵/值組。 ShardKeys

MongoIndex

名字 描述 價值
鑰匙 Cosmos DB MongoDB 集合索引鍵 MongoIndexKeys
選項 Cosmos DB MongoDB 集合索引鍵選項 MongoIndexOptions

MongoIndexKeys

名字 描述 價值
鑰匙 Azure Cosmos DB 服務中每個 MongoDB 集合的密鑰清單 string[]

MongoIndexOptions

名字 描述 價值
expireAfterSeconds 秒後到期 int
獨特 是唯一或不是唯一的 bool

ShardKeys

名字 描述 價值

標籤

名字 描述 價值

使用範例

Azure 快速入門範本

下列 Azure 快速入門範本 部署此資源類型。

範本 描述
建立適用於 MongoDB API 的 Azure Cosmos 帳戶

部署至 Azure
此範本會在兩個區域中建立適用於 MongoDB API 4.2 的 Azure Cosmos DB 帳戶,並使用具有兩個集合的共用和專用輸送量。
建立適用於 MongoDB API 的 Azure Cosmos 帳戶自動調整

部署至 Azure
此範本會使用共用和專用的自動調整輸送量,在兩個區域中建立 MongoDB API 4.2 的 Azure Cosmos DB 帳戶。

Terraform (AzAPI 提供者) 資源定義

databaseAccounts/mongodbDatabases/collections 資源類型可以使用目標作業來部署:

  • 資源群組

如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔

資源格式

若要建立 Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections 資源,請將下列 Terraform 新增至範本。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections@2019-08-01"
  name = "string"
  location = "string"
  tags = {
    {customized property} = "string"
  }
  body = jsonencode({
    properties = {
      options = {
        {customized property} = "string"
      }
      resource = {
        id = "string"
        indexes = [
          {
            key = {
              keys = [
                "string"
              ]
            }
            options = {
              expireAfterSeconds = int
              unique = bool
            }
          }
        ]
        shardKey = {
          {customized property} = "string"
        }
      }
    }
  })
}

屬性值

CreateUpdateOptions

名字 描述 價值

Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections

名字 描述 價值
位置 資源所屬資源群組的位置。 字串
名字 資源名稱 字串 (必要)
parent_id 此資源為父系之資源的標識碼。 類型資源的標識碼:databaseAccounts/mongodbDatabases
性能 用來建立及更新 Azure Cosmos DB MongoDB 集合的屬性。 MongoDBCollectionCreateUpdatePropertiesOrMongoDBCollectionGetProperties (必要)
標籤 資源標籤 標記名稱和值的字典。
類型 資源類型 “Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections@2019-08-01”

MongoDBCollectionCreateUpdatePropertiesOrMongoDBCollectionGetProperties

名字 描述 價值
選項 要套用要求之選項的索引鍵/值組。 這會對應至隨要求傳送的標頭。 CreateUpdateOptions (必要)
資源 MongoDB 集合的標準 JSON 格式 MongoDBCollectionResourceOrMongoDBCollectionGetPropertiesResource (必要)

MongoDBCollectionResourceOrMongoDBCollectionGetPropertiesResource

名字 描述 價值
id Cosmos DB MongoDB 集合的名稱 字串 (必要)
指標 索引鍵清單 MongoIndex[]
shardKey 要套用要求之分區索引鍵的索引鍵/值組。 ShardKeys

MongoIndex

名字 描述 價值
鑰匙 Cosmos DB MongoDB 集合索引鍵 MongoIndexKeys
選項 Cosmos DB MongoDB 集合索引鍵選項 MongoIndexOptions

MongoIndexKeys

名字 描述 價值
鑰匙 Azure Cosmos DB 服務中每個 MongoDB 集合的密鑰清單 string[]

MongoIndexOptions

名字 描述 價值
expireAfterSeconds 秒後到期 int
獨特 是唯一或不是唯一的 bool

ShardKeys

名字 描述 價值

標籤

名字 描述 價值