在TypeORM中有没有左连接JSON函数?我正在尝试做一些类似于下面的事情:
.leftJoin(`json_array_elements ((v1.profile -> 'associatedProfiles') :: json)`, 'ap', 'true')
但这会导致类似如下的查询:
LEFT JOIN "json_array_elements ((v1"."profile -> 'associatedProfiles') :: json)" "ap" ON true
并失败并返回错误:
error: relation "json_array_elements ((v1.profile -> 'associatedProfiles') :: json)" does not exist
看起来TypeORM似乎在限制我的左连接。相反,我真正需要的是
LEFT JOIN json_array_elements ((v1.profile -> 'associatedProfiles') :: json) ap ON true
对于如何解决/克服这个问题,有什么建议吗?谢谢你的帮助。
发布于 2020-09-17 23:18:07
您可以使用以下命令完成此操作
.leftJoinAndMapMany()
或
leftJoinAndMapOne()
https://stackoverflow.com/questions/63169532
复制相似问题