Skip to content

Latest commit

Β 

History

History
35 lines (25 loc) Β· 1.62 KB

File metadata and controls

35 lines (25 loc) Β· 1.62 KB

πŸ”Ή update record` β€” update fields of an existing record

Source Code

ingitdb update record --id=ID --set=YAML [--path=PATH]
ingitdb update record --id=ID --set=YAML --github=OWNER/REPO[@REF] [--token=TOKEN]

Updates fields of an existing record using patch semantics: only the fields listed in --set are changed; all other fields are preserved.

Flag Required Description
--id=ID yes Record ID as collection/path/key.
--set=YAML yes Fields to patch as YAML or JSON (e.g. '{capital: Dublin}').
--path=PATH no Path to the local database directory. Defaults to the current working directory.
--github=OWNER/REPO[@REF] no GitHub repository. Mutually exclusive with --path.
--token=TOKEN no GitHub personal access token. Falls back to GITHUB_TOKEN. Required for GitHub writes.

Examples:

# πŸ“˜ Patch a record locally
ingitdb update record --id=countries/ie --set='{capital: Dublin}'

# πŸ™ Patch a record in a GitHub repository
export GITHUB_TOKEN=ghp_...
ingitdb update record --github=myorg/mydb --id=countries/ie \
  --set='{capital: Dublin, population: 5100000}'