title: How to fix the model.create() is not a function error in Sequelize ORM
body: <p>I am new with nodejs so please go easy on me.
  I am setting up a nodejs server to connect to a mysql database using Sequelize.
  I currently have an error "model.create is not a function" which I cannot find any related fixes on google.
  Please help me out.
  Thanks in advance</p>
  
  <p>This is my model.js file</p>
  
  <pre><code>const sequelize = require('sequelize');
  
  module.exports = (sequelize, DataTypes) =&gt; {
      const Data = sequelize.define('Data',
          {
              oxyVal: {
                  type: DataTypes.DOUBLE,
                  allowNull: false
              },
  
              mqState: {
                  type: DataTypes.BOOLEAN,
                  allowNull: false
              },
  
              date: {
                  type: DataTypes.DATE,
                  allowNull: false,
                  defaultValue: DataTypes.NOW
              },
              id: {
                  type: DataTypes.INTEGER,
                  allowNull: false,
                  autoIncrement: true,
                  primaryKey: true
              }
          });
      return Data;
  }
  </code></pre>
  
  <p>This is my index.js file</p>
  
  <pre><code>const express = require('express');
  const morgan = require('morgan');
  const bodyParser = require('body-parser');
  const Sequelize = require('sequelize');
  
  const Data = require('../models/data');
  
  const app = express();
  const port = 5500;
  
  
  // I will now connect to my database
  
  mySequelize = new Sequelize('Fast', 'root', '[password]', {
      host: '127.0.0.1',
      dialect: 'mysql',
      operatorsAliases: false,
  
      pool: {
          max: 5,
          min: 0,
          acquire: 30000,
          idle: 10000
      }
  });
  
      // Test database connection here
  
      mySequelize.authenticate().then(() =&gt; {
          console.log('Database connected successfully');
      }).catch((err) =&gt; {
          console.error('Failed to connect to database \n ' + err);
      })
  
      app.use(morgan('dev'));
      //app.use(bodyParser.urlencoded({ extended: false }));
      app.use(bodyParser());
      app.get('/');
      app.post('/', (req, res, next) =&gt; {
          const myData = Data.create({
              oxyVal: req.body.oxyVal,
              mqState: req.body.mqState,
              time: req.body.time,
              time: req.body.id
          }).then(JSON.parse(myData)).myData.save().then((result) =&gt; {
              console.log(result);
  
          }).catch((err) =&gt; {
              console.log(err);
          });;
  
          res.send('Record successfully saved');
          console.log(myData);
      });
  
  
  
      app.listen(port)
      console.log("Server satrted on " + port + " .....");
  </code></pre>