Skip to content

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Jul 26, 2025

This PR contains the following updates:

Package Change Age Confidence
@azure/cosmos (source) 4.2.0 -> 4.9.0 age confidence

Release Notes

Azure/azure-sdk-for-js (@​azure/cosmos)

v4.9.0

Compare Source

v4.8.0

Compare Source

v4.7.0

Compare Source

v4.6.0

Compare Source

v4.5.1

Compare Source

v4.5.0

Compare Source

v4.4.1

Compare Source

v4.4.0

Compare Source

v4.3.0

Compare Source

4.3.0 (2025-03-18)

Features Added
Client-side Encryption (Preview) #​28760

Add support for Client-Side Encryption. Read more here: docs

Example of using Client-Side Encryption:

 const credentials = new DefaultAzureCredential();
 const keyResolver = new AzureKeyVaultEncryptionKeyResolver(credentials);
 const cosmosClient = new CosmosClient({connectionString: "<ConnectionString>", clientEncryptionOptions: { keyEncryptionKeyResolver: keyResolver }});
 const database = cosmosClient.database("my-database");
 const metadata: EncryptionKeyWrapMetadata = {
     type: EncryptionKeyResolverName.AzureKeyVault, 
     name: "akvKey", 
     value: "https://<my-key-vault>.vault.azure.net/keys/<key>/<version>",
     algorithm: KeyEncryptionAlgorithm.RSA_OAEP
 };

 await database.createClientEncryptionKey(
     "my-key",
     EncryptionAlgorithm.AEAD_AES_256_CBC_HMAC_SHA256,
     metadata);

 const path1 : ClientEncryptionIncludedPath = {
   path: "/property1",
   clientEncryptionKeyId: "my-key",
   encryptionType: EncryptionType.DETERMINISTIC,
   encryptionAlgorithm: EncryptionAlgorithm.AEAD_AES_256_CBC_HMAC_SHA256,
 };
 const path2 : ClientEncryptionIncludedPath = {
   path: "/property2",
   clientEncryptionKeyId: "my-key",
   encryptionType: EncryptionType.DETERMINISTIC,
   encryptionAlgorithm: EncryptionAlgorithm.AEAD_AES_256_CBC_HMAC_SHA256,
 };
 const paths = [path1, path2];
 const clientEncryptionPolicy = {
     includedPaths: [path],
     policyFormatVersion: 2,
 };
 const containerDefinition = {
     id: "my-container",
     partitionKey: {
       paths: ["/id"],
     },
     clientEncryptionPolicy: clientEncryptionPolicy,
 };
 await database.containers.createIfNotExists(containerDefinition);
New Query Pipeline

Introduced enableQueryControl flag to enhance query pipeline, giving users more control over their query execution.

By default, value of enableQueryControl is set as false keeping query pipeline older behavior as default, as explained below:

Previously, the SDK guaranteed that each fetchNext call would return maxItemCount number of results, provided those many results existed in the backend. While this behavior ensured a predictable output, the SDK may query backend partitions multiple times in a single fetchNext iteration. This can sometimes lead to higher RU consumption with no user control, especially when results are scattered across partitions. Also queries could run for extended periods as the SDK worked to fulfil the maxItemCount guarantee.

When enableQueryControl is set to true, Each fetchNext call will now query up to maxDegreeOfParallelism physical partitions. If no results are found, the SDK will return empty pages instead of continuing to search all partitions. Returning fewer or empty results in each iteration consumes less RUs and hands control back to the users, allowing them to decide whether to continue fetching more data. This approach provides more granular control over RU consumption.

Eg. usage of this flag to enable new query pipeline:

const options : FeedOptions = {
  enableQueryControl: true, // Flag to enable new query pipeline. Default value is false
  maxItemCount: 100,
  maxDegreeOfParallelism: 10,
  forceQueryPlan: true,
}
const queryIterator = container.items.query("query text", options);
const res = await queryIterator.fetchNext();
Partition merge support

This feature adds support for Partition merge (preview) feature. Requests from SDK will not be blocked, when the feature is enabled on the CosmosDB account.
Read more about merge here: docs

RU Bucketing (Preview)

Read more about RU Bucketing here: https://aka.ms/cosmsodb-bucketing

Partial hierarchical partition key support in Change Feed #​27059

This feature adds support for partial hierarchical partition key in Change Feed allowing the SDK to work seamlessly with partial Hierarchical partition keys, returning accurate change feed results regardless of which partition key components are provided in the iterator.

Eg. Container has partition key ["/name", "/zip", "/state"], change feed will work if, only value of name and zip is provided eg: ["john", "11011"]

Index Metrics V2 support

This feature adds support for V2 version of index metrics that returns the response in JSON format.

Example output of older version

Index Utilization Information
  Utilized Single Indexes
    Index Spec: /Item/?
    Index Impact Score: High
    ---
    Index Spec: /Price/?
    Index Impact Score: High
    ---
  Potential Single Indexes
  Utilized Composite Indexes
  Potential Composite Indexes
    Index Spec: /Item ASC, /Price ASC
    Index Impact Score: High
    ---

Example output of version V2

{"UtilizedIndexes":{"SingleIndexes":[{"IndexSpec":"/Item/?"},{"IndexSpec":"/Price/?"}],"CompositeIndexes":[]},"PotentialIndexes":{"SingleIndexes":[],"CompositeIndexes":[{"IndexSpecs":["/Item ASC","/Price ASC"],"IndexImpactScore":"High"}]}}
Add connectionString in CosmosClientOptions

ConnectionString can now be configured in CosmosClientOptions along with other configurations for client initialization.
Eg. usage:

const options = {
  connectionString: "<ConnectionString>",
  consistencyLevel: ConsistencyLevel.Strong
}
Bugs Fixed
  • Fixed issue for incorrect ParallelizeCrossPartitionQuery header value. It was set to true if maxDegreeOfParallelism was set to 0 or 1 in FeedOptions while executing a query. #​31232
  • Fixed the issue for incorrect results in Changefeed in case of internal TimeoutErrors #​32652
  • Fix RequestOptions and SharedOptions #​27336
  • Set default values in RetryOptions #​27312
Other Changes
  • Deprecate the older changeFeed iterator in favor of the newer getChangeFeedIterator() method. #​32650

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/azure-sdk-for-js-monorepo branch 2 times, most recently from bdcd3d7 to e9c44b5 Compare September 6, 2025 16:01
@renovate renovate bot changed the title Update dependency @azure/cosmos to v4.5.0 Update dependency @azure/cosmos to v4.5.1 Sep 6, 2025
@renovate renovate bot force-pushed the renovate/azure-sdk-for-js-monorepo branch from e9c44b5 to c0b3d1c Compare September 25, 2025 16:39
@renovate renovate bot force-pushed the renovate/azure-sdk-for-js-monorepo branch from c0b3d1c to 02f593a Compare October 10, 2025 03:12
@renovate renovate bot changed the title Update dependency @azure/cosmos to v4.5.1 Update dependency @azure/cosmos to v4.6.0 Oct 10, 2025
@renovate renovate bot force-pushed the renovate/azure-sdk-for-js-monorepo branch 2 times, most recently from 4a21e3e to 8097537 Compare October 24, 2025 04:54
@renovate renovate bot changed the title Update dependency @azure/cosmos to v4.6.0 Update dependency @azure/cosmos to v4.7.0 Oct 24, 2025
@renovate renovate bot force-pushed the renovate/azure-sdk-for-js-monorepo branch from 8097537 to be42748 Compare November 10, 2025 23:43
@renovate renovate bot changed the title Update dependency @azure/cosmos to v4.7.0 Update dependency @azure/cosmos to v4.8.0 Nov 20, 2025
@renovate renovate bot force-pushed the renovate/azure-sdk-for-js-monorepo branch from be42748 to 3c8f6fe Compare November 20, 2025 22:10
@renovate renovate bot force-pushed the renovate/azure-sdk-for-js-monorepo branch from 3c8f6fe to b226e0f Compare November 25, 2025 08:35
@renovate renovate bot changed the title Update dependency @azure/cosmos to v4.8.0 Update dependency @azure/cosmos to v4.9.0 Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant