0
歡迎TokuMX對象的翻譯:有沒有一種方法「hasNext」
我的機器上做的聚集與蒙戈3.0
mongo ${DB_HOST_PORT}/${DATE} ${BASE_PATH}/temp/script.js > "${BASE_PATH}/temp/listofcampaigns.csv" --quiet
var cursor=db.getCollection('combined_data').aggregate([{"$match":{"src":"sender","customer":"test","name":"ntf_NotificationSent","time":{"$gte":"2016-11-23T00:00:00.000Z","$lt":"2016-11-23T01:00:00.000Z"}}},
{"$group":{"_id":{"campaign":"$spec:crm:cmp:campaign:id"},"count":{"$sum":1}}},{"$sort":{"count":-1}}]);
if (cursor && cursor.hasNext()) { print('campaign, count');
while (cursor.hasNext()) { var item = cursor.next(); print('' + item._id.campaign + ', ' + item.count); }}
而且這是工作沒有問題,但是,我在運行此之後安裝了TokuMX的機器,我有ony錯誤:
Wed Nov 23 14:13:06.443 TypeError: Object [object Object] has no method 'hasNext' at (...)/temp/script.js failed to load: (...)/temp/script.js
有人可以幫助我嗎? 或者也許有人有工作示例如何運行TokuMX機器上的這種聚合?
結果文件應該是這樣的:
campaign, count
xyz, 5
yxz, 6