Lately, I had the chance to introduce Nest.js to an existing Nx monorepo.
To fit in with the rest of the microservices, I used MongoDB as a database.
When using MongoDB with Nest.js, we can decide between TypeORM and Mongoose, both having a great Nest.js integration by their core team.
I chose Mongoose. Here’s why:
Now I still had the question open about which architecture I should use for the Nest.js-Mongoose integration. In the next blog post I’ll explain why I ended up using the repository pattern, even though Mongoose is a full-fledged ORM (ODM).