Search code examples
mysqlknex.jsbookshelf.js

Set value = value +1 in bookshelf.js


just wanted to ask, how do i update a value in my mysql DB + 1 using bookshelf.js?

as example: Update table set value = value +1 where x = y ... ;


Solution

  • solved the problem: await table.query().where('id', id).increment('value', value)