This repository has been archived by the owner on May 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 39
MongoDB
Samuel Debruyn edited this page Dec 24, 2015
·
3 revisions
Cirqus offers integration with MongoDB on several points.
To start using any of the components below, install the nuget package.
Install-Package d60.Cirqus.MongoDb
You can opt to use MongoDB as an event store. Cirqus will create the collection by itself if it doesn't already exist.
var processor = CommandProcessor.With().EventStore(conf =>
{
conf.UseMongoDb("NameOfConnectionStringOrConnectionStringItself", "NameOfCollectionWhereEventsShouldGo");
}).Create();
MongoDB is also suited to be used as logging facility. Cirqus will then log all actions to MongoDB. The log collection will contain entries with the following properties:
- level: Debug, Info, Warn or Error
- text: what happened
- time: when it happened
- owner: what made it happen (either
CommandProcessor
orViewManagerEventDispatcher
)
var processor = CommandProcessor.With().....Logging(conf =>
{
conf.UseMongoDb("ConnectionString", "LogCollectionName");
}).Create();
You can use the MongoDbViewManager
to persist a view in MongoDb. You can create one with a connection string or with a MongoDbDatabase
object.
var mongoDbMyViewManager = new MongoDbViewManager<MyView>("MongoDbConnectionString");