NestJS

10 min read

Virtual Column solutions for TypeORM

If you are an experienced Node.js developer and use the TypeORM library in your project, you must have encountered the problem of creating a virtual field in the data model. We need this field in order to be able to return an additional result in the response, but we don't want to store it directly in the database. What you are most likely looking for should be named .addSelectAndMap(), @VirtualColumn() or Computed Column decorator.