在尝试更新多对多关系表时,使用typeorm。它已成功更新,但关系映射表数据已清除。
我做错什么了吗
var parentTableRepo = createConnection().getRepoistory('parentTable');
var parentTable = {
id: 1,
name: 'xyz',
Childs: {
id: 2,
name: 'abc'
}
}
parentTableRepo.save(parentTable); //saves successfully
// the mapping table parentTable_childTable data is cleared. which has the parentTable id and child Table id.