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
<PackageReference Include="Eventuous.Projections.MongoDB" Version="0.15.1" />
paket add Eventuous.Projections.MongoDB --version 0.15.1
#r "nuget: Eventuous.Projections.MongoDB, 0.15.1"
// 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
, implementsICheckpointStore
MongoProjection
, implementsIEventHandler
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 | Versions 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. |
-
net6.0
- Eventuous.Subscriptions (>= 0.15.1)
- MongoDB.Driver (>= 2.26.0)
- System.Reactive (>= 6.0.1)
-
net8.0
- Eventuous.Subscriptions (>= 0.15.1)
- MongoDB.Driver (>= 2.26.0)
- System.Reactive (>= 6.0.1)
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 | 1,083 | 11/7/2024 |
0.15.0 | 1,696 | 9/10/2024 |
0.15.0-rc.3 | 512 | 8/15/2024 |
0.15.0-rc.2 | 1,042 | 7/19/2024 |
0.15.0-rc.1 | 504 | 6/27/2024 |
0.15.0-beta.10 | 1,087 | 2/11/2024 |
0.15.0-beta.8 | 474 | 11/18/2023 |
0.15.0-beta.7 | 77 | 11/17/2023 |
0.15.0-beta.6 | 868 | 10/4/2023 |
0.15.0-beta.5 | 3,513 | 8/28/2023 |
0.15.0-beta.4 | 340 | 8/22/2023 |
0.15.0-beta.3 | 76 | 8/21/2023 |
0.15.0-beta.2 | 82 | 8/21/2023 |
0.15.0-beta.1 | 368 | 8/21/2023 |
0.14.0 | 23,473 | 2/10/2023 |
0.13.4-alpha.0.1 | 119 | 2/10/2023 |
0.13.3 | 842 | 2/1/2023 |
0.13.2 | 288 | 2/1/2023 |
0.13.1 | 1,383 | 1/14/2023 |
0.13.0 | 750 | 1/10/2023 |
0.12.0 | 738 | 10/6/2022 |
0.11.4 | 403 | 9/30/2022 |
0.11.3 | 444 | 9/27/2022 |
0.11.2 | 556 | 9/23/2022 |
0.11.1 | 444 | 9/23/2022 |
0.11.0 | 436 | 9/20/2022 |
0.10.6 | 508 | 9/9/2022 |
0.10.5 | 453 | 8/25/2022 |
0.10.4 | 418 | 8/22/2022 |
0.10.3 | 429 | 8/21/2022 |
0.10.2 | 1,566 | 7/20/2022 |
0.10.1 | 457 | 7/20/2022 |
0.10.0 | 462 | 7/17/2022 |
0.9.1 | 466 | 6/24/2022 |
0.9.0 | 455 | 6/15/2022 |
0.8.4 | 498 | 5/18/2022 |
0.8.3 | 507 | 5/11/2022 |
0.8.2 | 438 | 5/11/2022 |
0.8.1 | 498 | 5/8/2022 |
0.8.0 | 434 | 4/25/2022 |
0.7.1 | 501 | 4/21/2022 |
0.7.0 | 462 | 4/13/2022 |
0.6.2 | 448 | 3/28/2022 |
0.6.1 | 447 | 3/11/2022 |
0.6.0 | 1,231 | 2/21/2022 |
0.6.0-rc.8 | 248 | 11/27/2021 |
0.6.0-rc.7 | 2,427 | 11/25/2021 |
0.6.0-rc.6 | 3,279 | 11/25/2021 |
0.6.0-rc.5 | 3,003 | 11/25/2021 |
0.6.0-rc.4 | 4,939 | 11/24/2021 |
0.6.0-rc.3 | 4,852 | 11/23/2021 |
0.6.0-rc.2 | 1,105 | 11/20/2021 |
0.6.0-rc.1 | 168 | 11/19/2021 |
0.5.15 | 5,720 | 10/12/2021 |
0.5.14 | 802 | 10/10/2021 |
0.5.13 | 316 | 10/10/2021 |
0.5.12 | 371 | 10/10/2021 |
0.5.11 | 386 | 10/10/2021 |
0.5.10 | 386 | 10/10/2021 |
0.5.9 | 523 | 10/9/2021 |
0.5.8 | 337 | 10/9/2021 |
0.5.7 | 329 | 10/9/2021 |
0.5.6 | 314 | 10/9/2021 |
0.5.5 | 371 | 10/9/2021 |
0.5.4 | 395 | 10/9/2021 |
0.5.3 | 376 | 10/9/2021 |
0.5.2 | 419 | 10/9/2021 |
0.5.1 | 346 | 10/6/2021 |
0.5.0 | 430 | 10/5/2021 |
0.4.7 | 888 | 8/20/2021 |
0.4.6 | 452 | 8/6/2021 |
0.4.5 | 738 | 6/4/2021 |
0.4.4 | 1,167 | 5/25/2021 |
0.4.3 | 358 | 5/24/2021 |
0.4.2 | 377 | 5/24/2021 |
0.4.1 | 431 | 5/21/2021 |
0.4.0 | 380 | 5/21/2021 |
0.3.1 | 383 | 5/24/2021 |
0.3.0 | 341 | 5/12/2021 |
0.2.0 | 402 | 4/27/2021 |
0.1.1 | 396 | 4/9/2021 |
0.1.1-alpha.0.9 | 176 | 4/8/2021 |
0.1.1-alpha.0.7 | 174 | 4/8/2021 |
0.1.1-alpha.0.6 | 176 | 4/8/2021 |
0.1.1-alpha.0.5 | 162 | 3/29/2021 |
0.1.0 | 415 | 3/25/2021 |
0.0.0-alpha.0.41 | 154 | 3/24/2021 |
0.0.0-alpha.0.31 | 186 | 3/24/2021 |
0.0.0-alpha.0.22 | 195 | 3/24/2021 |
0.0.0-alpha.0.21 | 201 | 3/23/2021 |
0.0.0-alpha.0.20 | 207 | 3/23/2021 |
0.0.0-alpha.0.19 | 206 | 3/23/2021 |
0.0.0-alpha.0.18 | 156 | 3/17/2021 |
0.0.0-alpha.0.17 | 150 | 3/17/2021 |
0.0.0-alpha.0.16 | 150 | 3/17/2021 |
0.0.0-alpha.0.15 | 163 | 3/17/2021 |
0.0.0-alpha.0.14 | 163 | 3/17/2021 |
0.0.0-alpha.0.13 | 183 | 3/16/2021 |
0.0.0-alpha.0.12 | 190 | 3/10/2021 |
0.0.0-alpha.0.11 | 221 | 3/10/2021 |
0.0.0-alpha.0.10 | 218 | 3/10/2021 |
0.0.0-alpha.0.9 | 226 | 3/8/2021 |
0.0.0-alpha.0.8 | 168 | 3/8/2021 |