Registry / database / db-migrate-mongodb-nesto-fork

db-migrate-mongodb-nesto-fork

JSON →
library2.0.3jsnpmunverified

A MongoDB driver for db-migrate, a database migration framework for Node.js. This fork (v2.0.3) updates MongoDB dependencies to support replica sets using SRV records, which is not available in the original driver. Use this driver to define and run up/down migrations against MongoDB databases, with support for connection URIs, SSL, and authentication. The package is stable but maintained as a fork; expect differences from the original driver in MongoDB driver version and feature compatibility.

npm install db-migrate-mongodb-nesto-fork
INSTALL
IMPORT
SIG · DB-MIGRATE-MONGODB
D
db-migrate-mongodb-nesto-fork
databasejavascriptv2.0.3
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.

MongodbDriver
import MongodbDriver from 'db-migrate-mongodb-nesto-fork'
const MongodbDriver = require('db-migrate-mongodb-nesto-fork')
Default import exports the driver class; also works with require if using CJS.
connect
import { connect } from 'db-migrate-mongodb-nesto-fork'
const { connect } = require('db-migrate-mongodb-nesto-fork')
Named export for establishing connection; available as both CJS and ESM.
internal
import { internal } from 'db-migrate-mongodb-nesto-fork'
import internal from 'db-migrate-mongodb-nesto-fork'
Internal utilities are exported as a named export, not default.

Shows how to instantiate the MongoDB driver with an SRV connection URI and run a migration.

import MongodbDriver from 'db-migrate-mongodb-nesto-fork'; const driver = new MongodbDriver({ uri: 'mongodb+srv://user:password@cluster.mongodb.net/mydb?retryWrites=true&w=majority', ssl: true, connectTimeoutMS: 30000 }); // Run migrations await driver.createMigrationTable(); await driver.runMigration('my-migration', 'up'); console.log('Migration complete');
Debug
Known issues
breakingMongoDB driver dependency was updated to support SRV records; existing connections using non-SRV URIs may break if your MongoDB server requires SRV.
fix
Use SRV connection string format (mongodb+srv://) or check MongoDB server compatibility.
affects: >=2.0.0
deprecatedThe original db-migrate-mongodb package does not support SRV; this fork replaces it.
fix
Replace 'db-migrate-mongodb' with 'db-migrate-mongodb-nesto-fork' in package.json.
affects: >=2.0.0
gotchaDriver expects the db-migrate base package to be installed as a peer dependency.
fix
Ensure 'db-migrate' is in your dependencies: npm install db-migrate
affects: >=2.0.0
gotchaThe fork is published under a different npm scope; typo in package name can cause installation of the original driver.
fix
Double-check package name: db-migrate-mongodb-nesto-fork (not 'db-migrate-mongodb').
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'mongodb'
Missing peer dependency 'mongodb'
fix
npm install mongodb
TypeError: driver.createMigrationTable is not a function
Incorrect instantiation – driver is not initialized with 'new'
fix
Use 'new MongodbDriver(options)' instead of calling MongodbDriver(options) as a function.
MongoParseError: Invalid connection string
Connection string does not use 'mongodb+srv://' for SRV records
fix
Update URI to 'mongodb+srv://...' format if using SRV.
Upgrade
Version history
2.0.3latest on npm
Audit
Dependencies
mongodbrequiredMongoDB Node.js driver for database connectivity
Agent activity
11 hits · last 30 days
node
10
Resources
db-migrate-mongodb-nesto-fork — npm install db-migrate-mongodb-nesto-fork · libregistry