1 | QueryEvery(query,closure) |
1 | queryObj.Every(closure) |
Parameter |
Required/Optional |
Description |
struct |
Required |
Query in which all values are to be searched. |
closure |
Required |
Function that encapsulates |
1 2 3 4 5 6 7 8 9 10 | < 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 > |
1 2 3 4 5 6 7 8 9 10 | < 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 > |