Back to top
Documentation SurrealQL Statements BREAK statement

BREAK statement

The BREAK statement can be used to break out of a loop, like the FOR-statement.

Statement syntax

BREAK

Example usage

The following query shows example usage of this statement.

-- Create a person for everyone in the array
FOR $num IN [1, 2, 3, 4, 5, 6, 7, 8, 9] {
	IF ($num > 5) {
		BREAK;
	};
};