MongoDB adapter for Mutent, an entity management library. Version 1.0.0 is the latest stable release, with ongoing active development. It integrates with MongoDB driver v6+ and Mutent v6+. Key differentiators include built-in lost update/delete protection and bulk update optimization. It supports both ESM and CommonJS modules, and ships TypeScript declarations. The adapter wraps core MongoDB operations (find, insert, replace, update, delete) and exposes mutent-specific errors for lost modifications.
npm install mutent-mongodbNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Connects to MongoDB, creates a mutent adapter, and performs basic create and update operations.
Upgrade mongodb and mutent to required peer versions.
Set allowLostUpdates or allowLostDeletes to true to silently orphan entities instead of throwing.
Avoid using diffDocuments until clarification; use default behavior.
Use adapter.raw property to access the underlying Collection for unsupported operations.
No fix needed, but be aware of bulkWrite behavior when mixing operations.
Run: npm install mutent-mongodb
Upgrade mutent to ^6.0.1 and mongodb to >=6.0.0
Set allowLostUpdates: true in MongoAdapter options to suppress and orphan the entity, or reconcile manually.
Upgrade mongodb to v6+: npm install mongodb@6