Important

Helios features are now enabled during weekly update windows and are no longer directly tied to SingleStore engine releases. Refer to the release notes to view the latest features available in your Helios cluster.

sql

On this page

Runs the specified SQL statement and returns the result as a cursor.

Syntax

db.runCommand({sql: <string>})

Example

The following example runs an OPTIMIZE TABLE command, where dbTest and mycollection are the names of the database and collection, respectively.

db.runCommand({ sql: "OPTIMIZE TABLE `dbTest`.`mycollection` FULL" });

Here's another example that runs a SELECT statement:

db.runCommand({ sql: "SELECT * FROM `dbTest`.`mycollection`" });

Last modified:

Was this article helpful?