subset
subset
returns a cloud set with a subset of the given set, filtered by the key / value pairs.
Only cloudobjects from the parent set whose components match the given key/value pairs will be included in the subset
subset(parent_set, key, value [,keyN,valueN] ...)
Parameters:
| Parameter |
Type |
Description |
| parent_set |
cloudset |
The set of object from which the subset will be selected |
| key |
string |
the key of a component whose value we will be filtering on |
| value |
mixed |
the value of component key1 being searched. Only cloudobjects from the parent set whose key1 component is equal to this value will be included in the subset |
| keyN |
string |
 [Optional]optional additional key. |
| valueN |
mixed |
 [Optional]optional additional value |
Returned Value:
| Type |
Description |
| cloudset |
the resulting filtered set |
Examples
things = cloudobjects_of_type("thing")
special_things = subset(things,"is_special",true)
things_in_usa = subset(things,"country","USA")
special_things = subset(things,"is_special",true, "is_a_thing",true)