我找不到以(getProduct, setProduct
...)加上sequelize的函数
// this is my models
const Product = sequelize.define('product', {...});
const Transaction = sequelize.define('paiement', {...});
// and here i make the association
Product.belongsToMany(Transaction, {through: TransactProduct});
Transaction.belongsToMany(Product, {through: TransactProduct});
然后,当我尝试以addProduct
的形式到达函数时,它显示出不是函数的错误
Transaction.create({...}).then( transact => { transact.getProducts().then().catch)
关联的配置有问题,我不明白为什么它不能将功能识别为addProduct
,getProduct
...