Version: v0.5.1 - Beta.  We welcome contributors & feedback.  THanks!

Db.updateRows

Db.updateRows(table, colMap, whereSql)

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 = sql'created < {}'.fill(archiveDate);

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

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