Question · NestJS course · Module 3: TypeORM and Databases
Unique constraint
How do you mark a column as unique in a TypeORM entity?
Answer options
- @Column({ primary: true })
- @Column({ unique: true })
- @Column({ distinct: true })
- @Column({ single: true })
You can check the correct answer by solving this task in the CodeWorlds game.