Cmdlets for Azure Cosmos DB

Build 24.0.9060

Update-CosmosDB Cmdlet

Parameters   Output Objects  

Updates Azure Cosmos DB data.

Syntax

Update-CosmosDB [parameters]

Remarks

The Update-CosmosDB cmdlet allows you to use a syntax similar to SQL UPDATE statements to update Azure Cosmos DB data.

$conn = Connect-CosmosDB -AccountEndpoint "myAccountEndpoint" -AccountKey "myAccountKey"
Update-CosmosDB -Connection $conn -Table "[CData].[Entities].Customers" -Columns @("CompanyName") -Values @("Jon Deere") -Id "22"
The Where parameter can also be used to specify the primary key of the table:
Update-CosmosDB -Connection $conn -Table "[CData].[Entities].Customers" -Columns @("CompanyName") -Values @("Jon Deere") -Where "_id = '22'"
The primary key can also be passed to the cmdlet along the pipeline:
Select-CosmosDB -Connection $conn -Table [CData].[Entities].Customers -Where "Country = 'US'" | Update-CosmosDB -Columns @("Country") -Values @("US 2")

Copyright (c) 2024 CData Software, Inc. - All rights reserved.
Build 24.0.9060