Simplest way to convert a query to array of structs?

Gosh it would be elegant if this worked, but the closure function doesn’t have access to the global scope like a normal closure does :confused:

an_array = [];

a_query.each(function(row){
    an_array.append(row);
}); 

What version of Lucee are you using? That approach does work.

You can run an example here: https://trycf.com/gist/a73ff40ccc5ec0f01d91aa9bfc81043f/lucee5?theme=monokai

You could also return an array of structs from the original query execution. See: https://cfdocs.org/queryexecute#collapseEx9

Doh. Brain fart on my part. Thanks for the sanity check :wink: