检查聚合结果是否正常,查看subchannel字段是否被保存:
var testcoll = db.getSiblingDB('Stats').getCollection('robertagg').find().limit(1000);
loop:for (var ldata = testcoll; ldata.hasNext(); ) {
var sudata = ldata.next();
for (let[i, key]of Object.keys(sudata).entries()) {
if (key.indexOf("subchannel") != -1)
{
print(JSON.stringify(sudata));
break loop;
}
}
}