How can I switch between Mongo and Postgres using TypeORM with NestJS?

500 Views Asked by At

I have written my backend to use MongoDB but I would like to make the existing solution DB agnostic.

Is there an easier way to switch between Postgres and Mongo DB?

When trying to migrate to Postgres I had to manually comment out the ObjectID field (a mandatory primary key for MongoDB).

I would like to know if there is an easier way to define entities in TypeORM without having to manually comment out columns when migrating to different DB

0

There are 0 best solutions below