Registry / database / mongover

mongover

JSON →
library2.1.1jsnpmunverified

MongoDB database migration and seeding tool for Node.js (v2.1.1, stable). Provides both programmatic API and CLI for applying schema changes and seed data. Differentiates with support for multiple databases, collection-specific migrations, and force migration options. Ship TypeScript declarations. Alternative to migrate-mongo with simpler configuration.

npm install mongover
INSTALL
IMPORT
SIG · MONGOVER
M
mongover
databasejavascriptv2.1.1
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.

apply
import { apply } from 'mongover';
const apply = require('mongover').apply;
ESM import (since v2) or CJS destructure. Default export is not available.
MongoverOptions
import { MongoverOptions } from 'mongover';
Type import for TypeScript. Not available as a runtime value.
default (CommonJS)
const { apply } = require('mongover');
const mongover = require('mongover'); mongover.apply();
CommonJS: must destructure. No default export.

Connects to MongoDB and applies all migration and seed scripts from the specPath directory.

import { apply } from 'mongover'; const options = { specPath: './database', uri: process.env.MONGO_URI ?? 'mongodb://127.0.0.1:27017/', dbs: [], alias: [], collections: [], seedOnly: false, migrateForce: false, info: '_info', socketTimeoutMS: 3600000, }; await apply(options); console.log('Migration applied successfully.');
Debug
Known issues
deprecatedMongover v1 had a different import path: require('mongover').Mongover vs v2's require('mongover').apply.
fix
Update imports to use { apply } from 'mongover'.
affects: <2.0.0
gotchaThe 'dbs' option is case-sensitive; database names must match exactly as in the spec folder.
fix
Verify database folder names in specPath match the 'dbs' array entries.
affects: >=2.0.0
gotchaIf 'seedOnly' is true, migrations are skipped entirely; only seed data is applied.
fix
Set seedOnly: false to run migrations before seeding.
affects: >=2.0.0
breakingMongover v2 dropped support for Node.js <10. Minimum Node.js version is 10.
fix
Upgrade Node.js to version 10 or later.
affects: >=2.0.0 <2.1.0
Errors
Common errors & fixes
TypeError: apply is not a function
Default import used instead of named import.
fix
Use import { apply } from 'mongover'; or const { apply } = require('mongover');
MongoError: Authentication failed.
MongoDB URI missing credentials or incorrect authSource.
fix
Include username/password in uri, e.g., mongodb://user:pass@host:27017/?authSource=admin
ENOENT: no such file or directory, scandir './database'
specPath directory does not exist or relative path is wrong.
fix
Ensure the specPath folder exists (create with 'mongover init') or provide absolute path.
Upgrade
Version history
2.1.1latest on npm
Audit
Dependencies
mongodbrequiredMongoDB driver for database operations
Agent activity
9 hits · last 30 days
node
8
Resources
mongover — npm install mongover · libregistry