QueryEvery(query,closure)
queryObj.Every(closure)
Parameter |
Required/Optional |
Description |
struct |
Required |
Query in which all values are to be searched. |
closure |
Required |
Function that encapsulates |
<cfscript> myQuery=queryNew([ {"Id":101,"Name":"John Adams","Contract":"Permanent"}, {"Id":102,"Name":"Jason Adams","Contract":"Temp"}, {"Id":103,"Name":"Jack Adams","Contract":"Temp"}, {"Id":104,"Name":"James Adams","Contract":"Permanent"} ]); doesPersonExist=(obj)=>return obj.contract=="Permanent" writeOutput(QueryEvery(myquery,doesPersonExist)) // Returns False </cfscript>
<cfscript> myQuery=queryNew([ {"Id":101,"Name":"John Adams","Contract":"Permanent"}, {"Id":102,"Name":"Jason Adams","Contract":"Permanent"}, {"Id":103,"Name":"Jack Adams","Contract":"Permanent"}, {"Id":104,"Name":"James Adams","Contract":"Permanent"} ]); doesPersonExist=(obj)=>return obj.contract=="Permanent" writeOutput(QueryEvery(myquery,doesPersonExist)) // Returns True </cfscript>