A dilemma I'm facing involves a form that effectively sends and saves JSON data to MongoDB using mongoose.
However, the issue arises when attempting to access this data as the nested objects display on the get route html page as:
{ synth: { patch_name: 'dd', synths: [ [Object], [Object], [Object] ] }, _id: 534e438e585246b81eaef158, __v: 0 }
{ synth: { patch_name: 'dd', synths: [ [Object], [Object], [Object] ] }, _id: 534e438f3f356cb01b6b4f9c, __v: 0 }
{ synth: { patch_name: 'dd', synths: [ [Object], [Object], [Object] ] }, _id: 534e43b17d4e9eb0153cd69b, __v: 0 }
All the nested objects are simply labeled as 'object' which is causing confusion for accessing this information.
Requesting the data with the following get request:
app.get('/returnedData', function(req, res){
Synth.find({}, function (err, docs) {
res.render('returnedData', {
title: 'Tasks index view',
docs: docs
});
});
});
Jade loop in use:
each synth in docs
tr
td #{synth}
Various attempted solutions have been unsuccessful, including:
docs: docs.synth
Any assistance with resolving this issue would be greatly appreciated. Thank you.