Store
Purpose
Append an event for a specific context.
Form
STORE <event_type:WORD> FOR <context_id:WORD or STRING> PAYLOAD {"key":"value", ...}
Constraints
<context_id>can be a WORD (example: user-1) or a quoted STRING.PAYLOADmust be a flat JSON object (no nested objects).PAYLOADmust follow schema defined usingDEFINEcommand.- Requires authentication and write permission for the event type (or appropriate role:
admin,editor, orwrite-only).
Examples
STORE order_created FOR customer-1 PAYLOAD {"order_id":123,"status":"confirmed"}
STORE review FOR "user:ext:42" PAYLOAD {"rating":5,"verified":true}
STORE login FOR user-7 PAYLOAD {"device":"android"}
Behavior
- Validates payload against the schema of the event type.
- Rejects missing or extra fields and type mismatches.
- Durability-first: once acknowledged, the event will survive crashes.
Errors
<event_type>cannot be empty<context_id>cannot be empty- Schema validation errors (see
DEFINE) Authentication required: No user ID provided or authentication failedWrite permission denied for event type '<event_type>': User lacks write permission for the event type and does not have an appropriate role (admin,editor, orwrite-only)- Overload/backpressure (rare): Shard is busy, try again later