Skip to content

getEntries

Read every node's content in reading order.

View Markdown

Walks the tree, reads every file, validates it, and applies the selected view. Entries come back in reading order, the same order as getFlatTree.

src/app/sitemap.ts
const entries = await docsTree.getEntries();
entries.map((entry) => `/docs/${entry._meta.slug}`);

Signature

@qino/cms
tree.getEntries(options?: { view?: ViewName }): Promise<Array<Entry>>;

Parameters

NameTypeRequiredDefaultDescription
options.viewview nameno"default"A view declared in views. Unknown names throw

Returns

Promise<Array<Entry>>, where Entry is the schema output, _meta (slug, fileName, filePath), resolved relations at the view's depth, and the awaited augment output. No children and no navigation data.

Order is depth-first: each node, then its children, following _order.json. Trees have no filter or sort.

Throws

  • Unknown view "<name>". Available views: <names>.
  • The walk errors listed on getTree.
  • Getter option errors, validation, relation, and augment errors for any entry. See Errors.

See also