如何在一个查询中使用 knex 在 postgres table 中切换布尔值?
How do you toggle a boolean in a postgres table using knex in one query?
是否可以在单个查询中使用 knex 切换 postgres table 中的布尔值和 return 新值?
await knex('table').update({
boolCol: knex.raw('NOT ??', ['boolCol])
}).returning('boolCol');
是否可以在单个查询中使用 knex 切换 postgres table 中的布尔值和 return 新值?
await knex('table').update({
boolCol: knex.raw('NOT ??', ['boolCol])
}).returning('boolCol');