Skip to main content

formatQuery()

Call Signature

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:70

Call Signature

formatQuery(ruleGroup, options): ParameterizedSQL

Generates a ParameterizedSQL object from a query object.

Parameters

ParameterType
ruleGroupRuleGroupTypeAny
options"parameterized" | FormatQueryOptions & object

Returns

ParameterizedSQL

Defined in

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

Call Signature

formatQuery(ruleGroup, options): ParameterizedNamedSQL

Generates a ParameterizedNamedSQL object from a query object.

Parameters

ParameterType
ruleGroupRuleGroupTypeAny
options"parameterized_named" | FormatQueryOptions & object

Returns

ParameterizedNamedSQL

Defined in

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

Call Signature

formatQuery(ruleGroup, options): RQBJsonLogic

Generates a JsonLogic object from a query object.

Parameters

ParameterType
ruleGroupRuleGroupTypeAny
options"jsonlogic" | FormatQueryOptions & object

Returns

RQBJsonLogic

Defined in

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

Call Signature

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" | FormatQueryOptions & object

Returns

Record<string, any>

Defined in

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

Call Signature

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" | FormatQueryOptions & object

Returns

string

Defined in

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

Call Signature

formatQuery(ruleGroup, options): string

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

Parameters

ParameterType
ruleGroupRuleGroupTypeAny
optionsFormatQueryOptions

Returns

string

Defined in

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

Call Signature

formatQuery(ruleGroup, options): string

Generates a query string in the requested format.

Parameters

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

Returns

string

Defined in

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

Call Signature

formatQuery(ruleGroup, options): string

Generates a query string in the requested format.

Parameters

ParameterType
ruleGroupRuleGroupTypeAny
optionsFormatQueryOptions & object

Returns

string

Defined in

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


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.