You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- Create a person for everyone in the array where the number is lower than or equal to 5
LET $num = [1,2,3,4,5,6,7,8,9];
FOR $thing IN $num {
IF $thing > 5{
BREAK;
} ELSE IF $thing < 5 {
CREATE type::thing(
'person', $thing
) CONTENT {
name: $thing
};
};
};
Description
here https://surrealdb.com/docs/surrealdb/surrealql/statements/break is a wrong example, it do nothing cause break on first value (1 is less than 2)
My suggestion:
`
-- Create a person for everyone in the array where the number is lower than or equal to 5
LET $num = [1,2,3,4,5,6,7,8,9];
FOR $thing IN $num {
IF $thing > 5 {
BREAK;
};
CREATE type::thing(
'person', $thing
) CONTENT {
name: $thing
};
};
`
Is there an existing issue for this?
Code of Conduct
The text was updated successfully, but these errors were encountered: