I'm using Sequelize with Node and I have an instance of a model called athlete. I'm trying to insert it into my database using the save() function but it is returning this:
TypeError: athlete.save is not a function
Here is my code snippet :
console.log("Athlete: " + athlete);
athlete.save().then(function() {
console.log("Inserted Athlete");
callback(null, athlete);
}).catch(function (err) {
console.log("Inserted athlete with error: " + err);
callback(err, null);
});
The log prints this:
Athlete: [object SequelizeModel]
athlete is created from a class method in a Sequelize model definition file.