An Object Document Mapper (ODM) for MongoDB, inspired by JPA, Hibernate, and Doctrine. Version 2.4.0 supports Node.js with TypeScript and decorators, mapping classes to MongoDB documents, change tracking, optimistic locking, and bulk operations for performance. Peer dependency on mongodb ^3.0.1. Key differentiators: class-based mapping with inheritance, decorator support, and bulk write synchronization.
npm install hydrate-mongodbNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows setup with MongoClient, configuration, entity definition, and persisting a document.
Pass MongoClient (from new driver) instead of Db.
Specify db name in Configuration or @Collection decorator.
Access connection via MongoClient API.
Enable 'experimentalDecorators' in tsconfig.json or use Babel plugin.
Import createSessionFactory directly: import { createSessionFactory } from 'hydrate-mongodb'.Set config.databaseName or use @Collection decorator with db name.