content.list()
List lightweight entries for every document, read straight from the manifest.
content.list(sources?)
Returns the lightweight ContentListFile entry (no parsed nodes) for every document, read straight from the manifest, so it never parses a body.
Parameters:
sources?: a single source name, or an array of source names, to restrict the listing to. Defaults to every source. Onlydocumententries are returned. Known source names narrow each item'sdatatype.
Returns: Promise<ContentListFile[]>
usage.ts
const all = await content.list() // every document, all sources
const blog = await content.list('blog') // list documents of the `blog` source
const mixed = await content.list(['blog', 'docs'])Trim which data fields are kept with addListingFields. For filtered, sorted, paginated queries over data.*, use the sqlQuery plugin's content.query(). With the references plugin installed, the single-source form also accepts { populate } to inline reference fields.
Usage
usage.ts
const all = await content.list()
const blog = await content.list('blog')