The current codebase uses direct MongoDB/mongoose queries like ‘findOne’ etc to query the database.
In future, we want to migrate to Postgres so we need to migrate the codebase to use repository pattern for all data access on the application layer.
We have ‘packages/orm-models’ which contains mongoose models so all the repositories should be created there and used across the app from that package (just like how mongoose models are accessed).
The current codebase uses direct MongoDB/mongoose queries like ‘findOne’ etc to query the database.
In future, we want to migrate to Postgres so we need to migrate the codebase to use repository pattern for all data access on the application layer.
We have ‘packages/orm-models’ which contains mongoose models so all the repositories should be created there and used across the app from that package (just like how mongoose models are accessed).