I am working in nodejs project in that using sequelize
for connecting mysql database. I am also using sequelize-values for getting raw data from Sequelize instances.
I have written below code
var Sequelize = require('sequelize');
require('sequelize-values')(Sequelize);
var sequelizeObj = new Sequelize('mysql://root:@localhost/database');
sequelizeObj.authenticate().then(function (errors) {
console.log(errors)
});
sequelizeObj.query("SELECT * FROM `reports` WHERE `id` = 1200").then(function (result) {
});
Now the table reports
have only 1 record for id
1200, But the result
gives two objects for same records, Means both records are same of id 1200.
[ [ { id: 1200,
productivity_id: 9969,
gross_percentage_points: 100 } ],
[ { id: 1200,
productivity_id: 9969,
gross_percentage_points: 100 } ] ]
Let me know what I am doing wrong?