Registry / database / mongodb-wrapper

mongodb-wrapper

JSON →
library1.0.3jsnpmunverified

An unofficial wrapper around the MongoDB Node.js driver that provides a console-like API for CRUD operations. Version 1.0.3 is the latest stable release, though the package is effectively abandoned (no updates since 2012). It wraps node-mongodb-native but introduces a non-standard API surface that does not follow modern best practices. Notably, it does not support promises or async/await and is not compatible with MongoDB 3.x+ drivers. For modern projects, use the official mongodb package or mongoose.

npm install mongodb-wrapper
INSTALL
IMPORT
SIG · MONGODB-WRAPPER
M
mongodb-wrapper
databasejavascriptv1.0.3
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.

require('mongodb-wrapper')
var mongo = require('mongodb-wrapper');
import mongo from 'mongodb-wrapper';
Only supports CommonJS; no ESM support.

Initializes a database connection and performs a query and insert using the console-like API.

var mongo = require('mongodb-wrapper'); var db = mongo('localhost:27017/test'); db.users.find({ name: 'John' }, function(err, users) { if (err) throw err; console.log(users); }); db.users.insert({ name: 'Jane' }, function(err, doc) { if (err) throw err; console.log('Inserted:', doc); });
Debug
Known issues
breakingThis package is abandoned and incompatible with modern MongoDB drivers (3.x+). Do not use in new projects.
fix
Use the official 'mongodb' package or an ORM like Mongoose.
affects: >=0.6.0
deprecatedCallbacks are used instead of promises; no async/await support.
fix
Migrate to promise-based drivers with async/await.
affects: >=1.0.0
gotchaThe API does not follow the standard MongoDB driver conventions (e.g., find returns an array directly, not a cursor).
fix
Consult the documentation for the non-standard API.
affects: all
Errors
Common errors & fixes
Cannot find module 'mongodb-wrapper'
Package not installed or requires native build.
fix
Run 'npm install mongodb-wrapper'. Note: requires node-gyp for native dependencies.
Error: connect ECONNREFUSED
MongoDB server not running or wrong host/port.
fix
Ensure MongoDB is running on the specified host and port.
Upgrade
Version history
1.0.3latest on npm
Audit
Dependencies
mongodbrequiredCore dependency; wrapper around the native MongoDB driver.
Agent activity
2 hits · last 30 days
node
2
Resources