ay update (Alias: u)
Aktualisiert einen Eintrag non-interaktiv — gemacht für Scripts und AI-Agenten. Im Gegensatz zu edit öffnet update keinen Editor; die Änderungen kommen via --set, --body, --body-file oder --body-stdin.
Syntax
ay update [collection] [id] [flags]
Flags
| Flag | Default | Zweck |
|---|---|---|
--set <key=value...> |
— | Einzelne Felder (wiederholbar) |
--body <json> |
— | Komplettes Update als JSON-String |
--body-file <path> |
— | JSON-Datei einlesen |
--body-stdin |
— | JSON via stdin pipen |
--merge |
false | GET → merge → PUT (existing fields bleiben erhalten) |
--set-Werte werden auto-gecastet: true/false → boolean, null → null, Zahlen → number, Rest bleibt string.
Beispiele
# Einzelne Felder
ay update contacts 64a1b2c3 --set firstName=Jane --set active=true
# AWS-State eines Computing Entity
ay update computingentities 64a1b2c3 --set ip=35.159.50.19 --set instanceId=i-019c...
# JSON-Body
ay update contacts 64a1b2c3 --body '{"firstName":"Jane","tags":["vip"]}'
# Aus Datei
ay update products 64a1b2c3 --body-file changes.json
# Aus stdin
echo '{"status":"active"}' | ay update contacts 64a1b2c3 --body-stdin
# Merge-Mode (GET + spread + PUT)
ay update tasks 64a1b2c3 --set done=true --merge