Eventuous.Projections.MongoDB 0.15.1

dotnet add package Eventuous.Projections.MongoDB --version 0.15.1                
NuGet\Install-Package Eventuous.Projections.MongoDB -Version 0.15.1                
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.1" />                
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.1                
#r "nuget: Eventuous.Projections.MongoDB, 0.15.1"                
#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.1

// Install Eventuous.Projections.MongoDB as a Cake Tool
#tool nuget:?package=Eventuous.Projections.MongoDB&version=0.15.1                

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 was computed.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.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.1 4,039 11/7/2024
0.15.0 2,062 9/10/2024
0.15.0-rc.3 605 8/15/2024
0.15.0-rc.2 1,051 7/19/2024
0.15.0-rc.1 602 6/27/2024
0.15.0-beta.10 1,147 2/11/2024
0.15.0-beta.8 477 11/18/2023
0.15.0-beta.7 80 11/17/2023
0.15.0-beta.6 1,157 10/4/2023
0.15.0-beta.5 3,552 8/28/2023
0.15.0-beta.4 343 8/22/2023
0.15.0-beta.3 79 8/21/2023
0.15.0-beta.2 87 8/21/2023
0.15.0-beta.1 377 8/21/2023
0.14.0 24,926 2/10/2023
0.13.4-alpha.0.1 127 2/10/2023
0.13.3 851 2/1/2023
0.13.2 296 2/1/2023
0.13.1 1,392 1/14/2023
0.13.0 759 1/10/2023
0.12.0 751 10/6/2022
0.11.4 415 9/30/2022
0.11.3 456 9/27/2022
0.11.2 570 9/23/2022
0.11.1 456 9/23/2022
0.11.0 449 9/20/2022
0.10.6 520 9/9/2022
0.10.5 465 8/25/2022
0.10.4 430 8/22/2022
0.10.3 441 8/21/2022
0.10.2 1,578 7/20/2022
0.10.1 469 7/20/2022
0.10.0 474 7/17/2022
0.9.1 478 6/24/2022
0.9.0 467 6/15/2022
0.8.4 516 5/18/2022
0.8.3 519 5/11/2022
0.8.2 450 5/11/2022
0.8.1 510 5/8/2022
0.8.0 447 4/25/2022
0.7.1 514 4/21/2022
0.7.0 475 4/13/2022
0.6.2 461 3/28/2022
0.6.1 463 3/11/2022
0.6.0 1,245 2/21/2022
0.6.0-rc.8 260 11/27/2021
0.6.0-rc.7 2,439 11/25/2021
0.6.0-rc.6 3,291 11/25/2021
0.6.0-rc.5 3,015 11/25/2021
0.6.0-rc.4 4,951 11/24/2021
0.6.0-rc.3 4,864 11/23/2021
0.6.0-rc.2 1,117 11/20/2021
0.6.0-rc.1 180 11/19/2021
0.5.15 5,733 10/12/2021
0.5.14 818 10/10/2021
0.5.13 332 10/10/2021
0.5.12 387 10/10/2021
0.5.11 401 10/10/2021
0.5.10 402 10/10/2021
0.5.9 539 10/9/2021
0.5.8 351 10/9/2021
0.5.7 345 10/9/2021
0.5.6 329 10/9/2021
0.5.5 387 10/9/2021
0.5.4 411 10/9/2021
0.5.3 392 10/9/2021
0.5.2 434 10/9/2021
0.5.1 362 10/6/2021
0.5.0 444 10/5/2021
0.4.7 904 8/20/2021
0.4.6 467 8/6/2021
0.4.5 765 6/4/2021
0.4.4 1,182 5/25/2021
0.4.3 375 5/24/2021
0.4.2 390 5/24/2021
0.4.1 444 5/21/2021
0.4.0 393 5/21/2021
0.3.1 398 5/24/2021
0.3.0 356 5/12/2021
0.2.0 416 4/27/2021
0.1.1 414 4/9/2021
0.1.1-alpha.0.9 189 4/8/2021
0.1.1-alpha.0.7 186 4/8/2021
0.1.1-alpha.0.6 188 4/8/2021
0.1.1-alpha.0.5 175 3/29/2021
0.1.0 432 3/25/2021
0.0.0-alpha.0.41 167 3/24/2021
0.0.0-alpha.0.31 199 3/24/2021
0.0.0-alpha.0.22 208 3/24/2021
0.0.0-alpha.0.21 214 3/23/2021
0.0.0-alpha.0.20 220 3/23/2021
0.0.0-alpha.0.19 219 3/23/2021
0.0.0-alpha.0.18 169 3/17/2021
0.0.0-alpha.0.17 163 3/17/2021
0.0.0-alpha.0.16 163 3/17/2021
0.0.0-alpha.0.15 176 3/17/2021
0.0.0-alpha.0.14 176 3/17/2021
0.0.0-alpha.0.13 196 3/16/2021
0.0.0-alpha.0.12 203 3/10/2021
0.0.0-alpha.0.11 235 3/10/2021
0.0.0-alpha.0.10 233 3/10/2021
0.0.0-alpha.0.9 239 3/8/2021
0.0.0-alpha.0.8 181 3/8/2021