New CosmosDbCollectionCompositeIndexElement - PlagueHO/CosmosDB GitHub Wiki
Creates an indexing policy composite index element.
New-CosmosDbCollectionCompositeIndexElement [-Path] <String> [[-Order] <String>]
[<CommonParameters>]
This function creates an element for a composite index. A composite index consists of two or more elements and when combined can be applied as part of a collection index policy.
PS C:\> $compositeIndex = @(
(New-CosmosDbCollectionCompositeIndexElement -Path '/name' -Order 'Ascending'),
(New-CosmosDbCollectionCompositeIndexElement -Path '/age' -Order 'Ascending')
)
Create a composite index consisting of two index elements.
The order that the composite index element should be sorted in.
Type: String
Parameter Sets: (All)
Aliases:
Accepted values: Ascending, Descending
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The path of the composite index element.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
https://docs.microsoft.com/en-nz/azure/cosmos-db/index-policy#composite-indexes