Microsoft.DocumentDB databaseAccounts/apis/databases/collections 2016-03-19

Template format

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

{
  "name": "string",
  "type": "Microsoft.DocumentDB/databaseAccounts/apis/databases/collections",
  "apiVersion": "2016-03-19",
  "properties": {
    "resource": {
      "id": "string",
      "shardKey": {},
      "indexes": [
        {
          "key": {
            "keys": [
              "string"
            ]
          },
          "options": {
            "expireAfterSeconds": "integer",
            "unique": "boolean"
          }
        }
      ]
    },
    "options": {}
  }
}

Property values

The following tables describe the values you need to set in the schema.

Microsoft.DocumentDB/databaseAccounts/apis/databases/collections object

Name Type Required Value
name string Yes Cosmos DB collection name.
type enum Yes collections
-or-
Microsoft.DocumentDB/databaseAccounts/apis/databases/collections

See Set name and type for child resources.
apiVersion enum Yes 2016-03-19
properties object Yes Properties to create and update Azure Cosmos DB MongoDB collection. - MongoDBCollectionCreateUpdateProperties object

MongoDBCollectionCreateUpdateProperties object

Name Type Required Value
resource object Yes The standard JSON format of a MongoDB collection - MongoDBCollectionResource object
options object Yes A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.

MongoDBCollectionResource object

Name Type Required Value
id string Yes Name of the Cosmos DB MongoDB collection
shardKey object No A key-value pair of shard keys to be applied for the request.
indexes array No List of index keys - MongoIndex object

MongoIndex object

Name Type Required Value
key object No Cosmos DB MongoDB collection index keys - MongoIndexKeys object
options object No Cosmos DB MongoDB collection index key options - MongoIndexOptions object

MongoIndexKeys object

Name Type Required Value
keys array No List of keys for each MongoDB collection in the Azure Cosmos DB service - string

MongoIndexOptions object

Name Type Required Value
expireAfterSeconds integer No Expire after seconds
unique boolean No Is unique or not