BreezeJs查询嵌套对象

时间:2019-02-01 09:27:35

标签: angular breeze

我想执行以下查询:

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”的属性访问的父值不是单个值。属性的访问只能被应用到一个单一的值。

如何使它正常工作?

1 个答案:

答案 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子句中的更改。

Breeze query examples page

上查看更多示例