aYOUne

ay db

ay db

Kopiert Query-Resultate in externe Datenbanken (Push) oder synct die Plattform-DB auf eine lokale MongoDB (Pull). Alle DB-Operationen laufen über den Aggregation-Service — die CLI verbindet niemals direkt zur Plattform-DB.

Subcommands

ay db copy [target] [query]

Push-Mode: führt eine gespeicherte Aggregation auf der Plattform aus und schreibt in einen pre-konfigurierten DataTarget (Slug-basiert).

Flag Zweck
--collection <name> Target-Collection-Name overriden
--write-mode <m> insert, upsert, replace
# Voll-interaktiv
ay db copy

# Target-only, Query interaktiv
ay db copy my-warehouse-pg

# Voll-autonom
ay db copy my-warehouse-pg active-users

# Mit Override
ay db copy my-warehouse-pg active-users --collection users_2026 --write-mode upsert

ay db pull [target]

CLI-side Pull via Streaming-NDJSON + mongoimport zu lokaler MongoDB.

Flag Zweck
--since <iso> Nur Records nach Datum
--every <duration> Wiederholendes Pull (z.B. 5m, 1h)
--max-iterations <n> Limit für --every
--write-mode <m> Default upsert für Local-Targets
ay db pull consumers --target local --stream
ay db pull orders --target local --since 2026-04-01
ay db pull tasks --target local --every 5m --max-iterations 100

ay db targets list (Alias: ls)

Listet konfigurierte DataTargets.

ay db targets list

ay db targets add

Neues Target anlegen.

Flag Zweck
--name <name> Anzeigename
--type <t> mongodb, postgresql, rest
--uri <uri> Connection-URI
--database <db> DB-Name
--collection <col> Default-Collection
ay db targets add \
  --name "Local MongoDB" \
  --type mongodb \
  --uri "mongodb://localhost:27017" \
  --database ayoune_dev

ay db targets test <slug>

Connectivity-Test eines Targets.

ay db targets test my-warehouse-pg

ay db targets remove <slug>

ay db targets remove my-warehouse-pg

Hinweis

Local-Targets (Tag local) nur via ay db pull. Bei ay db copy <local-slug> blockt die CLI mit Hinweis.

Siehe auch