2
说我的情况是这样的:我如何计算在Keen IO中有多少事件存在某个列表项目?
purchase = {
items: ["pickle", "turtle", "lexicon"]
}
如何计算有多少事件有“泡菜”?
说我的情况是这样的:我如何计算在Keen IO中有多少事件存在某个列表项目?
purchase = {
items: ["pickle", "turtle", "lexicon"]
}
如何计算有多少事件有“泡菜”?
使用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]的值。