我正在使用findAll方法搜索所有用户,但它显示此错误,无法读取未定义的属性'findAll‘。
user.js
var user = require("../../models/user");
var sequelize = require('sequelize');
var constants = require("../../config/constants");
var requestHelper = require("../../helpers/request");
var responseHelper = r
我在尝试创建带有后遗症的模型。但是方法createPost()抛出错误:
Argument of type '{ title: string; description: string; }' is not assignable to parameter of type '{ id: {}; title: {}; description: {}; }'.
Property 'id' is missing in type '{ title: string; description: string; }' but required i
我想在查询中做一个和,如SQL:
SELECT `coproprietaires`.`id`,
`coproprietaires`.`name`,
`coproprietaires`.`email`,
`LotsOwner`.`lotId` AS `lotId`,
`LotsOwner`.`distributionKeyId` AS `costKey`,
SUM(`LotsOwner`.`tantiemeNumber`) AS `tantiemeNumber`
FROM `coproprietaires` AS `copro
我正在建立一个社交网络,所以我的模型是帖子,用户和用户跟随的用户关系。
var User = sequelize.define('user', {
username: Sequelize.DataTypes.STRING
})
var Post = sequelize.define('post', {
text: Sequelize.DataTypes.STRING,
userId: Sequelize.DataTypes.INTEGER
})
var Follow = sequelize.define('follow', {
我尝试使用postgres数据库中的sequelize进行查询,但是在查询时,我得到了一个名为:"createdAt“列不存在的错误,其中的表如下:
Column | Type |
id | integer |
title | character varying(200) |
technologies | character varying(200) |
budget | character varying(20) |
descriptio
希望有人能给我指明正确的方向。我有一个表的“触发”字,触发某些行为在我的应用程序。该应用程序已经运行了几个月,但有时在调用findAll时会发生以下错误:
TypeError: Cannot read property 'getQueryInterface' of undefined
at Model.get (C:\Users\Me\Projects\api\project-name-api\node_modules\sequelize\lib\model.js:104:40)
at Model.get (C:\Users\Me\Projects\api\pr
我正在尝试学习sequelize.js,并且我正在获取用于更新方法的TypeError:
TypeError:无法读取未定义的属性'params‘
我正在尝试获取路由的参数并更改它的值。我正在尝试获取一个用户名并更改它的用户名和密码。下面是我的代码:
module.exports = function (sequelize) {
var model = require("../models/employer_model")(sequelize);
var Employer = model.Employer;
return {
cr