Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

typeorm query builder update relations filed

const res = await connection
	.getRepository(Projects)
	.createQueryBuilder('projects')
	.leftJoinAndSelect('projects.telemarketing', 'telemarketings')
	.where('projects.id = :projectId AND telemarketings.id NOT IN (:...terlemarketingId)', { projectId: 236, terlemarketingId: [3, 4] })
	.getOne()

res.telemarketing.id = 1
await connection.getRepository(Projects).save(res)
 
PREVIOUS NEXT
Tagged: #typeorm #query #builder #update #relations #filed
ADD COMMENT
Topic
Name
2+8 =