我是持久性js的新手,我不确定是否可以在预取实体上应用过滤器。我使用websql作为商店。
以下是我尝试的示例,
var Category = persistence.define("Category", { categoryName : 'TEXT'});
var Expense = persistence.define("Expense", { expenseAmount : 'INT'});
Category.hasMany("expenses",Expense,"category");
//Query to get all expense related to a category - but this didn't work
Expense.all().prefetch("category").filter("categoryName","=","TestCategory");
有没有办法让它发挥作用?