K
Docs
API Reference→Pieces→Update Matching
🔁

Update Matching

vault.updateThe VaultVault

Changes the rows that match your filter, all at once: reset everyone's weekly score, move a whole team, add 5 XP to every member of a guild. Number columns can + Add or − Sub just like Write to Vault. It never creates rows, so nothing appears out of thin air.

When to use this
  • →No filter means every row changes — handy for resets, so double-check
  • →Leave a column empty to keep it as it is
  • →Need to create the row if it's missing? Use Write to Vault or Bump a Number

On the canvas

This is what Update Matching looks like when you place it on your flow. Each field below is something you configure in the inspector panel.

🔁
Update Matching
vault.update
Vault
tablerequired
Pick a table…
filterColumn
Every row
filterOp
select…
filterValue
e.g. {{input.user.id}}
asrequired
changed
output
none

Config fields

FieldTypeReqWhat it does
table
Pick a table…
textyesTable 🗄️
filterColumn
Every row
text—Only rows where… 🔍
filterOpselect—Is…
filterValue
e.g. {{input.user.id}}
text—This value
as
changed
textyesSave how many changed as ✨

Output ports

outputAt least one row changed — the count is your spark
noneNo rows matched, so nothing changed
📐

In TypeScript, this would be…

Not something you need to write — just a look at what Kitcord does for you.

TypeScript
const { changes } = await db.run(
  "UPDATE levels SET weekly_xp = 0 WHERE guild = ?",
  [guildId],
);
// {{changed}} = changes — Updated ✓, or No match ∅ when 0