AU
Size: a a a
AU
AU
AU
IK
return from(
this.repository
.createQueryBuilder()
.insert()
.values(newItems)
.onConflict(`("name") DO NOTHING`)
.execute()
).pipe(
from(this.repository.find({ relations: ['table1', 'table2'] })),
flatMap(existsItems =>
forkJoin(
newItems.map(newItem => {
const existsItem = existsItems.find({ name: newItem.name });
if (!existsItem){
return of(null);
}
return from(this.repository.save(
this.repository.merge(existsItem,newItem)
);
})
)
)
),
take(1)
);
IK
AU
IK
AU
AU
BK
constructor(data: Partial<BaseEntity>) {
Object.assign(this, data);
}AK
LM

AU
modelRepo = getRepository(Question);
AU
AK