{"id":42902,"library":"jovo-db-mongodb","title":"jovo-db-mongodb","description":"MongoDB database integration for Jovo v3 framework. Enables storing user-specific data for Alexa Skills and Google Actions in a MongoDB NoSQL database. Current version 3.6.2 (Jovo v3 ecosystem). Provides configuration for database name, collection, URI, and MongoClient options. Includes troubleshooting tips for AWS Lambda timeout (context.callbackWaitsForEmptyEventLoop) and MongoDB Atlas IP whitelisting. Alternative to built-in file-based or DynamoDB integrations. Ships TypeScript types. No peer dependencies required beyond Jovo core.","status":"active","version":"3.6.2","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","typescript"],"install":[{"cmd":"npm install jovo-db-mongodb","lang":"bash","label":"npm"},{"cmd":"yarn add jovo-db-mongodb","lang":"bash","label":"yarn"},{"cmd":"pnpm add jovo-db-mongodb","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core Jovo framework required for integration","package":"jovo-core","optional":false},{"reason":"MongoDB driver for database operations","package":"mongodb","optional":true}],"imports":[{"note":"TypeScript and ES modules use named import. CommonJS users must destructure: const { MongoDb } = require('jovo-db-mongodb');","wrong":"const MongoDb = require('jovo-db-mongodb');","symbol":"MongoDb","correct":"import { MongoDb } from 'jovo-db-mongodb';"},{"note":"TypeScript type import only, not a runtime value.","wrong":"import { MongoDbConfig } from 'jovo-db-mongodb';","symbol":"MongoDbConfig","correct":"import type { MongoDbConfig } from 'jovo-db-mongodb';"}],"quickstart":{"code":"// app.ts\nimport { App } from 'jovotools-framework';\nimport { MongoDb } from 'jovo-db-mongodb';\n\nconst app = new App({ /* config */ });\napp.use(new MongoDb());\n\n// config.ts\nconst config = {\n  db: {\n    MongoDb: {\n      databaseName: 'myApp',\n      collectionName: 'UserData',\n      uri: process.env.MONGO_URI ?? 'mongodb://localhost:27017',\n    },\n  },\n};\n\nexport { app, config };","lang":"typescript","description":"Shows basic setup: importing MongoDb class, adding it to the app, and configuring database name, collection, and URI."},"warnings":[{"fix":"Set context.callbackWaitsForEmptyEventLoop = false in the Lambda handler.","message":"AWS Lambda connection timeout: The MongoDB connection holds the event loop, causing Lambda to timeout before responding.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Add the deployment's IP address to the Atlas Network Access whitelist.","message":"MongoDB Atlas connection refused: Client fails to connect if the IP is not whitelisted.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Migrate to Jovo v4 and use its built-in database integrations or a different MongoDB adapter.","message":"This package is part of Jovo v3 which is superseded by Jovo v4.","severity":"deprecated","affected_versions":">=3.0.0 <4.0.0"},{"fix":"Ensure the config key is exactly 'MongoDb' with capital M and D.","message":"Configuration key mismatch: Using incorrect casing for 'MongoDb' in config (e.g., 'mongodb' or 'MongoDB').","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Use named import { MongoDb } instead of default import.","message":"Removed default export: In early v3 versions, a default export existed. It was removed, breaking require/import without destructuring.","severity":"breaking","affected_versions":">=3.0.0"}],"env_vars":null,"search_vec":"'3.6.2':31 'action':23 'alexa':19 'altern':58 'atlas':55 'aw':49 'base':65 'beyond':76 'built':61 'built-in':60 'collect':40 'configur':36 'context.callbackwaitsforemptyeventloop':52 'core':78 'current':29 'data':17 'databas':6,28,38 'db':3 'depend':74 'dynamodb':67 'ecosystem':34 'enabl':12 'file':64 'file-bas':63 'framework':11 'googl':22 'includ':45 'integr':7,68 'ip':56 'javascript':79 'jovo':2,9,32,77 'jovo-db-mongodb':1 'lambda':50 'mongocli':43 'mongodb':4,5,26,54 'name':39 'nosql':27 'option':44 'peer':73 'provid':35 'requir':75 'ship':69 'skill':20 'specif':16 'store':13 'timeout':51 'tip':47 'troubleshoot':46 'type':71 'typescript':70,80 'uri':41 'user':15 'user-specif':14 'v3':10,33 'version':30 'whitelist':57","created_at":"2026-06-05T16:57:13.470016+00:00","updated_at":"2026-06-05T16:57:13.470016+00:00","problems":[{"fix":"Run 'npm install jovo-db-mongodb' and verify node_modules.","cause":"Package not installed or wrong import path.","error":"Error: Cannot find module 'jovo-db-mongodb'"},{"fix":"Use { MongoDb } named import: import { MongoDb } from 'jovo-db-mongodb';","cause":"Using default import without destructuring.","error":"TypeError: jovo_dn_db_mongodb_1.default is not a constructor"},{"fix":"Check MongoDB URI, network connectivity, and firewall/whitelist settings.","cause":"Network issue or MongoDB server not accessible.","error":"MongoNetworkError: connection 0 to ... closed"},{"fix":"Increase timeout in libraryConfig or verify server is running and reachable.","cause":"MongoDB server unreachable or slow network.","error":"MongoTimeoutError: Server selection timed out after 30000 ms"},{"fix":"This setting only applies to AWS Lambda handler; do not use it in other environments.","cause":"Using context.callbackWaitsForEmptyEventLoop incorrectly outside Lambda.","error":"Error: CallbackWaitsForEmptyEventLoop 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":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"jovo-db-mongodb","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-05","next_check":"2026-09-03","install_tag":null}}