Registry / database / jovo-db-mongodb

jovo-db-mongodb

JSON →
library3.6.2jsnpmunverified

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.

npm install jovo-db-mongodb
INSTALL
IMPORT
SIG · JOVO-DB-MONGODB
J
jovo-db-mongodb
databasejavascriptv3.6.2
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.

MongoDb
import { MongoDb } from 'jovo-db-mongodb';
const MongoDb = require('jovo-db-mongodb');
TypeScript and ES modules use named import. CommonJS users must destructure: const { MongoDb } = require('jovo-db-mongodb');
MongoDbConfig
import type { MongoDbConfig } from 'jovo-db-mongodb';
import { MongoDbConfig } from 'jovo-db-mongodb';
TypeScript type import only, not a runtime value.

Shows basic setup: importing MongoDb class, adding it to the app, and configuring database name, collection, and URI.

// app.ts import { App } from 'jovotools-framework'; import { MongoDb } from 'jovo-db-mongodb'; const app = new App({ /* config */ }); app.use(new MongoDb()); // config.ts const config = { db: { MongoDb: { databaseName: 'myApp', collectionName: 'UserData', uri: process.env.MONGO_URI ?? 'mongodb://localhost:27017', }, }, }; export { app, config };
Debug
Known issues
gotchaAWS Lambda connection timeout: The MongoDB connection holds the event loop, causing Lambda to timeout before responding.
fix
Set context.callbackWaitsForEmptyEventLoop = false in the Lambda handler.
affects: >=1.0.0
gotchaMongoDB Atlas connection refused: Client fails to connect if the IP is not whitelisted.
fix
Add the deployment's IP address to the Atlas Network Access whitelist.
affects: >=1.0.0
deprecatedThis package is part of Jovo v3 which is superseded by Jovo v4.
fix
Migrate to Jovo v4 and use its built-in database integrations or a different MongoDB adapter.
affects: >=3.0.0 <4.0.0
gotchaConfiguration key mismatch: Using incorrect casing for 'MongoDb' in config (e.g., 'mongodb' or 'MongoDB').
fix
Ensure the config key is exactly 'MongoDb' with capital M and D.
affects: >=3.0.0
breakingRemoved default export: In early v3 versions, a default export existed. It was removed, breaking require/import without destructuring.
fix
Use named import { MongoDb } instead of default import.
affects: >=3.0.0
Errors
Common errors & fixes
Error: Cannot find module 'jovo-db-mongodb'
Package not installed or wrong import path.
fix
Run 'npm install jovo-db-mongodb' and verify node_modules.
TypeError: jovo_dn_db_mongodb_1.default is not a constructor
Using default import without destructuring.
fix
Use { MongoDb } named import: import { MongoDb } from 'jovo-db-mongodb';
MongoNetworkError: connection 0 to ... closed
Network issue or MongoDB server not accessible.
fix
Check MongoDB URI, network connectivity, and firewall/whitelist settings.
MongoTimeoutError: Server selection timed out after 30000 ms
MongoDB server unreachable or slow network.
fix
Increase timeout in libraryConfig or verify server is running and reachable.
Error: CallbackWaitsForEmptyEventLoop is not a function
Using context.callbackWaitsForEmptyEventLoop incorrectly outside Lambda.
fix
This setting only applies to AWS Lambda handler; do not use it in other environments.
Upgrade
Version history
3.6.2latest on npm
Audit
Dependencies
jovo-corerequiredCore Jovo framework required for integration
mongodboptionalMongoDB driver for database operations
Agent activity
4 hits · last 30 days
node
4
Resources
jovo-db-mongodb — npm install jovo-db-mongodb · libregistry