0

var segmentSize = 5000;

var exceedValue = 1950504061000;
var alarmList1 = db.Alarm.find({ actionTime: { $lte: exceedValue } }).sort({ actionTime: -1 }).limit(segmentSize);
var temp1 = alarmList1[alarmList1.size() -1].actionTime;//这行下面执行就正常
alarmList1.forEach(function(alarm){
print(“alarmList1:” + alarm.actionTime);//不会打印
})

就这段代码,把中间那个temp1去掉后就可以打印,这是为什么???

Answered question