Eventuous.Projections.MongoDB 0.15.0-beta.10

This is a prerelease version of Eventuous.Projections.MongoDB.
dotnet add package Eventuous.Projections.MongoDB --version 0.15.0-beta.10
NuGet\Install-Package Eventuous.Projections.MongoDB -Version 0.15.0-beta.10
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Eventuous.Projections.MongoDB" Version="0.15.0-beta.10" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Eventuous.Projections.MongoDB --version 0.15.0-beta.10
#r "nuget: Eventuous.Projections.MongoDB, 0.15.0-beta.10"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Eventuous.Projections.MongoDB as a Cake Addin
#addin nuget:?package=Eventuous.Projections.MongoDB&version=0.15.0-beta.10&prerelease

// Install Eventuous.Projections.MongoDB as a Cake Tool
#tool nuget:?package=Eventuous.Projections.MongoDB&version=0.15.0-beta.10&prerelease

Eventuous MongoDB projections

This package adds MongoDB projections to applications built with Eventuous.

There are two main components provided by this package:

  • MongoCheckpointStore, implements ICheckpointStore
  • MongoProjection, implements IEventHandler

Using checkpoint store

You can register MongoCheckpointStore so it will be used by all subscriptions that need to store checkpoints (normally, EventStoreDB catch-up subscriptions).

services.AddSingleton<ICheckpointStore, MongoCheckpointStore>();

It will add a checkpoint collection to your Mongo database. Each subscription will have its own checkpoint document. The document id would be the subscription id. Make sure to use unique subscription ids across different applications if they use the same Mongo database.

Using projections

Create your own projection class that inherits MongoProjection<T> abstract class. Here, T is the document type, which must be a record. Your document type should inherit from ProjectedDocument record.

Use the On<TEvent> function to register event projection handlers:

public class ProjectWithTasksProjection : MongoProjection<ProjectWithTasks> {
    public ProjectWithTasksProjection(
        IMongoDatabase  database,
        ILoggerFactory? loggerFactory
    ) : base(database, QuerySubscription.Id, loggerFactory) { 
        On<V1.ProjectRegistered>(
            ctx => ctx.Message.ProjectId, 
            (ctx, update) => update.SetOnInsert(x => x.ProjectName, ctx.Message.Name)
        );
        On<V1.TaskCreated>(
            ctx => ctx.Message.ProjectId,
            (ctx, update) => update.AddToSet(
                x => x.Tasks,
                new ProjectTaskRecord(ctx.Message.TaskId, ctx.Message.Description)
            )
        );
    }
}

Read more in Eventuous documentation.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Eventuous.Projections.MongoDB:

Package Downloads
Eventuous.Connector.EsdbMongo

Eventuous connector between EventStoreDB and other things

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.15.0-beta.10 357 2/11/2024
0.15.0-beta.8 453 11/18/2023
0.15.0-beta.7 57 11/17/2023
0.15.0-beta.6 329 10/4/2023
0.15.0-beta.5 2,900 8/28/2023
0.15.0-beta.4 254 8/22/2023
0.15.0-beta.3 59 8/21/2023
0.15.0-beta.2 67 8/21/2023
0.15.0-beta.1 219 8/21/2023
0.14.0 11,041 2/10/2023
0.13.4-alpha.0.1 100 2/10/2023
0.13.3 814 2/1/2023
0.13.2 263 2/1/2023
0.13.1 1,340 1/14/2023
0.13.0 706 1/10/2023
0.12.0 701 10/6/2022
0.11.4 365 9/30/2022
0.11.3 408 9/27/2022
0.11.2 498 9/23/2022
0.11.1 409 9/23/2022
0.11.0 400 9/20/2022
0.10.6 474 9/9/2022
0.10.5 429 8/25/2022
0.10.4 382 8/22/2022
0.10.3 392 8/21/2022
0.10.2 1,525 7/20/2022
0.10.1 422 7/20/2022
0.10.0 426 7/17/2022
0.9.1 432 6/24/2022
0.9.0 421 6/15/2022
0.8.4 460 5/18/2022
0.8.3 473 5/11/2022
0.8.2 403 5/11/2022
0.8.1 462 5/8/2022
0.8.0 415 4/25/2022
0.7.1 483 4/21/2022
0.7.0 429 4/13/2022
0.6.2 411 3/28/2022
0.6.1 415 3/11/2022
0.6.0 1,198 2/21/2022
0.6.0-rc.8 231 11/27/2021
0.6.0-rc.7 2,413 11/25/2021
0.6.0-rc.6 3,263 11/25/2021
0.6.0-rc.5 2,988 11/25/2021
0.6.0-rc.4 4,925 11/24/2021
0.6.0-rc.3 4,838 11/23/2021
0.6.0-rc.2 1,089 11/20/2021
0.6.0-rc.1 155 11/19/2021
0.5.15 4,962 10/12/2021
0.5.14 773 10/10/2021
0.5.13 287 10/10/2021
0.5.12 338 10/10/2021
0.5.11 350 10/10/2021
0.5.10 356 10/10/2021
0.5.9 494 10/9/2021
0.5.8 302 10/9/2021
0.5.7 299 10/9/2021
0.5.6 298 10/9/2021
0.5.5 338 10/9/2021
0.5.4 364 10/9/2021
0.5.3 348 10/9/2021
0.5.2 403 10/9/2021
0.5.1 328 10/6/2021
0.5.0 398 10/5/2021
0.4.7 850 8/20/2021
0.4.6 415 8/6/2021
0.4.5 693 6/4/2021
0.4.4 1,127 5/25/2021
0.4.3 324 5/24/2021
0.4.2 341 5/24/2021
0.4.1 396 5/21/2021
0.4.0 357 5/21/2021
0.3.1 350 5/24/2021
0.3.0 311 5/12/2021
0.2.0 365 4/27/2021
0.1.1 360 4/9/2021
0.1.1-alpha.0.9 159 4/8/2021
0.1.1-alpha.0.7 156 4/8/2021
0.1.1-alpha.0.6 158 4/8/2021
0.1.1-alpha.0.5 144 3/29/2021
0.1.0 354 3/25/2021
0.0.0-alpha.0.41 135 3/24/2021
0.0.0-alpha.0.31 169 3/24/2021
0.0.0-alpha.0.22 177 3/24/2021
0.0.0-alpha.0.21 186 3/23/2021
0.0.0-alpha.0.20 189 3/23/2021
0.0.0-alpha.0.19 189 3/23/2021
0.0.0-alpha.0.18 138 3/17/2021
0.0.0-alpha.0.17 134 3/17/2021
0.0.0-alpha.0.16 134 3/17/2021
0.0.0-alpha.0.15 145 3/17/2021
0.0.0-alpha.0.14 147 3/17/2021
0.0.0-alpha.0.13 166 3/16/2021
0.0.0-alpha.0.12 173 3/10/2021
0.0.0-alpha.0.11 205 3/10/2021
0.0.0-alpha.0.10 204 3/10/2021
0.0.0-alpha.0.9 210 3/8/2021
0.0.0-alpha.0.8 149 3/8/2021