Knex:你能在更新后做一次吗?

时间:2016-03-04 15:35:14

标签: node.js postgresql knex.js

使用Knex,我想进行更新,然后执行其他操作,最好使用更新的结果。以下内容似乎没有在控制台中放置任何内容。

db('challenges').where('challenged', '=', challengedName)
  .update( {
    userA: chal[0].challenged,
    userB: chal[0].challenger
  })
  .then(function(dosomething) {
    console.log("You can do a then after an update");
    console.dir(dosomething);
  })
  .catch(function(error) {
    console.error(error)
  })

当我查看数据库时,更新工作正常,我期望得到的结果。我不确定为什么控制台。*不会解雇。

0 个答案:

没有答案