Releases: Spinit-AB/Spinit.CosmosDb
Release 4.0.0
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.
Release 3.0.0
This release contains a minor but breaking change to setting and reading back throughput, fixed in #49, as well as an update to latest Microsoft.Azure.Cosmos
package (3.26.1
).
Throughput management in v3
// Create database with a specified throughput
await database.Operations.CreateIfNotExistsAsync(new CreateDbOptions(400, ThroughputType.Database));
// Create database with autoscale throughput
await database.Operations.CreateIfNotExistsAsync(new CreateDbOptions(ThroughputProperties.CreateAutoscaleThroughput(1000), ThroughputType.Database));
// Read and write database throughput
ThroughputProperties throughputProperties = await database.Operations.GetThroughputAsync();
database.Operations.SetThroughputAsync(ThroughputProperties.CreateManualThroughput(1000));
// Read and write collection throughput
ThroughputProperties throughput = await database.MyCollection.GetThroughputAsync();
await database.MyCollection.SetThroughputAsync(ThroughputProperties.CreateManualThroughput(400));
Throughput management in v2
// Create database with a specified throughput
await database.Operations.CreateIfNotExistsAsync(new CreateDbOptions(400, ThroughputType.Database));
// Read and write database throughput
int? throughput = await database.Operations.GetThroughputAsync();
await database.Operations.SetThroughputAsync(1000);
// Read and write collection throughput
int? throughput = await database.MyCollection.GetThroughputAsync();
await database.MyCollection.SetThroughputAsync(400);
Release 2.2.0
#48 Updated Microsoft.Azure.Cosmos
to latest version
v2.1.0
- Add CountAsync to ICosmosDbCollection
- Use serialization settings when creating normalized version aswell
v2.0.3
v2.0.2
v2.0.1
v2.0.0
v2.0.0-rc7
Fix collection manual naming issue (#36)
v2.0.0-rc6
Migrate test projects to dotnet core 3. Fixes #34 (#35)