I am using express and sequelize for my node application. In the controller file, I have the following:
var models = require('../models'),
Property = models.property,
Sequelize = require('sequelize');
module.exports = function(req, res){
Sequelize.query("SELECT * FROM 'property'", { type:Sequelize.QueryTypes.SELECT})
.then(function(properties) {
res.json(properties)
})
}
I can use model.findAll perfectly, but when I try to use a raw request, I get TypeError: undefined is not a function. Can you indicate what I am doing wrong in this code?
source
share