I have a node / express / sequelize application. I use the build in sequelize method to instantiate my foo model.
Foo controller
exports.create = function(req, res) {
var foo = db.Foo.build(req.body);
foo.save().then(function(){
});
}
Model Foo
module.exports = function(sequelize, DataTypes) {
var Foo = sequelize.define('Foo',
{
bar: DataTypes.STRING,
baz: DataTypes.STRING
}
Does the build method verify that the data I save is clean, or do I need to take some extra precautions here?
source
share