Registry / database / manikin-mongodb

manikin-mongodb

JSON →
library0.15.5jsnpmunverified

Data model abstractions for MongoDB, implementing the manikin interface. Current stable version is 0.15.5. This package is a legacy library with no recent updates, targeting Node.js 0.10 to 0.12 and npm 1.3-2.x. It provides simple CRUD operations for MongoDB documents with a minimal schema-like layer. Not actively maintained; consider mongoose or mongodb-native driver for modern use.

npm install manikin-mongodb
INSTALL
IMPORT
SIG · MANIKIN-MONGODB
M
manikin-mongodb
databasejavascriptv0.15.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

manikinMongodb
const manikinMongodb = require('manikin-mongodb');
import manikinMongodb from 'manikin-mongodb';
This package is CommonJS only; no ESM support. It exports a constructor function that takes a MongoDB Db instance.
MongoAdapter
const MongoAdapter = require('manikin-mongodb').MongoAdapter;
const { MongoAdapter } = require('manikin-mongodb');
MongoAdapter is a property on the default export, not a named export.
manikinMongodb.Model
const Model = require('manikin-mongodb').Model;
Model is exposed as a property of the default export after instantiation.

Connects to MongoDB, creates a manikin-mongodb adapter, defines a User model, and inserts a document using callback style.

const mongodb = require('mongodb'); const manikinMongodb = require('manikin-mongodb'); const url = process.env.MONGO_URL ?? 'mongodb://localhost:27017/test'; mongodb.MongoClient.connect(url, function(err, db) { if (err) throw err; const dbAdapter = manikinMongodb(db); const User = dbAdapter.define('User', { name: String, email: String }); User.create({ name: 'Alice', email: 'alice@example.com' }, function(err, user) { console.log(user); db.close(); }); });
Debug
Known issues
breakingRequires Node.js 0.10 – 0.12; incompatible with modern Node versions (>= 0.13).
fix
Use a newer library like mongoose or the official mongodb driver directly.
affects: 0.15.5
breakingMongoDB driver version is pinned to version 1.x; not compatible with 2.x+ drivers.
fix
Do not upgrade mongodb package to v2+ while using this library.
affects: 0.15.5
deprecatedThe API uses callbacks; no Promise or async/await support.
fix
Wrap calls with promisify or migrate to a modern ODM.
affects: 0.15.5
gotchaModel definitions are mutable and shared; adding fields later affects all instances.
fix
Define all fields upfront and avoid runtime modifications.
affects: 0.15.5
gotchaConnection handling is manual – no built-in connection pooling or auto-reconnect.
fix
Manage MongoDB connection lifecycle externally.
affects: 0.15.5
Errors
Common errors & fixes
Error: Cannot find module 'manikin-mongodb'
Package not installed or missing from node_modules.
fix
Run 'npm install manikin-mongodb' in your project directory.
TypeError: manikinMongodb is not a function
Importing the package incorrectly as a default import in an ESM context.
fix
Use require('manikin-mongodb') instead of import.
Error: The mongodb package version 2.x is not compatible
Dependency conflict when using mongodb v2+ with manikin-mongodb.
fix
Install mongodb@1.x explicitly: 'npm install mongodb@1'.
TypeError: db.collection is not a function
Passing a MongoClient instance instead of a Db object.
fix
Ensure you are passing the result of MongoClient.connect (the Db object).
Upgrade
Version history
0.15.5latest on npm
Audit
Dependencies
manikinrequiredCore abstraction interface; manikin-mongodb implements manikin's data model contracts
mongodbrequiredMongoDB native driver for database connectivity and operations
Agent activity
6 hits · last 30 days
node
6
Resources
manikin-mongodb — npm install manikin-mongodb · libregistry