Sequelize findOrCreate方法抛出" no where参数"信息

时间:2016-08-26 17:27:27

标签: postgresql sequelize.js

当执行下面的代码来解决我的AWS管理的PostgreSQL时(假设实体是一个定义良好的模型,我已经保存了给定的主键"实体"到)

      Entity.findOrCreate({where: {entity: 'Salad'}, defaults: {type: 'Food'}})
      .spread(function(user, created) {
        console.log(user.get({
          plain: true
        }));
        console.log(created);
      });

我收到了错误

Error: Missing where attribute in the options parameter passed to findOrCreate. Please note 
that the API has changed, and is now options only (an object with where, defaults keys, 
transaction etc.)

上面的代码直接从他们的文档中提取。这个错误的错误处理信号是另一个问题,还是我应该向Sequelize团队提交一张票?

0 个答案:

没有答案