Registry / database / dynamodb-mongodb-migrate

dynamodb-mongodb-migrate

JSON →
library0.9.4jsnpmunverified

Data migration module for transferring DynamoDB tables to MongoDB collections. Current stable version: 0.9.4. Provides simple job-based migration with support for DynamoDB filter expressions, data filtering, and mapping functions. Key differentiators: lightweight, explicit throughput control via `DYNAMODB_READ_THROUGHPUT`, and support for both filter expressions and post-scan filters. Primarily used for one-off migrations, not incremental sync. Note: project is in early development with limited maintenance activity.

npm install dynamodb-mongodb-migrate
INSTALL
IMPORT
SIG · DYNAMODB-MONGODB-M
D
dynamodb-mongodb-migrate
databasejavascriptv0.9.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.

MigrationJob
const MigrationJob = require('dynamodb-mongodb-migrate');
const { MigrationJob } = require('dynamodb-mongodb-migrate');
Package exports a single constructor function as default. Destructuring will not work.
MigrationJob (ESM)
import MigrationJob from 'dynamodb-mongodb-migrate';
import { MigrationJob } from 'dynamodb-mongodb-migrate';
No ESM support; use CommonJS with require().

Shows basic initialization and run of a migration job from DynamoDB table to MongoDB collection.

const MigrationJob = require('dynamodb-mongodb-migrate'); const sourceOptions = { region: 'us-east-1', accessKeyId: process.env.AWS_ACCESS_KEY_ID ?? '', secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY ?? '' }; const targetOptions = { host: 'mongodb://localhost:27017', user: '', password: '' }; const job = new MigrationJob('my-table', 'my-collection', 'my-db', sourceOptions, targetOptions, 1000, 5); job.run().then(() => console.log('Migration complete')).catch(console.error);
Debug
Known issues
breakingConstructor signature changed: parameters must be passed in exact order (table, collection, db, sourceOpts, targetOpts, scanLimit, readThroughput). Omitting arguments will cause runtime errors.
fix
Ensure all 7 arguments are provided. Check documentation for parameter order.
affects: >=0.0.1
deprecatedThe `setFilterFunction` and `setMapperFunction` methods are deprecated in favor of filter expressions.
fix
Use `setSourcefilterExpression` with ExpressionAttributeNames and ExpressionAttributeValues.
affects: >=0.9.0
gotchaThe `DYNAMODB_READ_THROUGHPUT` parameter can cause throttling if set too high; default is 5 units.
fix
Set to a value that matches your DynamoDB table's provisioned throughput. Use 1-10 for small tables.
affects: >=0.0.1
gotchaTarget MongoDB collection must exist beforehand; migration does not create it automatically.
fix
Create the MongoDB collection manually before running migration.
affects: >=0.0.1
Errors
Common errors & fixes
Cannot find module 'dynamodb-mongodb-migrate'
Package not installed or used without proper require.
fix
Run `npm install dynamodb-mongodb-migrate` and ensure import path is correct.
TypeError: MigrationJob is not a constructor
Destructured import instead of default import.
fix
Use `const MigrationJob = require('dynamodb-mongodb-migrate');`
The provided filter expression is not valid
Syntax error in DynamoDB filter expression or missing attribute names/values.
fix
Verify ExpressionAttributeNames and ExpressionAttributeValues match the filter expression placeholders.
Upgrade
Version history
0.9.4latest on npm
Audit
Dependencies
aws-sdkrequiredConnects to DynamoDB and performs scan operations.
mongodbrequiredConnects to MongoDB and performs insert operations.
Agent activity
7 hits · last 30 days
node
6
Resources
dynamodb-mongodb-migrate — npm install dynamodb-mongodb-migrate · libregistry