Registry / database / free-be-mongodb

free-be-mongodb

JSON →
library0.0.11jsnpmunverified

The built-in MongoDB (Mongoose) driver module for FreeEIS, an enterprise-level unified development framework. Version 0.0.11. It provides database operations using Mongoose, integrated with FreeEIS's modular architecture. It is a backend module that can be loaded automatically by the FreeEIS core, handling MongoDB connections and data models. It is designed to work with ExpressJS and NodeJS, offering a seamless development experience for FreeEIS projects. The module is part of a larger ecosystem that includes frontend and backend core modules, making it easy to build scalable enterprise applications.

npm install free-be-mongodb
INSTALL
IMPORT
SIG · FREE-BE-MONGODB
F
free-be-mongodb
databasejavascriptv0.0.11
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.

default
import freeBeMongodb from 'free-be-mongodb'
const freeBeMongodb = require('free-be-mongodb')
ESM module. Default export is an object with methods like connect and getConnection.
connect
import { connect } from 'free-be-mongodb'
const { connect } = require('free-be-mongodb')
Named export for connecting to MongoDB.
getConnection
import { getConnection } from 'free-be-mongodb'
Named export to get the current Mongoose connection instance.

Connects to MongoDB using the free-be-mongodb connect function with URI from environment variable.

import { connect } from 'free-be-mongodb'; async function start() { await connect({ uri: process.env.MONGO_URI ?? 'mongodb://localhost:27017/mydb', options: { useNewUrlParser: true, useUnifiedTopology: true } }); console.log('Connected to MongoDB'); } start();
Debug
Known issues
gotchaModule assumes FreeEIS core is loaded; standalone use may require additional setup.
fix
Ensure free-be-core is also installed and loaded before free-be-mongodb.
affects: >=0.0.0
deprecatedDefault options like useNewUrlParser and useUnifiedTopology are deprecated in Mongoose 6+.
fix
Remove deprecated options; Mongoose 6+ enables them by default.
affects: >=0.0.0
gotchaVersion 0.0.11 is pre-1.0.0; breaking changes may occur with minor bumps.
fix
Pin exact version in package.json to avoid unexpected changes.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'free-be-mongodb'
Module not installed or not in node_modules.
fix
Run 'npm install free-be-mongodb' or 'yarn add free-be-mongodb'.
MongooseError: The `uri` parameter to `openUri()` must be a string, got "undefined"
Missing or undefined MONGO_URI environment variable.
fix
Set MONGO_URI environment variable or pass a valid URI string to connect.
Upgrade
Version history
0.0.11latest on npm
Audit
Dependencies
mongooserequiredUsed for MongoDB object modeling and database operations
Agent activity
4 hits · last 30 days
node
4
Resources
free-be-mongodb — npm install free-be-mongodb · libregistry