Question · NestJS course · Module 3: TypeORM and Databases

The find method with options

How do you find all legionaries with the rank 'Centurion' using a TypeORM repository?

Answer options

  • this.repo.find({ rank: 'Centurion' })
  • this.repo.query('rank = Centurion')
  • this.repo.findBy('rank', 'Centurion')
  • this.repo.find({ where: { rank: 'Centurion' } })

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