Whatever message this page gives is out now! Go check it out!
querySome(query, function(row [, currentRow] [, query] ){} [, parallel] [, maxThreadCount])queryObj.Some(closure)Parameter | Required/Optional | Description |
query | Required | Query in which at least one value is to be searched. |
closure | Required | Function that encapsulates criteria. |
parallel | Optional | True if you want to enable parallel programming. |
maxThreadCount | Optional | The number of threads the function can execute. The number of threads must be between 1-50. If the value exceeds 50, there is an exception. |
<cfscript>
myQuery=queryNew([
{"Id":101,"Name":"John"},
{"Id":102,"Name":"Jason"},
{"Id":103,"Name":"Jack"},
{"Id":104,"Name":"James"}
]);
// First closure to check for Jim
doesPersonExist=(obj)=>return obj.name=="Jim"
writeOutput(QuerySome(myquery,doesPersonExist)) // Returns False
// Second closure to check for James
doesPersonExist=(obj)=>return obj.name=="James"
writeOutput("<br/>" & QuerySome(myquery,doesPersonExist)) // Returns True
</cfscript><cfscript>
myQuery=queryNew([
{"Id":101,"Name":"John"},
{"Id":102,"Name":"Jason"},
{"Id":103,"Name":"Jack"},
{"Id":104,"Name":"James"}
]);
// First closure to check for Jim
doesPersonExist=(obj)=>return obj.name=="Jim"
writeOutput(QuerySome(myquery,doesPersonExist)) // Returns False
// Second closure to check for James
doesPersonExist=(obj)=>return obj.name=="James"
writeOutput("" & QuerySome(myquery,doesPersonExist,true,5)) // Returns True
</cfscript>