Skip to content

JSONPath Tools / @jsonpath-tools/jsonpath / QueryContext

Interface: QueryContext

Context of a query evaluation.

Properties

argument

ts
readonly argument: JSONValue;

Query argument.


filterExpressionInstrumentationCallback()?

ts
readonly optional filterExpressionInstrumentationCallback: (filterExpression, output) => void;

Callback called every time a FilterExpression is evaluated.

Parameters

filterExpression

FilterExpression

Filter expression.

output

FilterValue

Output value.

Returns

void


options

ts
readonly options: QueryOptions;

Query options.


queryInstrumentationCallback()?

ts
readonly optional queryInstrumentationCallback: (query, input, outputArray, outputStartIndex, outputLength) => void;

Callback called every time a SubQuery is evaluated.

Parameters

query

SubQuery

Query.

input

Node

Input node.

outputArray

IndexOnlyArray<Node>

Output nodes array. It can also contain unrelated nodes, refer to outputStartIndex and outputLength.

outputStartIndex

number

Start index of the relevant part in outputArray.

outputLength

number

Length of the relevant part in outputArray.

Returns

void


reportDiagnosticsCallback()?

ts
readonly optional reportDiagnosticsCallback: (diagnostics) => void;

Callback called every time a runtime diagnostics is reported.

Parameters

diagnostics

Diagnostics

Diagnostics.

Returns

void


segmentInstrumentationCallback()?

ts
readonly optional segmentInstrumentationCallback: (segment, input, outputArray, outputStartIndex, outputLength) => void;

Callback called every time a Segment is evaluated.

Parameters

segment

Segment

Segment.

input

Node

Input node.

outputArray

IndexOnlyArray<Node>

Output nodes array. It can also contain unrelated nodes, refer to outputStartIndex and outputLength.

outputStartIndex

number

Start index of the relevant part in outputArray.

outputLength

number

Length of the relevant part in outputArray.

Returns

void


selectorInstrumentationCallback()?

ts
readonly optional selectorInstrumentationCallback: (selector, input, outputArray, outputStartIndex, outputLength) => void;

Callback called every time a Selector is evaluated.

Parameters

selector

Selector

Selector.

input

Node

Input node.

outputArray

IndexOnlyArray<Node>

Output nodes array. It can also contain unrelated nodes, refer to outputStartIndex and outputLength.

outputStartIndex

number

Start index of the relevant part in outputArray.

outputLength

number

Length of the relevant part in outputArray.

Returns

void