I'm learning Node.js and using mssql to retrieve employee data. I get the following recordset back and having trouble grab the first and last name:
{ recordsets: [ [ [Object] ] ],
recordset: [ { uid: 'jd123', fName: 'John', lName: 'Doe' } ],
output: {},
rowsAffected: [ 1 ]
}
I have tried the following but had no luck:
D:\LearnNodeJs\Udemy\routes\processes.js
// var submitter = recordset[0]['fName']; // TypeError: Cannot read property 'fName' of undefined
^
//var submitter = recordset[0].fName; // TypeError: Cannot read property 'fName' of undefined
var submitter = recordset.fName; // undefined
console.log(submitter);
recordsetis a property of some object, what is the object name