east-mongo is an adapter for the `east` Node.js database migration tool, specifically designed for MongoDB. It leverages the official `mongodb` native driver (peer dependency on versions 2.x.x or 3.x.x) to manage schema changes and data migrations. When migrations are executed, their names are recorded in a `_migrations` collection within the target database. The adapter provides helper functions like `dropIndexIfExists` and includes template options for promises-based or async/await migrations. This package, currently at version 1.0.0, appears to be abandoned, with no releases or significant activity since 2017, meaning it is not actively maintained and may have unpatched vulnerabilities or compatibility issues with modern MongoDB versions or Node.js runtimes. Its primary function is to provide the `db` instance from the native driver to migration scripts.
npm install east-mongoVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to configure `east-mongo` in an `.eastrc` file and provides a basic migration example using async/await functions for creating a collection, adding an index, inserting data, and a corresponding rollback function.
Ensure that `east` is installed at version >=1.0.0 and `mongodb` is installed at 2.x.x or 3.x.x (`npm install east@^1 east-mongo mongodb@^3`). For newer `mongodb` or `east` versions, consider using an alternative, more modern migration solution.
It is strongly recommended to find an alternative, actively maintained MongoDB migration tool. Continuing to use an abandoned package introduces significant security and stability risks to your application.
If you must use `east-mongo`, run it in a Node.js 4.x, 6.x, or 8.x environment. For modern applications, migrate to an actively maintained migration tool compatible with current Node.js LTS releases.
Conduct a thorough security audit of your dependencies and codebase if using `east-mongo`. Prioritize migrating to a secure, actively maintained alternative to mitigate potential exploits.
Install the peer dependency: `npm install mongodb@^3` (or `mongodb@^2` if preferred) in your project.
Ensure 'east-mongo' is installed (`npm install east-mongo`) and that your `.eastrc` has `"adapter": "east-mongo"`.
Verify your MongoDB connection URL and options in `.eastrc`. Ensure the MongoDB server is running and accessible. Consider adding more robust error handling and connection retry logic in your migration scripts, though the underlying driver version may be a limiting factor.