Skip to content

Release 4.0.0

Latest
Compare
Choose a tag to compare
@carl-berg carl-berg released this 14 Jul 08:07
· 1 commit to main since this release

This release contains updates to bulk operations and an update to the latest Microsoft.Azure.Cosmos db package.

Bulk operations

Previous versions have relied internally on BulkExecutor whereas the new version uses built in bulk support in v3 of Azure Cosmos DB SDK. This version has also slightly altered the methods for bulk operations. Previous version had the following bulk methods

Task UpsertAsync(IEnumerable<TEntity> entities);
Task DeleteAsync(IEnumerable<string> ids);

... in the new version, these two methods have been changed to also accept an optional CancellationToken and now also returns an operation result like so:

Task<ICosmosBulkOperationResult> UpsertAsync(IEnumerable<TEntity> entities, CancellationToken cancellationToken = default);
Task<ICosmosBulkOperationResult> DeleteAsync(IEnumerable<string> ids, CancellationToken cancellationToken = default);

Another breaking change in these two methods is that if one or more of the bulk operations have failed, a SpinitCosmosDbBulkException will be thrown, but not until all operation have been tried.

Both the ICosmosBulkOperationResult and SpinitCosmosDbBulkException contains information about execution time and resource units used.