Here is my diagram
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var messageSchema = new Schema({
requestNumber: String,
requestedDateTime: String,
reasons: String,
state: String,
hospital: String,
phone: String,
status: {type: String, default: 'Pending'},
latestUpdate: Date,
createdAt: {type: Date, default: Date.now}
});
module.exports = mongoose.model('Requests', messageSchema);
Below I return a collection with three components in it
ipcMain.on('load-requests', function(event) {
hosSchemaModel.find(function(err, hosSchema) {
if (err) {
console.log('inside error')
} else {
event.sender.send('requests-results', hosSchema)
console.log(hosSchema[0].state)
}
});
});
When I try console.log(hosSchema)on the server, I get the following listing to the terminal:

and I could successfully access properties such as the status of the first component in the collection by accessing its index hosSchema[0].status.
Below I am trying to print hosSchemato the console (in the interface)
ipcRenderer.on('requests-results', (event, hosSchema) => {
console.log(hosSchema)
})
I get a result different from what they were looking for in the terminal. below - image

and hosSchema[0].statusreturns undefined.
My questions:
1) why hosSchema[0].statusdoes not work in the interface?
2) What is the correct way to access properties on the client side?