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


Name Description Value
type The resource type

For Bicep, set this value in the resource declaration.
apiVersion The resource api version

For Bicep, set this value in the resource declaration.
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)


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


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


Name Description Value
key MongoIndexKeys
options MongoIndexOptions


Name Description Value
keys string[]


Name Description Value
expireAfterSeconds int
unique bool