I am using Job-Collection package. And in processJobs, I got a problem.
JCJobs.processJobs('report',
function (job, cb) {
// This will only be called if a
// 'sendEmail' job is obtained
var rep= genReport();
Reports.insert({
category: 0,
content: rep
});
job.done('done!');
cb();
}
);
function genReport(){
var arr=[];
SomeCollection.find({}).forEach(function(o){
var o2=processO(o); //process o some way, and returns a new object.
arr.push(o2);
});
return arr;
}
Reports is a collection containing two fields category and content.
The processJobs was called. But you will find the value of the field content is an Array in which every element is empty.
Please help me out.