Put in order · NestJS course · Module 3: TypeORM and Databases

Building a QueryBuilder query

Arrange the QueryBuilder query elements from first to last:

Items to put in order

  • .getMany() - execute the query
  • .orderBy('alias.field', 'ASC') - sorting
  • .where('alias.field = :value', { value }) - conditions
  • .createQueryBuilder('alias') - start

You can check the correct answer by solving this task in the CodeWorlds game.