Skip to content

Class MongoDbEventSourcingConfiguration

Namespace: Cephalon.EventSourcing.MongoDB
Assembly: Cephalon.EventSourcing.MongoDB.dll

Applies the Cephalon event-store schema to a MongoDB collection.

public static class MongoDbEventSourcingConfiguration

objectMongoDbEventSourcingConfiguration

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

EnsureIndexesAsync(IMongoCollection<MongoDbEventEntry>, CancellationToken)

Section titled “ EnsureIndexesAsync(IMongoCollection<MongoDbEventEntry>, CancellationToken)”

Creates the compound unique index on (StreamId, StreamVersion) required by the MongoDB event-store provider.

public static Task EnsureIndexesAsync(IMongoCollection<MongoDbEventEntry> collection, CancellationToken cancellationToken = default)

collection IMongoCollection<MongoDbEventEntry>

The MongoDB collection to configure.

cancellationToken CancellationToken

The token that cancels the operation.

Task

A task that completes when all indexes have been created.