{"id":41635,"library":"npm.mongo","title":"npm.mongo","description":"npm.mongo is a beginner-friendly MongoDB wrapper for Node.js, designed as a key-value store with an API similar to quick.db. Version 3.0.8 (stable) provides asynchronous operations, dot notation support, and multiple model support. It simplifies MongoDB for novices but lacks TypeScript types, has limited community traction, and is primarily used in Discord bot development. Compared to Mongoose or native MongoDB driver, it sacrifices flexibility for simplicity.","status":"active","version":"3.0.8","language":"javascript","source_language":"en","source_url":"https://github.com/Bayrakdev/npm.mongo","tags":["javascript","mongo","mongoose","quickmongo","npm.db","quick.db","discord","bot","djs"],"install":[{"cmd":"npm install npm.mongo","lang":"bash","label":"npm"},{"cmd":"yarn add npm.mongo","lang":"bash","label":"yarn"},{"cmd":"pnpm add npm.mongo","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Mongoose is the underlying MongoDB ODM that npm.mongo wraps; required at runtime.","package":"mongoose","optional":false}],"imports":[{"note":"This package does not support ESM import syntax. Use CommonJS require().","wrong":"import { Database } from 'npm.mongo';","symbol":"Database","correct":"const { Database } = require('npm.mongo');"},{"note":"Destructured require is the correct pattern as the package exports an object with Database.","wrong":"const Database = require('npm.mongo').Database;","symbol":"Database","correct":"const { Database } = require('npm.mongo');"},{"note":"A MongoDB connection URI is required in the constructor; omitting it will cause a connection error.","wrong":"const db = new Database();","symbol":"new Database()","correct":"const db = new Database('mongodb://localhost/npm.mongo');"}],"quickstart":{"code":"const { Database } = require('npm.mongo');\nconst db = new Database('mongodb://localhost/npm.mongo');\n\ndb.on('ready', async () => {\n  console.log('Database connected!');\n  await db.set('foo', 'bar');\n  const value = await db.get('foo');\n  console.log(value); // 'bar'\n  process.exit(0);\n});","lang":"javascript","description":"Shows how to connect to MongoDB, set a key-value pair, and retrieve it asynchronously using the Database class."},"warnings":[{"fix":"Pass a valid MongoDB URI string to new Database(uri).","message":"Constructor now requires a MongoDB connection URI; previous versions may have worked with an empty constructor.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Use await or .then() on methods like set(), get(), push(), add().","message":"All Database methods return Promises; forgetting to await can lead to race conditions.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use require() instead of import.","message":"The package does not export as ESM; using import will break.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Consider using the original quick.db or mongodb driver for better maintenance.","message":"The package appears to be a personal fork of quick.db functionality with limited updates.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'3.0.8':26 'api':21 'asynchron':29 'beginn':6 'beginner-friend':5 'bot':57,78 'communiti':49 'compar':59 'design':12 'develop':58 'discord':56,77 'djs':79 'dot':31 'driver':65 'flexibl':68 'friend':7 'javascript':71 'key':16 'key-valu':15 'lack':44 'limit':48 'model':36 'mongo':72 'mongodb':8,40,64 'mongoos':61,73 'multipl':35 'nativ':63 'node.js':11 'notat':32 'novic':42 'npm.db':75 'npm.mongo':1,2 'oper':30 'primarili':53 'provid':28 'quick.db':24,76 'quickmongo':74 'sacrific':67 'similar':22 'simplic':70 'simplifi':39 'stabl':27 'store':18 'support':33,37 'traction':50 'type':46 'typescript':45 'use':54 'valu':17 'version':25 'wrapper':9","created_at":"2026-06-04T18:53:21.999863+00:00","updated_at":"2026-06-04T18:53:21.999863+00:00","problems":[{"fix":"Run npm install npm.mongo and ensure the require path is 'npm.mongo'.","cause":"Package not installed or module path incorrect.","error":"TypeError: Cannot destructure property 'Database' of 'require(...)' as it is undefined."},{"fix":"Provide a valid MongoDB connection string: const db = new Database('mongodb://localhost:27017/mydb');","cause":"Database constructor called without a MongoDB URI.","error":"MongooseError: The uri parameter to openUri() must be a string, got 'undefined'"},{"fix":"Ensure you have const { Database } = require('npm.mongo'); and const db = new Database(uri);","cause":"Forgot to instantiate Database or used wrong import pattern.","error":"TypeError: db.set is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/Bayrakdev/npm.mongo#readme","github":"https://github.com/Bayrakdev/npm.mongo","docs":null,"changelog":null,"pypi":null,"npm":"npm.mongo","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}