New-AzCosmosDBMongoDBIndex

Creates a new CosmosDB MongoDB Index.

Syntax

New-AzCosmosDBMongoDBIndex
   [-TtlInSeconds <Int32>]
   [-Unique <Boolean>]
   [-Key <String[]>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The New-AzCosmosDBMongoDBIndex creates a new CosmosDB MongoDB Index.

Examples

Example 1

PS C:\> New-AzCosmosDBMongoDBIndex -TtlInSeconds {val} -Unique 1 -Key "key1"
Key                                                       Options
---                                                       -------
Microsoft.Azure.Commands.CosmosDB.Models.PSMongoIndexKeys Microsoft.Azure.Commands.CosmosDB.Models.PSMongoIndexOptions

Parameters

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Key

Array of key values as strings.

Type:String[]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-TtlInSeconds

Number of seconds after which the index expires.

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Unique

Bool to indicate if the index is unique or not.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

Microsoft.Azure.Commands.CosmosDB.Models.PSMongoIndex