?
MappedDocument
TypeOne document a mapper emits: its stable external id, title, and markdown body.
One document a mapper emits. externalId is the identity the platform replaces by: a later object with the same id supersedes this document, and a deletes naming it removes it. markdown is chunked and embedded; metadata is scalars only, filterable at search time; replaces names ids this document supersedes.
MappedDocument.ts
interface MappedDocument { externalId: string title: string markdown: string metadata?: DocumentMetadata entities?: string[] replaces?: string | string[] }
Fields
externalId
string
The identity the platform replaces by: a later object with the same id supersedes this document.
markdown
string
The document's text, chunked and embedded as markdown.
metadata?
DocumentMetadata
Scalars only, up to 16 keys, filterable at search time.
entities?
string[]
What the document is about, as your own ids, whether or not its text says so.
replaces?
string | string[]
External ids this document supersedes.
Emit with metadata
return documents([{ externalId: id, title, markdown, metadata: { section: 'world' } }]);