New-AzCosmosDBSqlIndexingPolicy
Membuat objek CosmosDB Sql IndexingPolicy baru.
Sintaks
New-AzCosmosDBSqlIndexingPolicy
[-IncludedPath <PSIncludedPath[]>]
[-SpatialSpec <PSSpatialSpec[]>]
[-CompositePath <PSCompositePath[][]>]
[-ExcludedPath <String[]>]
[-Automatic <Boolean>]
[-IndexingMode <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Deskripsi
Cmdlet New-AzCosmosDBSqlIndexingPolicy membuat objek baru jenis PSSqlIndexingPolicy.
Contoh
Contoh 1
$ipath1 = New-AzCosmosDBSqlIncludedPathIndex -DataType String -Precision -1 -Kind Hash
$ipath2 = New-AzCosmosDBSqlIncludedPathIndex -DataType String -Precision -1 -Kind Hash
$IncludedPath = New-AzCosmosDBSqlIncludedPath -Path "/*" -Index $ipath1, $ipath2
$SpatialSpec = New-AzCosmosDBSqlSpatialSpec -Path "/mySpatialPath/*" -Type "Point", "LineString", "Polygon", "MultiPolygon"
$cp1 = New-AzCosmosDBSqlCompositePath -Path "/abc" -Order Ascending
$cp2 = New-AzCosmosDBSqlCompositePath -Path "/aberc" -Order Descending
$compositePath = (($cp1, $cp2), ($cp2, $cp1))
New-AzCosmosDBSqlIndexingPolicy -IncludedPath $IncludedPath -SpatialSpec $SpatialSpec -CompositePath $compositePath -ExcludedPath "/myPathToNotIndex/*" -Automatic 1 -IndexingMode Consistent
Automatic : True
IndexingMode : Consistent
IncludedPaths : {Microsoft.Azure.Commands.CosmosDB.Models.PSIncludedPath}
ExcludedPaths : {Microsoft.Azure.Commands.CosmosDB.Models.PSExcludedPath}
CompositeIndexes : {Microsoft.Azure.Commands.CosmosDB.Models.PSCompositePath Microsoft.Azure.Commands.CosmosDB.Models.PSCompositePath,
Microsoft.Azure.Commands.CosmosDB.Models.PSCompositePath Microsoft.Azure.Commands.CosmosDB.Models.PSCompositePath}
SpatialIndexes : {Microsoft.Azure.Commands.CosmosDB.Models.PSSpatialSpec}
Parameter
-Automatic
Bool untuk menunjukkan apakah kebijakan pengindeksan otomatis
Jenis: | Nullable<T>[Boolean] |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | False |
Terima karakter wildcard: | False |
-CompositePath
Array objek jenis Microsoft.Azure.Commands.CosmosDB.PSCompositePath
Jenis: | PSCompositePath[][] |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | False |
Terima karakter wildcard: | False |
-DefaultProfile
Kredensial, akun, penyewa, dan langganan yang digunakan untuk komunikasi dengan Azure.
Jenis: | IAzureContextContainer |
Alias: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | False |
Terima karakter wildcard: | False |
-ExcludedPath
Array string yang berisi excludedPath(Menentukan jalur dalam dokumen JSON yang akan dikecualikan dalam elemen layanan Azure Cosmos DB.).
Jenis: | String[] |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | False |
Terima karakter wildcard: | False |
-IncludedPath
Array string yang berisi includedPath (Menentukan jalur dalam dokumen JSON yang akan disertakan dalam elemen layanan Azure Cosmos DB.).
Jenis: | PSIncludedPath[] |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | False |
Terima karakter wildcard: | False |
-IndexingMode
menunjukkan mode pengindeksan. Nilai yang mungkin termasuk: 'Konsisten', 'Malas', 'Tidak Ada'
Jenis: | String |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | False |
Terima karakter wildcard: | False |
-SpatialSpec
Array objek jenis Microsoft.Azure.Commands.CosmosDB.PSSpatialSpec
Jenis: | PSSpatialSpec[] |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | False |
Terima karakter wildcard: | False |
Input
None
Output
Azure PowerShell