To convert entity to plain object with JavaScript Sequelize, we set the raw option to true.
For instance, we write
db.Sensors.findAll({
where: {
nodeId,
},
raw: true,
nest: true,
}).success((sensors) => {
console.log(sensors);
});
to call findAll to return objects by calling it with the raw option set to true.
We get the returned results from the sensors parameter in the success callback.