Class QueryMap
java.lang.Object
ortus.boxlang.runtime.bifs.BIF
ortus.boxlang.runtime.bifs.global.query.QueryMap
@BoxBIF(description="Transform query data using a callback function")
@BoxMember(type=QUERY)
public class QueryMap
extends BIF
-
Field Summary
Fields inherited from class ortus.boxlang.runtime.bifs.BIF
__functionName, __isMemberExecution, asyncService, cacheService, componentService, declaredArguments, functionService, interceptorService, logger, moduleService, runtime, schedulerService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription_invoke(IBoxContext context, ArgumentsScope arguments) This BIF will iterate over each row in the query and invoke the callback function for each item so you can do any operation on the row and return a new value that will be set at the same index in a new query.Methods inherited from class ortus.boxlang.runtime.bifs.BIF
announce, getDeclaredArguments, invoke
-
Constructor Details
-
QueryMap
public QueryMap()Constructor
-
-
Method Details
-
_invoke
This BIF will iterate over each row in the query and invoke the callback function for each item so you can do any operation on the row and return a new value that will be set at the same index in a new query. The callback function will be passed the row as a struct, the current row number (1-based), and the query itself.- If the callback requires strict arguments, it will only receive the row as a struct.
- If the callback does not require strict arguments, it will receive the row as a struct, the row number (1-based), and the query itself.
Parallel Execution
If theparallelargument is set to true, and nomax_threadsare sent, the map will be executed in parallel using a ForkJoinPool with parallel streams. Ifmax_threadsis specified, it will create a new ForkJoinPool with the specified number of threads to run the map in parallel, and destroy it after the operation is complete. Please note that this may not be the most efficient way to map, as it will create a new ForkJoinPool for each invocation of the BIF. You may want to consider using a shared ForkJoinPool for better performance.
-