An ORM adapter for functional-models that uses MongoDB as the backend datastore. Current stable version is 3.6.1, released periodically on npm. It provides an implementation of the functional-models datastore adapter interface, allowing developers to define functional models and persist them in MongoDB. Key differentiators include full TypeScript support, seamless integration with functional-models library, and a lightweight, functional approach to ORM compared to traditional OOP-based ORMs like Mongoose.
npm install functional-models-orm-mongoNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to initialize the Mongo adapter with a MongoClient, create an ORM instance, define a model, and persist a record.
Ensure you call `client.connect()` before calling `datastoreAdapter`.
Update imports: import { mongoAdapter } from 'functional-models-orm-mongo' -> import { datastoreAdapter } from 'functional-models-orm-mongo'.Use methods like `model.set(attr, value)` or `model.assign({...})` to get updated copies.Use `model.get('_id')` or inspect the raw document after save.Make sure you are using `const { datastoreAdapter } = require('functional-models-orm-mongo');` and that the package is installed.Pass a valid `databaseName` string in the options object: `datastoreAdapter({ mongoClient, databaseName: 'myDB' })`.Create a proper MongoClient: `new MongoClient(uri)` and call `await client.connect()` before using.