运行以下代码时,第一个console.log返回crossfilter实例的内容,但第二个console.log返回空括号。
为什么没有数据进入我的交叉滤波器维度?
var cf = require('./crossfilter.js');
var payments = cf([
{date: "2011-11-14T16:17:54Z", quantity: 2, total: 190, tip: 100, type: "tab", productIDs:["001"]},
{date: "2011-11-14T16:20:19Z", quantity: 2, total: 190, tip: 100, type: "tab", productIDs:["001", "005"]},
{date: "2011-11-14T16:28:54Z", quantity: 1, total: 300, tip: 200, type: "visa", productIDs:["004" ,"005"]}
]);
var paymentsByTotal = payments.dimension(function(d) { return d.total; });
console.log(JSON.stringify(payments.all()))
console.log(JSON.stringify(paymentsByTotal.filterAll()))