How to Handle MongoDB Transactions on your Local Server

Until version 4, MongoDB lacked the ability to carry out ACID transactions. ACID transactions enable database operations (creating, reading, updating and deleting data) to be more resilient and dependable. This is necessary especially in finance-related applications that have to do with transferring money among users. What is ACID? ACID is an acronymn for Atomicity, Consistency, Isolation and Durability. When a database transaction (a group of CRUD operations on a database) is said to be ACID, it means that the database is always left in a valid state even in the event of unexpected errors that occur during the transaction....

February 16, 2023 · 4 min · Orim Dominic Adah
NestJS Integration Testing with TypeORM and MongoDB

Write Integration Tests with NestJS, TypeORM and MongoDB

NestJS projects that use TypeORM with MongoDB are rare. The recommended ODM1 to use with MongoDB is Mongoose, but the choice is not always within our control. This article is a guide for writing integration tests in a NestJS project that uses TypeORM with MongoDB. Integration tests verify that all units required to accomplish a particular goal work together as expected. For integration tests in a backend application, database calls are not mocked....

April 7, 2022 · 5 min · Orim Dominic Adah