SetAttributes Op
The operation that sets document metadata by key path, where each path is a last-writer-wins register and a nested write prunes older values above and below it.

Extends · closed

type
Operation tag, always `SetAttributes`.
SetAttributes
block
Reserved for per-block attributes; must be empty today.
optional
attrs
Key paths and the values to write; a `null` value deletes the key.
of optional

SetAttributes is how a Change edits a document's metadata: the name, summary, icon, site URL, schema bindings and any custom attribute a schema defines. It lists key paths and values, and the daemon stores each one as a register where the newest write wins.

This page defines the change/op/set-attributes operation inside a Change body. Its formal schema is attached as the schemaDefinition in this document's metadata, so the app can show it.

attrs is a list of key-value pairs. The key is a path (["name"], ["theme", "accent"]) and the value is a string, boolean, integer up to 2^53−1, or null to delete. Writes resolve last-writer-wins by op id, and structurally. Setting ["a","b"] removes an older value at ["a"] or at ["a","b","c"], while an existing newer ancestor or descendant makes the incoming write a no-op, so a map value and a nested key never coexist. block is reserved for per-block attributes and must be empty today. A Change that sets it fails at replay. Block attributes are written inside ReplaceBlock. When the daemon prepares a Change for the Seed app it emits one SetAttributes with every dirty attribute; see Documents.

See also

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime