CollectionFilter()
This function creates a new collection that returns all entries from an collection that match the given filter.
CollectionFilter( collection=object, filter=function, parallel=boolean, maxThreads=number );
Returns: object
Examples
people = [ { name = "Alice", age = 32 }, { name = "Bob", age = 29 }, { name = "Eve", age = 41 }];
dump(CollectionFilter(people, function(p) { return p.age > 30; }));
// member function
dump(people.filter(function(p) { return p.age > 30; }));
See also
- Collections
- Search Issue Tracker
- Search Lucee Test Cases (good for further, detailed examples)