Page History
...
This function determines whether an instance of a specified entity exists, optionally meeting certain criteria.
Syntax
Code Block |
---|
EXISTS instances [WHERE condition] |
- instances - Instances to search.
- condition - boolean expression that represents the criterion the instance has to meet.
Return type
- boolean
Examples
Suppose the following data model.
Person.name | Person.gender | Person.age |
---|---|---|
“Kim” | “f” | 23 |
“Rick” | “m” | 35 |
“Bob” | “m” | 42 |
“John” | “m” | 19 |
“Mary” | “f” | 33 |
EXISTS Person
= TRUEEXISTS Person WHERE (Person.age < 18)
= FALSEEXISTS Person WHERE (Person.gender = “m” AND Person.age > 35)
= TRUE
UI Text Box | ||
---|---|---|
| ||
The return value of a boolean can be |
Section | ||||||||
---|---|---|---|---|---|---|---|---|
|
EACH
This function determines whether all instances of a specified entity meet a certain criteria
Syntax
Code Block |
---|
EACH instances WHERE condition |
- instances - A collection of instances to search.
- condition - Boolean expression that represents the criterion the instance has to meet.
Return type
- boolean
Examples
Suppose the following data model.
Person.name | Person.gender | Person.age |
---|---|---|
“Kim” | “f” | 23 |
“Rick” | “m” | 35 |
“Bob” | “m” | 42 |
“John” | “m” | 19 |
“Mary” | “f” | 33 |
EACH Person WHERE (Person.age < 18)
= FALSEEACH Person WHERE (Person.age > 18)
= TRUEEACH Person WHERE (Person.age < 20)
= FALSEEACH Person WHERE (Person.gender = “m” OR Person.age > 35)
= FALSEEACH Person WHERE (Person.gender = “m” OR Person.age > 20)
= TRUE
...
Overview
Content Tools