【问题标题】:dexie cascating WhereClausedexie 级联 WhereClause
【发布时间】:2017-06-02 22:00:24
【问题描述】:

是否可以级联 Dexie “WhereClause”?

示例:我想使用

db.City.where("Name").startsWithAnyOfIgnoreCase(param1)
                     .orderBy("Name")?

但 WhereClause 对象中的所有方法都返回“Collection”,它只提供过滤器以添加更多过滤器

【问题讨论】:

    标签: indexeddb dexie


    【解决方案1】:

    您的示例仅说明了一种 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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-12-04
      • 2017-11-28
      • 2016-12-28
      • 1970-01-01
      • 2020-03-30
      • 1970-01-01
      • 2017-11-13
      相关资源
      最近更新 更多