bknd-crud-update_skill

This skill streamlines updating Bknd records via SDK or REST, supporting single, bulk, and relational updates with safe, structured responses.

2

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill cameronapak/bknd-skills --skill bknd-crud-update

  • SKILL.md14.2 KB

Overview

This skill explains how to update existing records in a Bknd entity using the SDK or REST API. It covers single and bulk updates, relation operators ($set, $add, $remove, $unset), partial and conditional updates, response handling, and common patterns and pitfalls. Practical examples include React integration, optimistic updates, and verification steps.

How this skill works

Use api.data.updateOne(entity, id, data) to change a single record and api.data.updateMany(entity, where, data) for bulk updates. Relation changes use operators inside the field value (e.g., { tags: { $add: [4] } }, { author: { $unset: true } }). Responses return { ok, data, error } so you can verify success and read back the updated record if ok is true.

When to use it

  • Update a single record after a form submission or admin edit
  • Apply bulk changes by criteria (archive drafts, update statuses)
  • Modify relations: add/remove links or replace entire relation sets
  • Perform conditional updates only when business checks pass
  • Implement optimistic UI updates with rollback on failure

Best practices

  • Always check the response ok flag before using data
  • Verify the target record and related IDs exist to avoid FK errors
  • Use updateMany only with an explicit where clause to avoid accidental global changes
  • Use $add/$remove for incremental relation changes and $set to replace
  • Revalidate caches or mutate SWR keys after successful updates

Example use cases

  • Switch a post status to published and set published_at with updateOne
  • Add tags to a post without losing existing tags using { tags: { $add: [...] } }
  • Archive all draft posts older than a date with updateMany and a where filter
  • Implement an edit form in React that loads data, updates via api.data.updateOne, and shows errors
  • Perform optimistic UI updates: update local state, call updateOne, rollback if ok is false

FAQ

Responses include ok (boolean), data (updated record when ok is true), and error (details when ok is false). Always check ok before accessing data.

How do I update relations safely?

Verify related record IDs exist, use $add/$remove for many-to-many adjustments, use $set to replace all relations, and use $unset to nullify many-to-one links.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational