I’m creating a node.js app and implementing the scheduler app. I’m following this walkthrough: https://dhtmlx.com/blog/using-dhtmlxscheduler-with-node-js/
When I navigate to the /data page, it says cannot read property 'length' of undefined. I went to the github page and downloaded app.js word for word.
Here is app.js portion throwing error:
app.get('/data', function(req, res){
db.event.find().toArray(function(err, data){
//set id property for all records
for (var i = 0; i < data.length; i++)
data[i].id = data[i]._id;
//output response
res.send(data);
});
});