Query Statement Execution

To execute a query and specify how a query returns values, you can use either of the execute functions.

The following are the available execute functions:

  • Query.Statement.execute() provides results using a result set. This function is used for snapshot queries only.
  • Query.Statement.executeWithCallback() provides results using a callback rule function, which is called once for each matching result. This function can be used with snapshot or continuous queries.
  • Query.Statement.executeWithBatchCallback() provides results using a callback rule function, which is called once at the end of each batch of results. This function can be used only with continuous queries.