Skip to content

Releases: Spinit-AB/Spinit.CosmosDb

Release 4.0.0

14 Jul 08:07
Compare
Choose a tag to compare

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

06 May 14:01
fcaed7e
Compare
Choose a tag to compare

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

22 Nov 17:22
Compare
Choose a tag to compare

#48 Updated Microsoft.Azure.Cosmos to latest version

v2.1.0

17 May 13:08
f817dba
Compare
Choose a tag to compare
  • Add CountAsync to ICosmosDbCollection
  • Use serialization settings when creating normalized version aswell

v2.0.3

14 Apr 13:32
d5741a3
Compare
Choose a tag to compare

Yet another tweak to allow the same configurable serialization when searching.
#42

v2.0.2

14 Apr 06:57
5ae8464
Compare
Choose a tag to compare

More serialization configuration options to be able to configure serialization in both CosmosClient and DocumentClient as both are currently used but uses different serialization.
More background in #41

v2.0.1

13 Apr 09:25
e1f2db6
Compare
Choose a tag to compare

Allowing access to json serialization settings via IDatabaseOptions (#39)
Could be configured like so:

var options = new DatabaseOptions<MyDatabase>
{
    ConfigureJsonSerializerSettings = settings => settings.Converters.Add(new VersionJsonConverter());
};

v2.0.0

07 Oct 09:40
5bdaba1
Compare
Choose a tag to compare
  • This library is now utilizing Azure.Cosmos SDK instead of Azure.Document SDK.
  • Add functionality to set/get throughput on containers and/or database
  • Add functionality to manually initialize database construction (see github readme)

v2.0.0-rc7

26 Aug 14:36
3be7988
Compare
Choose a tag to compare
Fix collection manual naming issue (#36)

v2.0.0-rc6

25 Aug 11:32
c443108
Compare
Choose a tag to compare
Migrate test projects to dotnet core 3. Fixes #34 (#35)