This topic describes the query command in gfsh, the VMware GemFire command-line interface.

Use this command to run queries against GemFire regions.

If a limit restricting the result size is not set in the query, then a default limit of the gfsh environment variable APP_FETCH_SIZE is applied. APP_FETCH_SIZEis defined in Useful gfsh Shell Variables,

When using this command, surround the OQL query with single quotation marks.

Note: This command should not be executed from gfsh if the objects being queried contain cyclic references.

Availability: Online. You must be connected in gfsh to a JMX Manager member to use this command.

Syntax:

query --query=value [--file=path/to/results/file] [--member=member-name]

Name Description
‑‑query Required. The OQL string
‑‑file When specified, all query results are written to the specified file. An error is issued if the file already exists.
‑‑member Name/Id of the member on which to execute the query (as shown in the output of the gfsh describe region command, for example)

Sample Output:

gfsh>query --query='SELECT * FROM /region2'

Result     : true
startCount : 0
endCount   : 20
Rows       : 1

Result
-----------------
('Hello World!!')

NEXT_STEP_NAME : END
check-circle-line exclamation-circle-line close-line
Scroll to top icon