typeorm-activerecord

How to select a specific column in typeorm many to many relationship

倖福魔咒の 提交于 2021-02-11 15:34:21
问题 I have an n:m relationship with a custom join table in TYPEORM. Entity1 @Entity({ name: 'users' }) export class User extends BaseModel { @PrimaryGeneratedColumn() id!: number; @Column({ type: 'varchar', length: 50 }) @IsNotEmpty() username!: string; @Column({ unique: true, type: 'varchar', length: 50 }) @IsEmail() @IsNotEmpty() email!: string; @CreateDateColumn({ type: 'timestamp' }) createdAt!: Date; @UpdateDateColumn({ type: 'timestamp' }) updatedAt!: Date; @DeleteDateColumn({ type:

How to select a specific column in typeorm many to many relationship

喜夏-厌秋 提交于 2021-02-11 15:33:37
问题 I have an n:m relationship with a custom join table in TYPEORM. Entity1 @Entity({ name: 'users' }) export class User extends BaseModel { @PrimaryGeneratedColumn() id!: number; @Column({ type: 'varchar', length: 50 }) @IsNotEmpty() username!: string; @Column({ unique: true, type: 'varchar', length: 50 }) @IsEmail() @IsNotEmpty() email!: string; @CreateDateColumn({ type: 'timestamp' }) createdAt!: Date; @UpdateDateColumn({ type: 'timestamp' }) updatedAt!: Date; @DeleteDateColumn({ type:

How to select a specific column in typeorm many to many relationship

℡╲_俬逩灬. 提交于 2021-02-11 15:33:18
问题 I have an n:m relationship with a custom join table in TYPEORM. Entity1 @Entity({ name: 'users' }) export class User extends BaseModel { @PrimaryGeneratedColumn() id!: number; @Column({ type: 'varchar', length: 50 }) @IsNotEmpty() username!: string; @Column({ unique: true, type: 'varchar', length: 50 }) @IsEmail() @IsNotEmpty() email!: string; @CreateDateColumn({ type: 'timestamp' }) createdAt!: Date; @UpdateDateColumn({ type: 'timestamp' }) updatedAt!: Date; @DeleteDateColumn({ type: