Array Filter
The Array Filter node allows you to filter arrays, and select keys, and sort by a key, and also randomize with bogosort.
Basic Syntax
property.name
- Access object propertyarray[0]
- Access array element by indexarray[1:4]
- Get range from index 1 to 3 (inclusive:exclusive)array[*]
- Get all elements in arrayarray[?key=value]
- Filter array by propertyarray[?key1=value1&key2=value2]
- Filter with multiple AND conditionsarray[?key1=value1|key2=value2]
- Filter with multiple OR conditionsarray.sort(key)
- Sort array by a specified key
Examples
users[0].name
- Get first user's nameusers[1:3]
- Get users at index 1 and 2users[*].skills[0]
- Get first skill of all usersusers[?active=true].name
- Get names of active usersusers[?active=true&name="Alice"]
- Get users who are active AND named Aliceusers[?active=true|name="Bob"]
- Get users who are active OR named Bobsettings.preferences[*]
- Get all preferencesusers[2:4].[name,skills].sort(name)
- Select specific keys (name and skills) from users at index 2 and 3, then sort by nameusers[*].name.bogosort()
- Get all user names and apply random shuffling
Display Options
- Show single array items as objects - When enabled, arrays with only one item will be displayed as just that item
- Preserve object structure - When enabled, property access will return objects with the property name and value instead of just the value
- Merge similar arrays - When enabled, arrays of arrays will be flattened into a single array