【问题标题】:How can I create a Keen IO query with "OR" filters?如何使用“OR”过滤器创建 Keen IO 查询?
【发布时间】:2017-06-07 21:37:54
【问题描述】:

我想知道 Keen IO 查询中的过滤器是否可以作为“或”来完成。

基本上,我有一个名为“product_type”的“列”(event property)。

我想生成一个 API 查询 URL,其中包含一个带有“如果 product_type 等于 x OR product_type 等于 y”的过滤器的提取。

但现在,如果我做这样的过滤器,它总是“与”。

【问题讨论】:

    标签: analytics keen-io nosql


    【解决方案1】:

    使用“in”运算符。这个“in”运算符将识别属性等于列表中任何值的任何事件,如下所示:

    var extraction = new Keen.Query("extraction", {
      event_collection: "purchases",
      timeframe: "this_14_days",
      filters: [
        {
          property_name: "product_type",
          operator: "in",
          property_value: ["x","y"]
        }
      ]
    });
    

    这里是所有可用过滤器operators 的方便列表。

    【讨论】:

      猜你喜欢
      • 2015-04-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多