问题描述
根据:https://github.com/typeorm/typeorm/blob/master/docs/find-options.md#advanced-options
我和数据库中的人员Person具有first_name以及与其他表的某些关系。
我发现我可以查询:
const result = await prep.find({first_name: Like("%out%")})
我也可以查询:
const result = await prep.find({relations: ['user','belong_organization']})
但是当我查询时:
const result = await prep.find({first_name: Like("%out%"),relations: ['user','belong_organization']})
将会忽略我的名字条件,今天如何进行查询和联系?
解决方法
const result = await prep.find({ where: { first_name: Like("%out%") },relations: ['user','belong_organization'] })
完整的查找选项示例已在https://github.com/typeorm/typeorm/blob/master/docs/find-options.md#advanced-options上显示