gpt4 book ai didi

mysql - SailsJS/MySQL : Unknown column 'NaN' in 'field list'

转载 作者:可可西里 更新时间:2023-11-01 07:08:51 25 4
gpt4 key购买 nike

我发现我得到了

Error (E_UNKNOWN) :: Encountered an unexpected error : ER_BAD_FIELD_ERROR: Unknown column 'NaN' in 'field list'

我首先注意到这一点是在暂存 (elastic beanstalk) 上。然后当我执行全新的 npm install 时在本地注意到了这一点。我怎样才能调试出什么问题?看来

Survey.create(params)

是原因。但我不知道为什么...... params 看起来像

{
"name": "ADDSW",
"description": "rewgre",
"url": "https://www.surveymonkey.com/r/my-survey-name?uid=[uid_value]&sid=[sid_value]",
"image": "https://s3-ap-southeast-1.amazonaws.com/meclub/savVD/35/zx.jpg",
"points": "111",
"trackingCode": "EN201510EXFABPSSADON",
"transaction_partner": "EX",
"transaction_department": "FAB",
"transaction_campaign": "ADON",
"win": ""
}

和调查模型:

var shortid = require('shortid');

module.exports = {
autoPK: false,

attributes: {
id: {
type: 'string',
unique: true,
index: true,
primaryKey: true,
defaultsTo: function() {
return shortid.generate();
}
},
name: {
type: 'string',
required: true
},
description: {
type: 'string',
defaultsTo: ''
},
url: {
type: 'string',
required: true
},
image: {
type: 'string',
required: true
},
points: {
type: 'integer',
required: true
},

win: {
model: 'win'
},

trackingCode: {
type: 'string',
required: true
},
transaction_partner: {
type: 'string'
},
transaction_department: {
type: 'string'
},
transaction_campaign: {
type: 'string'
},

toJSON: function() {
var obj = this.toObject();
obj = _.omit(obj, ['createdAt', 'updatedAt', 'transaction_partner', 'transaction_department', 'transaction_campaign']);

return obj;
}
}
}

似乎是某些包导致了错误?但我无法弄清楚哪个......

更新

刚刚尝试删除 package.json 中版本号中的所有 ^~ 以便所有依赖项都以准确的版本安装,但是它仍然失败......

最佳答案

我想问题出在 win 属性上。您可能必须消除它,而不是发送空字符串 "win": ""

关于mysql - SailsJS/MySQL : Unknown column 'NaN' in 'field list' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32934535/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com