Actions25
- Database Actions
- Memory Actions
- Query Actions
- Query Builder Actions
- Table Actions
- Table Management Actions
Table → Update
AI-generatedSummary
Update rows in a Cloudflare D1 table matching WHERE conditions, setting specified column values.
Inputs
- databaseId (required) — The unique identifier of the Cloudflare D1 database.
- table (required) — The name or identifier of the table to update.
- updateFields (required) — Array of column updates; each entry defines a column name and its new value.
- whereUpdate — Array of WHERE conditions; each defines a column, operator, and value to filter rows.
Output shape
object indicating success and metadata about rows affected (rowsWritten, changes); includes success flag, results array, meta object.
The returned object contains a success boolean, an array of updated rows, and metadata fields rowsWritten and changes; results may be empty.
Examples
Example 1: Update user status to active where id equals 5
databaseId: "123", table: "users", updateFields: [{column: "status", value: "active"}], whereUpdate: [{column: "id", operator: "=", value: "5"}]
Example 2: Set price to 100 for all products in stock
databaseId: "456", table: "products", updateFields: [{column: "price", value: "100"}], whereUpdate: [{column: "inStock", operator: "=", value: "true"}]
Example 3: Increment viewCount for a specific article
databaseId: "789", table: "articles", updateFields: [{column: "viewCount", value: "{{ $JSON.viewCount + 1 }}"}] , whereUpdate: [{column: "slug", operator: "=", value: "node-example"}]