THT is in early Beta. We welcome contributors & feedback.

Db.updateRows

Db.updateRows(table, colMap, lockWhereSql)

Description

Update 1 or more rows of a table, if they exist.

// Archive posts that are older than 90 days
let archiveDate = Date.now() - Date.days(90);
let where = L'created < {}'.fill(archiveDate);

Db.updateRows('posts', { isArchive: 1 }, where);

// Runs this query:
// UPDATE posts SET archive=1 WHERE created < 1490492523