I`m trying to undestand whats going on and why defineConstraints is not a function. can someone help me ?
Heres examples of my code.
index.js
const Sequelize = require('sequelize');
config = require('config');
const dbConf = config.get('database');
console.log(dbConf);
const sequelize = new Sequelize(dbConf.database, dbConf.user, dbConf.password,{
dialect: 'postgres',
host: dbConf.host,
port: dbConf.port,
logging: console.log
});
sequelize.Model = Sequelize.Model;
const models = {
User: sequelize.import(__dirname + '/models/user.js'),
Service: sequelize.import (__dirname + '/models/service.js'),
Subscriber: sequelize.import (__dirname + '/models/subscriber.js'),
};
for(const model in models) {
models[model].defineConstraints(models);
}
models.Op = Sequelize.Op;
models.sequelize = sequelize;
module.exports = models;
Firebase Cloud Functions: PubSub, "res.on is not a function"
TypeError: Cannot read properties of undefined (reading 'createMessageComponentCollector')
how do I use a nodejs var inside a json statement, I dont realy have the required vocabulary to explain but here is my simplifyed code:
I have a website built on MongoDB which has files to be downloaded by users other than images ( it can be a software installer orexe file
I am trying to create a E-commerce project using MERN stack and was wonderingHow to go about creating a cart for a user