subset
The members of a set or a list whose field has a value: `subset(items, "kind", "book")`; more key and value pairs narrow it further. A cloud set is filtered on the server and stays a set; a list is filtered where it is and gives a list. Values are compared as the stores compare them: numbers numerically, else as text.
Runs on: either side: the compiler places the statement that calls it where the values it uses live.
Format:
subset(set_or_list, key, value [, key2, value2 ...])
Parameters:
| Parameter | Type | Description |
|---|---|---|
| set_or_list | mixed | the cloud set, or the list of records |
| key | string | the field name |
| value | mixed | the value the field must have |
Returned Value:
| Type | Description |
|---|---|
| mixed | the subset (a set) or the matching members (a list) |
Examples
books = subset(cloudobjects_of_type("item"), "kind", "book")
mine = subset(rows, "owner", me)