我想执行以下查询:
let query = EntityQuery.from("ResearchApplication")
.where("Deleted", FilterQueryOp.Equals, false)
.where("ResearchApplicationFiles.FileInformation", FilterQueryOp.Any, "Deleted", FilterQueryOp.Equals, false)
.expand("ResearchApplicationFiles")
.expand("ResearchApplicationFiles.FileInformation")
ResearchApplicationFiles.FileInformation包含FileInformation的列表,我想过滤该列表,其中“ Deleted”为false。
我不断收到此异常:
属性“ FileInformation”的属性访问的父值不是单个值。属性的访问只能被应用到一个单一的值。
如何使它正常工作?
答案 0 :(得分:2)
我想你想要
EntityQuery.from("ResearchApplication")
.where("Deleted", FilterQueryOp.Equals, false)
.where("ResearchApplicationFiles", FilterQueryOp.Any, "FileInformation.Deleted", FilterQueryOp.Equals, false)
.expand("ResearchApplicationFiles")
.expand("ResearchApplicationFiles.FileInformation")
请注意Any
子句中的更改。