【发布时间】:2017-06-02 22:00:24
【问题描述】:
是否可以级联 Dexie “WhereClause”?
示例:我想使用
db.City.where("Name").startsWithAnyOfIgnoreCase(param1)
.orderBy("Name")?
但 WhereClause 对象中的所有方法都返回“Collection”,它只提供过滤器以添加更多过滤器
【问题讨论】:
是否可以级联 Dexie “WhereClause”?
示例:我想使用
db.City.where("Name").startsWithAnyOfIgnoreCase(param1)
.orderBy("Name")?
但 WhereClause 对象中的所有方法都返回“Collection”,它只提供过滤器以添加更多过滤器
【问题讨论】:
您的示例仅说明了一种 WHERE 条件。但听起来你在问如何在单个表选择期间有多个 WHERE 条件。如果是这样,我认为您可以在此处的(写得很好)Dexie 文档中找到您的答案:http://dexie.org/docs/Table/Table.where()
相关代码sn-p是这样的:
db.friends.where(["name", "age"])
.between(["David", 23], ["David", 43], true, true)
.each(friend => {
console.log("Found David, 43: " + JSON.stringify(friend));
}).catch(error => {
console.error(error.stack || error);
});
希望能回答您的问题。 F
【讨论】: