Microsoft.DocumentDB databaseAccounts/apis/databases/collections 2015-04-01

The databaseAccounts/apis/databases/collections resource type can be deployed to: Resource groups.

To learn about resource group deployments, see Bicep or ARM template.

Template format

To create a Microsoft.DocumentDB/databaseAccounts/apis/databases/collections resource, add the following Bicep or JSON to your template.

resource symbolicname 'Microsoft.DocumentDB/databaseAccounts/apis/databases/collections@2015-04-01' = {
  name: 'string'
  properties: {
    options: {}
    resource: {
      id: 'string'
      indexes: [
        {
          key: {
            keys: [ 'string' ]
          }
          options: {
            expireAfterSeconds: int
            unique: bool
          }
        }
      ]
      shardKey: {}
    }
  }
}

Property values

databaseAccounts/apis/databases/collections

Name Description Value
type The resource type

For Bicep, set this value in the resource declaration.
'Microsoft.DocumentDB/databaseAccounts/apis/databases/collections'
apiVersion The resource api version

For Bicep, set this value in the resource declaration.
'2015-04-01'
name The resource name

See how to set names and types for child resources in Bicep or JSON ARM templates.
string (required)
properties The properties of an Azure Cosmos DB MongoDB collection MongoDBCollectionCreateUpdateProperties (required)

MongoDBCollectionCreateUpdateProperties

Name Description Value
options object (required)
resource MongoDBCollectionResource (required)

MongoDBCollectionResource

Name Description Value
id string (required)
indexes MongoIndex[]
shardKey object

MongoIndex

Name Description Value
key MongoIndexKeys
options MongoIndexOptions

MongoIndexKeys

Name Description Value
keys string[]

MongoIndexOptions

Name Description Value
expireAfterSeconds int
unique bool