我是持久性 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");
有没有办法让它工作?