Registry / database / jollof-data-mongodb

jollof-data-mongodb

JSON →
library1.6.4jsnpmunverified

JollofJS data adapter for MongoDB, version 1.6.4. Provides MongoDB integration for the JollofJS framework with minimal configuration. The adapter wraps the MongoDB Node.js driver and offers a simple API for CRUD operations. It is designed for use within JollofJS applications and requires the jollof-data package. Release cadence is low, primarily maintenance updates.

npm install jollof-data-mongodb
INSTALL
IMPORT
SIG · JOLLOF-DATA-MONGOD
J
jollof-data-mongodb
databasejavascriptv1.6.4
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.

MongoAdapter
import { MongoAdapter } from 'jollof-data-mongodb'
const MongoAdapter = require('jollof-data-mongodb')
Package is ESM-only.
jollof-data-mongodb (default import)
import JollofDataMongo from 'jollof-data-mongodb'
Default export is the MongoAdapter class.

Connects to MongoDB using MongoAdapter, inserts and queries a document.

import { MongoAdapter } from 'jollof-data-mongodb'; const adapter = new MongoAdapter({ url: process.env.MONGO_URL ?? 'mongodb://localhost:27017', dbName: 'mydb' }); async function run() { const users = adapter.collection('users'); await users.insertOne({ name: 'Alice', age: 30 }); const result = await users.findOne({ name: 'Alice' }); console.log(result); } run().catch(console.error);
Debug
Known issues
breakingBreaking change in v1.5.0: Adapter constructor now requires an options object instead of individual arguments.
fix
Update instantiation to new MongoAdapter({ url, dbName }).
affects: <1.5.0
breakingBreaking change in v1.0.0: Switched from Callback to Promise-based API.
fix
Migrate callbacks to async/await or .then().
affects: <1.0.0
gotchaRequires jollof-data package to be installed and configured in the project.
fix
Ensure jollof-data is listed as a dependency and initialized before using this adapter.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'jollof-data'
Missing peer dependency jollof-data.
fix
Install jollof-data: npm install jollof-data
MongoAdapter is not a constructor
Default import used instead of named import.
fix
Use import JollofDataMongo from 'jollof-data-mongodb' or named import { MongoAdapter }.
Upgrade
Version history
1.6.4latest on npm
Audit
Dependencies
jollof-datarequiredCore dependency; this adapter extends the data layer of JollofJS.
Agent activity
4 hits · last 30 days
node
4
Resources
jollof-data-mongodb — npm install jollof-data-mongodb · libregistry