I have written a query to fetch data into outVar variable from mongo db via mongoose object and when i print outVar onto console from my js file, i am getting the below data
{ _id: 5c24fad96fe8c607b7e73814,
title: 'Movies and TV series database',
version: '1.0',
shows:
[ { name: 'CSI', genre: 'Sci', lead_actor: 'William Petersen' } ] }
console.log(outVar.title) and console.log(outVar.version) yields the results Movies and TV series database and 1.0 respectively. However, when i try to print outVar.shows, i get undefined.
Please help me in understanding where i am going wrong and how i can rectify the issue.