Skip to main content

Class: JSONReader

A reader that reads JSON data and returns an array of Document objects. Supports various options to modify the output.

Extends

Constructors

new JSONReader()

new JSONReader(options): JSONReader

Parameters

options: JSONReaderOptions = {}

Returns

JSONReader

Overrides

FileReader.constructor

Defined in

packages/llamaindex/src/readers/JSONReader.ts:164

Methods

loadData()

loadData(filePath): Promise<Document<Metadata>[]>

Parameters

filePath: string

Returns

Promise<Document<Metadata>[]>

Inherited from

FileReader.loadData

Defined in

packages/core/schema/dist/index.d.ts:187


loadDataAsContent()

loadDataAsContent(content): Promise<Document<Metadata>[]>

Loads JSON data and returns an array of Document objects.

Parameters

content: Uint8Array

The JSON data as a Uint8Array.

Returns

Promise<Document<Metadata>[]>

A Promise that resolves to an array of Document objects.

Overrides

FileReader.loadDataAsContent

Defined in

packages/llamaindex/src/readers/JSONReader.ts:204


addMetaData()

static addMetaData(filePath): (doc, index) => void

Parameters

filePath: string

Returns

Function

Parameters

doc: Document<Metadata>

index: number

Returns

void

Inherited from

FileReader.addMetaData

Defined in

packages/core/schema/dist/index.d.ts:188