Search code examples
monoreponrwl-nx

How to setup mongo-migrate-ts with nx workspace


I've created nx workspace with nest.js application. I would like to add mongo-migrate-ts support which normally was started by "ts-node migrations/index.ts up" as script in packages.json. In my nx project, when I try to add script in global package.json, it says that "ts" extension is unrecognized.


Solution

  • There is a typescript rewrite of the original migrate mongo, much like mongo-migrate-ts, but this one is in the form of a nx plug-in. It will work a lot better for your needs if you are using nx. It is called nx-mongo-migrate. Give it a shot!