Eventuous.Projections.MongoDB 0.15.0-beta.7

This is a prerelease version of Eventuous.Projections.MongoDB.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Eventuous.Projections.MongoDB --version 0.15.0-beta.7
                    
NuGet\Install-Package Eventuous.Projections.MongoDB -Version 0.15.0-beta.7
                    
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.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Eventuous.Projections.MongoDB" Version="0.15.0-beta.7" />
                    
Directory.Packages.props
<PackageReference Include="Eventuous.Projections.MongoDB" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Eventuous.Projections.MongoDB --version 0.15.0-beta.7
                    
#r "nuget: Eventuous.Projections.MongoDB, 0.15.0-beta.7"
                    
#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.
#addin nuget:?package=Eventuous.Projections.MongoDB&version=0.15.0-beta.7&prerelease
                    
Install Eventuous.Projections.MongoDB as a Cake Addin
#tool nuget:?package=Eventuous.Projections.MongoDB&version=0.15.0-beta.7&prerelease
                    
Install Eventuous.Projections.MongoDB as a Cake Tool

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.  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 5,927 11/7/2024
0.15.0 2,305 9/10/2024
0.15.0-rc.3 650 8/15/2024
0.15.0-rc.2 1,055 7/19/2024
0.15.0-rc.1 679 6/27/2024
0.15.0-beta.10 1,177 2/11/2024
0.15.0-beta.8 480 11/18/2023
0.15.0-beta.7 81 11/17/2023
0.15.0-beta.6 1,310 10/4/2023
0.15.0-beta.5 3,569 8/28/2023
0.15.0-beta.4 345 8/22/2023
0.15.0-beta.3 82 8/21/2023
0.15.0-beta.2 90 8/21/2023
0.15.0-beta.1 383 8/21/2023
0.14.0 25,498 2/10/2023
0.13.4-alpha.0.1 132 2/10/2023
0.13.3 858 2/1/2023
0.13.2 302 2/1/2023
0.13.1 1,398 1/14/2023
0.13.0 765 1/10/2023
0.12.0 759 10/6/2022
0.11.4 423 9/30/2022
0.11.3 463 9/27/2022
0.11.2 582 9/23/2022
0.11.1 466 9/23/2022
0.11.0 457 9/20/2022
0.10.6 528 9/9/2022
0.10.5 473 8/25/2022
0.10.4 437 8/22/2022
0.10.3 449 8/21/2022
0.10.2 1,586 7/20/2022
0.10.1 478 7/20/2022
0.10.0 484 7/17/2022
0.9.1 486 6/24/2022
0.9.0 475 6/15/2022
0.8.4 526 5/18/2022
0.8.3 534 5/11/2022
0.8.2 460 5/11/2022
0.8.1 520 5/8/2022
0.8.0 457 4/25/2022
0.7.1 524 4/21/2022
0.7.0 485 4/13/2022
0.6.2 471 3/28/2022
0.6.1 472 3/11/2022
0.6.0 1,255 2/21/2022
0.6.0-rc.8 270 11/27/2021
0.6.0-rc.7 2,449 11/25/2021
0.6.0-rc.6 3,301 11/25/2021
0.6.0-rc.5 3,026 11/25/2021
0.6.0-rc.4 4,962 11/24/2021
0.6.0-rc.3 4,876 11/23/2021
0.6.0-rc.2 1,128 11/20/2021
0.6.0-rc.1 191 11/19/2021
0.5.15 5,744 10/12/2021
0.5.14 829 10/10/2021
0.5.13 343 10/10/2021
0.5.12 399 10/10/2021
0.5.11 413 10/10/2021
0.5.10 414 10/10/2021
0.5.9 551 10/9/2021
0.5.8 363 10/9/2021
0.5.7 357 10/9/2021
0.5.6 341 10/9/2021
0.5.5 398 10/9/2021
0.5.4 422 10/9/2021
0.5.3 403 10/9/2021
0.5.2 446 10/9/2021
0.5.1 375 10/6/2021
0.5.0 455 10/5/2021
0.4.7 915 8/20/2021
0.4.6 479 8/6/2021
0.4.5 778 6/4/2021
0.4.4 1,195 5/25/2021
0.4.3 386 5/24/2021
0.4.2 402 5/24/2021
0.4.1 457 5/21/2021
0.4.0 406 5/21/2021
0.3.1 409 5/24/2021
0.3.0 367 5/12/2021
0.2.0 431 4/27/2021
0.1.1 429 4/9/2021
0.1.1-alpha.0.9 202 4/8/2021
0.1.1-alpha.0.7 200 4/8/2021
0.1.1-alpha.0.6 201 4/8/2021
0.1.1-alpha.0.5 189 3/29/2021
0.1.0 445 3/25/2021
0.0.0-alpha.0.41 180 3/24/2021
0.0.0-alpha.0.31 212 3/24/2021
0.0.0-alpha.0.22 221 3/24/2021
0.0.0-alpha.0.21 227 3/23/2021
0.0.0-alpha.0.20 233 3/23/2021
0.0.0-alpha.0.19 232 3/23/2021
0.0.0-alpha.0.18 182 3/17/2021
0.0.0-alpha.0.17 176 3/17/2021
0.0.0-alpha.0.16 176 3/17/2021
0.0.0-alpha.0.15 189 3/17/2021
0.0.0-alpha.0.14 189 3/17/2021
0.0.0-alpha.0.13 209 3/16/2021
0.0.0-alpha.0.12 216 3/10/2021
0.0.0-alpha.0.11 248 3/10/2021
0.0.0-alpha.0.10 246 3/10/2021
0.0.0-alpha.0.9 254 3/8/2021
0.0.0-alpha.0.8 196 3/8/2021