Document
The read model of a Hypermedia document, the metadata and block tree that result from replaying its Changes, and the base every typed document's attributes are folded into.

Extends · closed

metadata
The document's attributes, merged last-writer-wins from every SetAttributes op.
optional
content
The tree of content block nodes built from the document's move tree and block registers.
of optional

The document type is the base Hypermedia document: resolved metadata, including the schema-binding fields attributesSchema, childAttributesSchema and schemaDefinition, plus the content block tree. A typed document does not extend this type. It names an attributes schema, a struct describing its metadata fields, through attributesSchema, or inherits one from its parent's childAttributesSchema.

This page defines the document value: the resolved state that the daemon computes from a document's Changes and hands to readers. No signed network blob holds it. Its formal schema is attached as the schemaDefinition in this document's metadata, so the app can show and validate values of this shape.

On the wire, a document is a graph of Change blobs and a Ref that names its heads. No blob's bytes are "the document". The API, the CLI and the SDK return this value. metadata is the merged result of every SetAttributes register. content is the tree of block nodes built from the move tree and the per-block registers. The API's full read model adds what the schema leaves out: the account and path, the version string, the authors, timestamps, the genesis, and the detached blocks.

The three schema-binding metadata keys make typing work without touching this shape. attributesSchema names the struct this document's metadata must satisfy. childAttributesSchema names the struct its children must satisfy. schemaDefinition says this document defines a schema for others to reference. A typed document is still exactly this value, with the base metadata keys folded in beneath the type's fields. Typed documents has the rules, and Documents has the history model behind the value.

See also

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

Unsubscribe anytime