New CosmosDbCollectionIncludedPath - PlagueHO/CosmosDB GitHub Wiki
Creates an indexing policy included path object that can be added to an Indexing Policy.
New-CosmosDbCollectionIncludedPath [[-Path] <String>] [[-Index] <Index[]>] [<CommonParameters>]
This function will return an indexing policy included path object that can be added to an Indexing Policy.
PS C:\> $indexStringRange = New-CosmosDbCollectionIncludedPathIndex -Kind Range -DataType String -Precision -1
PS C:\> $indexNumberRange = New-CosmosDbCollectionIncludedPathIndex -Kind Range -DataType Number -Precision -1
PS C:\> $indexIncludedPath = New-CosmosDbCollectionIncludedPath -Path '/*' -Index $indexStringRange, $indexNumberRange
PS C:\> $indexExcludedPath = New-CosmosDbCollectionExcludedPath -Path '/test/*'
PS C:\> $indexingPolicy = New-CosmosDbCollectionIndexingPolicy -Automatic $true -IndexingMode Consistent -IncludedPath $indexIncludedPath -ExcludedPath $indexExcludedPath
PS C:\> New-CosmosDbCollection -Context $cosmosDbContext -Id 'MyNewCollection' -PartitionKey 'account' -IndexingPolicy $indexingPolicy
Create a collection with a custom indexing policy that includes the path '/*'.
This is an array of included path index objects that were created by New-CosmosDbCollectionIncludedPath.
Type: Index[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Path for which the indexing behavior applies to. Index paths start with the root (/) and typically end with the ? wildcard operator, denoting that there are multiple possible values for the prefix. For example, to serve SELECT * FROM Families F WHEREF.familyName = "Andersen", you must include an index path for /familyName/? in the collection's index policy.
Index paths can also use the * wildcard operator to specify the behavior for paths recursively under the prefix. For example, /payload/* can be used to include everything under the payload property from indexing.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 0
Default value: /*
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 (http://go.microsoft.com/fwlink/?LinkID=113216).
https://docs.microsoft.com/en-nz/azure/cosmos-db/index-policy#composite-indexes