Skip to main content

formatQuery()

formatQuery(ruleGroup)

formatQuery(ruleGroup): string

Generates a formatted (indented two spaces) JSON string from a query object.

Parameters

ParameterType
ruleGroupRuleGroupTypeAny

Returns

string

Defined in

packages/react-querybuilder/src/utils/formatQuery/formatQuery.ts:68

formatQuery(ruleGroup, options)

formatQuery(ruleGroup, options): ParameterizedSQL

Generates a ParameterizedSQL object from a query object.

Parameters

ParameterType
ruleGroupRuleGroupTypeAny
options"parameterized" | Omit<FormatQueryOptions, "format"> & object

Returns

ParameterizedSQL

Defined in

packages/react-querybuilder/src/utils/formatQuery/formatQuery.ts:72

formatQuery(ruleGroup, options)

formatQuery(ruleGroup, options): ParameterizedNamedSQL

Generates a ParameterizedNamedSQL object from a query object.

Parameters

ParameterType
ruleGroupRuleGroupTypeAny
options"parameterized_named" | Omit<FormatQueryOptions, "format"> & object

Returns

ParameterizedNamedSQL

Defined in

packages/react-querybuilder/src/utils/formatQuery/formatQuery.ts:79

formatQuery(ruleGroup, options)

formatQuery(ruleGroup, options): RQBJsonLogic

Generates a JsonLogic object from a query object.

Parameters

ParameterType
ruleGroupRuleGroupTypeAny
options"jsonlogic" | Omit<FormatQueryOptions, "format"> & object

Returns

RQBJsonLogic

Defined in

packages/react-querybuilder/src/utils/formatQuery/formatQuery.ts:88

formatQuery(ruleGroup, options)

formatQuery(ruleGroup, options): Record<string, any>

Generates an ElasticSearch query object from an RQB query object.

NOTE: Support for the ElasticSearch format is experimental. You may have better results exporting "sql" format then using ElasticSearch SQL.

Parameters

ParameterType
ruleGroupRuleGroupTypeAny
options"elasticsearch" | Omit<FormatQueryOptions, "format"> & object

Returns

Record<string, any>

Defined in

packages/react-querybuilder/src/utils/formatQuery/formatQuery.ts:99

formatQuery(ruleGroup, options)

formatQuery(ruleGroup, options): string

Generates a JSONata query string from an RQB query object.

NOTE: The parseNumbers option is recommended for this format.

Parameters

ParameterType
ruleGroupRuleGroupTypeAny
options"jsonata" | Omit<FormatQueryOptions, "format"> & object

Returns

string

Defined in

packages/react-querybuilder/src/utils/formatQuery/formatQuery.ts:109

formatQuery(ruleGroup, options)

formatQuery(ruleGroup, options): string

Generates a formatted (indented two spaces) JSON string from a query object.

Parameters

ParameterType
ruleGroupRuleGroupTypeAny
optionsOmit<FormatQueryOptions, "format">

Returns

string

Defined in

packages/react-querybuilder/src/utils/formatQuery/formatQuery.ts:116

formatQuery(ruleGroup, options)

formatQuery(ruleGroup, options): string

Generates a query string in the requested format.

Parameters

ParameterType
ruleGroupRuleGroupTypeAny
options"json" | "sql" | "json_without_ids" | "mongodb" | "cel" | "spel"

Returns

string

Defined in

packages/react-querybuilder/src/utils/formatQuery/formatQuery.ts:123

formatQuery(ruleGroup, options)

formatQuery(ruleGroup, options): string

Generates a query string in the requested format.

Parameters

ParameterType
ruleGroupRuleGroupTypeAny
optionsOmit<FormatQueryOptions, "format"> & object

Returns

string

Defined in

packages/react-querybuilder/src/utils/formatQuery/formatQuery.ts:133


caution

API documentation is generated from the latest commit on the main branch. It may be somewhat inconsistent with official releases of React Query Builder.