mongo-unit-of-work

JSON →
library 3.0.0 ·javascript
verified Jun 7, 2026

A TypeScript library providing MongoDB repositories with a unit-of-work abstraction for transaction-scoped operations. Current stable version is 3.0.0, released on an active cadence. It wraps the MongoDB Node.js driver (7.x) and offers BaseRepository with CRUD methods, pagination, aggregation, and audit fields via AuditableRepository. Key differentiators include first-class transaction support without boilerplate, per-repository transaction opt-out, structured logging, and an event emitter for change notifications. Requires Node.js >=20.19.0 and a MongoDB replica set or sharded cluster for transactions.