Description
MongoRiver.NET is a library to monitor updates to your MongoDB databases in near-realtime. It provides a simple interface for you to take actions when records are inserted, updated, or deleted.
MongoRiver.NET alternatives and similar packages
Based on the "ORM" category.
Alternatively, view MongoRiver.NET alternatives based on common mentions on social networks and blogs.
-
TypeORM
ORM for TypeScript and JavaScript. Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, SAP Hana, WebSQL databases. Works in NodeJS, Browser, Ionic, Cordova and Electron platforms. -
Dapper
DISCONTINUED. Dapper - a simple object mapper for .Net [Moved to: https://github.com/DapperLib/Dapper] -
Entity Framework
EF Core is a modern object-database mapper for .NET. It supports LINQ queries, change tracking, updates, and schema migrations. -
SqlSugar
.Net aot ORM Fastest ORM Simple Easy VB.NET Sqlite orm Oracle ORM Mysql Orm 虚谷数据库 postgresql ORm SqlServer oRm 达梦 ORM 人大金仓 ORM 神通ORM C# ORM , C# ORM .NET ORM NET5 ORM .NET6 ORM ClickHouse orm QuestDb ,TDengine ORM,OceanBase orm,GaussDB orm ,Tidb orm Object/Relational Mapping -
FreeSql
🦄 .NET aot orm, C# orm, VB.NET orm, Mysql orm, Postgresql orm, SqlServer orm, Oracle orm, Sqlite orm, Firebird orm, 达梦 orm, 人大金仓 orm, 神通 orm, 翰高 orm, 南大通用 orm, 虚谷 orm, 国产 orm, Clickhouse orm, DuckDB orm, TDengine orm, QuestDB orm, MsAccess orm. -
EFCore.BulkExtensions
Entity Framework EF Core efcore Bulk Batch Extensions with BulkCopy in .Net for Insert Update Delete Read (CRUD), Truncate and SaveChanges operations on SQL Server, PostgreSQL, MySQL, SQLite -
Dapper Extensions
Dapper Extensions is a small library that complements Dapper by adding basic CRUD operations (Get, Insert, Update, Delete) for your POCOs. For more advanced querying scenarios, Dapper Extensions provides a predicate system. The goal of this library is to keep your POCOs pure by not requiring any attributes or base class inheritance. -
Entity Framework 6
This is the codebase for Entity Framework 6 (previously maintained at https://entityframework.codeplex.com). Entity Framework Core is maintained at https://github.com/dotnet/efcore. -
SmartSql
SmartSql = MyBatis in C# + .NET Core+ Cache(Memory | Redis) + R/W Splitting + PropertyChangedTrack +Dynamic Repository + InvokeSync + Diagnostics -
NPoco
Simple microORM that maps the results of a query onto a POCO object. Project based on Schotime's branch of PetaPoco -
SQLProvider
A general F# SQL database erasing type provider, supporting LINQ queries, schema exploration, individuals, CRUD operations and much more besides. -
MongoDB.Entities
A data access library for MongoDB with an elegant api, LINQ support and built-in entity relationship management -
MongoDB Repository pattern implementation
DISCONTINUED. Repository abstraction layer on top of Official MongoDB C# driver -
DbExtensions
Data-access framework with a strong focus on query composition, granularity and code aesthetics. -
NReco.Data
Fast DB-independent DAL for .NET Core: abstract queries, SQL commands builder, schema-less data access, POCO mapping (micro-ORM). -
EntityFrameworkCore.SqlServer.SimpleBulks
Fast and simple bulk insert (retain client populated Ids or return db generated Ids), bulk update, bulk delete, bulk merge and bulk match for SQL Server. -
Linq.Expression.Optimizer
System.Linq.Expression expressions optimizer. http://thorium.github.io/Linq.Expression.Optimizer -
EntityFramework.DatabaseMigrator
EntityFramework.DatabaseMigrator is a WinForms utility to help manage Entity Framework 6.0+ migrations.
SaaSHub - Software Alternatives and Reviews
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of MongoRiver.NET or a related project?
README
MongoRiver.NET
MongoRiver.NET is a library to monitor updates to your MongoDB databases in near-realtime. It provides a simple interface for you to take actions when records are inserted, updated, or deleted.
MongoRiver.NET was inspired by Stripe's Mongoriver library written in Ruby.
How it works
MongoDB has an oplog, a log of all write operations. MongoRiver.NET monitors updates to this oplog and exposes a simple interface for each operation. See the MongoDB documentation for its oplog for more info.
How to use it
Step 1: Install and use
You can install MongoRiver.NET from nuget:
PM> Install-Package MongoRiver.NET
Or download and build the source from here and reference the MongoRiver.dll
.
Then add using statements:
using MongoRiver;
Step 2: Create an outlet
You'll need to write a class that implements the
MongoRiver.IOutlet
interface.
The IOutlet
interface exposes the following methods that you can implement in your class:
void UpdateOptime(BsonTimestamp timestamp);
void Insert(string databaseName, string collectionName, BsonDocument insertedDocument);
void Update(string databaseName, string collectionName, BsonDocument filterDocument, BsonDocument updatedDocument);
void Delete(string databaseName, string collectionName, BsonDocument filterDocument);
void CreateIndex(string databaseName, string collectionName, BsonDocument indexKeyDocument, BsonDocument optionsDocument);
void DeleteIndex(string databaseName, string collectionName, string indexName);
void CreateCollection(string databaseName, string collectionName, BsonDocument optionsDocument);
void RenameCollection(string databaseName, string collectionName, string newCollectionName);
void DeleteCollection(string databaseName, string collectionName);
void DeleteDatabase(string databaseName);
You should think of these methods like callbacks -- if you want to do something
every time a document is inserted into the MongoDB database, implement the
Insert
method.
Step 3: Create and run a stream
Once you've written your class, you can start tailing the MongoDB oplog! Here's the code you'll need to use:
var client = new MongoClient(YourMongoConnectionString);
var tailer = new Tailer(client);
IOutlet output = new YourOutlet(); // Your class that implements IOutlet here
var stream = new Stream(tailer, output);
stream.RunForever(startOplog);
startOplog
here is the oplog you want the tailer to start at. We use
this to resume interrupted tailers so that no information is lost.
You should save the oplog timestamp each time the UpdateOptime
method is called.
This allows you to retreive the startOplog
when resuming a previous running
tailer that was interrupted:
The tailer
object exposes methods that you can use to get the start oplog.
Oplog startOplog = await tailer.GetMostRecentOplog();
// or
Oplog startOplog = await tailer.GetMostRecentOplog(lastKnowProcessedOplogTimestamp);
// or
Oplog startOplog = await tailer.GetMostRecentOplog(lastKnowProcessedOplogDateTime);
Changelog
1.1.0
- Upgrade to support MongoDB SDK v2.5
1.0.0
Initial release.