MongoORM is an Object-Document Mapper for MongoDB in Node.js, designed to simplify CRUD operations and schema management. As of version 0.0.21, it's an early-stage library with a class-based approach extending a Document prototype. It provides a declarative schema definition using field types like String and integrates directly with the MongoDB Node.js driver. Compared to Mongoose, it's lighter and more minimal, but lacks maturity and community adoption. Release cadence is irregular; updates are infrequent.
npm install mongoormNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates connecting to MongoDB, defining a schema, creating a document, and saving it.
Upgrade to >=0.0.15 or always call doc.save() on the result of create.
Always await the connect() call before performing operations.
Define nested fields as shown in README: address: { city: fields.String(), pin: fields.String() }Use const user = new User({ document: 'collectionName' });Wrap all operations in an async function that awaits connect.
Ensure MongoORM.connect() has been called and import { Document } from 'mongoorm'.Use connection string format: mongodb://user:pass@host:port/db
Upgrade mongoorm to >=0.0.15 or use new User() and assign fields manually.
Add { document: 'collectionName' } to constructor: new User({ document: 'users' })