Sequelize JSを使用して行を削除または更新しようとすると、いくつか問題が発生します。 私は(更新の)このような何かしようとすると:Sequelize jsでの更新と削除の問題
Embed.find(parseInt(req.body.id, 10)).success(function(embed) {
embed.updateAttributes({
NOME : req.body.name,
EMBED : req.body.embed
}).success(function() {
res.json({"success" : true});
}).error(function() {
res.json({"success" : false});
});
});
または(削除の):これは、エラーが表示さ
Embed.find(parseInt(req.body.id, 10)).success(function(embed){
embed.destroy().success(function(e) {
console.log(e);
if(e && e.deletedAt) {
res.json({"success": true});
}
}).error(function(e){
console.log(e);
});
}).error(function(){
res.json({"success": false});
});
を:
return (typeof obj == 'object') && !obj.hasOwnProperty('length')
はTypeError:呼び出すことはできませんメソッド 'hasOwnProperty' of null null at Object.isHash
誰でもお元気ですか?
どのバージョンをお使いですか? 2行目には何が埋め込まれていますか? – sdepold
こんにちは。私は1.3.7バージョンを使用しています。 "埋め込み"は、正しい行を返すfindメソッドからの答えになります。 –