Modifier

Partager via


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

New-AzCosmosDBMongoDBIndex -TtlInSeconds 604800 -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
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Key

Array of key values as strings.

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

-TtlInSeconds

Number of seconds after which the index expires.

Type:Nullable<T>[Int32]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Unique

Bool to indicate if the index is unique or not.

Type:Nullable<T>[Boolean]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

PSMongoIndex