Registry / database / mongodb-minimal

mongodb-minimal

JSON →
library2016.12.28jsnpmunverified

A zero-dependency repackaging of the official MongoDB driver v2.2.16 for Node.js. Originally published in 2016, this package is archived and no longer maintained. It was created to strip out dependencies from the mongodb npm package, but it lags far behind the official driver (current major version is 6) and lacks security updates, modern features like transactions, and TypeScript types. Not recommended for new projects; use the official mongodb or mongoose package instead.

npm install mongodb-minimal
INSTALL
IMPORT
SIG · MONGODB-MINIMAL
M
mongodb-minimal
databasejavascriptv2016.12.28
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.

MongoClient
const MongoClient = require('mongodb-minimal').MongoClient
import { MongoClient } from 'mongodb-minimal'
Package uses CommonJS; ES module import is not supported. Use require().
default
const mongodb = require('mongodb-minimal')
Default export is an object containing MongoDB classes like MongoClient, Db, Collection.
ObjectID
const ObjectID = require('mongodb-minimal').ObjectID
import { ObjectID } from 'mongodb-minimal'
ObjectID is a named export; must use destructuring from require.

Connect to a MongoDB instance, insert a document, and close the connection using the legacy callback pattern.

const { MongoClient } = require('mongodb-minimal'); const url = process.env.MONGODB_URI || 'mongodb://localhost:27017'; MongoClient.connect(url, function(err, client) { if (err) throw err; const db = client.db('test'); const collection = db.collection('documents'); collection.insertOne({ a: 1 }, function(err, result) { console.log('Inserted', result.insertedId); client.close(); }); });
Debug
Known issues
deprecatedmongodb-minimal is based on mongodb v2.2.16 which is EOL and contains known security vulnerabilities.
fix
Migrate to the official mongodb package (v3+ for drivers, v6+ recommended).
affects: <=2016.12.28
gotchaPackage lacks promises; all operations use callbacks. No async/await support.
fix
Wrap in a Promise or use a library like `bluebird` to promisify. Prefer mongodb v3+ which supports promises.
affects: all
gotchaNo TypeScript definitions. Requires manual type hints or @types/mongodb (not compatible).
fix
Use official mongodb package which ships type definitions.
affects: all
gotchaThis package is not actively maintained. Last publish was in 2016. No security patches applied.
fix
Switch to the maintained mongodb npm package.
affects: all
Errors
Common errors & fixes
Cannot find module 'mongodb-minimal'
Package not installed or spelled incorrectly.
fix
Run `npm install mongodb-minimal` and ensure the module name is correct.
MongoError: connect ECONNREFUSED 127.0.0.1:27017
MongoDB server not running on localhost.
fix
Start MongoDB service: `mongod --dbpath /data/db`.
TypeError: MongoClient.connect is not a function
Incorrect import style; likely using ES6 import.
fix
Use `const { MongoClient } = require('mongodb-minimal');` instead of `import`.
Upgrade
Version history
2016.12.28latest on npm
Audit
Dependencies
mongodbrequiredThis package is a derivative of mongodb v2.2.16, but the underlying driver is outdated.
Agent activity
7 hits · last 30 days
node
6
Resources
mongodb-minimal — npm install mongodb-minimal · libregistry