说我的活动如下:
purchase = {
items: ["pickle", "turtle", "lexicon"]
}
我如何计算有多少事件有“泡菜”?
答案 0 :(得分:2)
使用equal
运算符。
var count = new Keen.Query("count", {
event_collection: "purchases",
timeframe: "this_14_days",
filters: [
{
property_name: "items",
operator: "eq",
property_value: "pickle"
}
]
});
来自API reference for filters & their operators:
“等于” - 请注意,如果属性的值是数组,则可以使用“eq”来过滤该数组中的值。例如,eq:5将匹配值[5,6,7]。