How to plus 1 to the current value of a column when update

How to plus 1 to the current value of a column when updating a record
F
fi337d ago
do i need to read the value first then only update it?
AS
Andrii Sherman337d ago
You can use sql template
db.update(usersTable).set({
field: sql`${usersTable.field} + 1`
})
db.update(usersTable).set({
field: sql`${usersTable.field} + 1`
})