Class

OsduR2UpdateByQueryTask

OsduR2UpdateByQueryTask(osdu_service, data_partition)

Simple task to update records in batches based on a query and a transform functions

Constructor

# new OsduR2UpdateByQueryTask(osdu_service, data_partition)

Parameters:
Name Type Description
osdu_service OsduR2BaseService

An implementation of the OSDU service class to broker communication with the OSDU API services

data_partition string

The data partition against which requests will be made

View Source task/R2/updateByQuery.js, line 12

Methods

# async execute(transform_function) → {Object}

Execute the task, querying and updating in batches based on the set query parameters and the provided transform function

Parameters:
Name Type Description
transform_function TransformFunction

Function that accepts an OSDU record and the OSDU service and asynchronously returns the transformed record

View Source task/R2/updateByQuery.js, line 46

A summary of the performed task, including a list of the ids of transformed records transformedRecords, the total count of records for the query totalCount, the number of batches that succeeded batches, the last cursor used (if an error was encountered) lastCursor, and the error that was thrown (if encountered) error

Object

# setQuery(query_params) → {OsduR2UpdateByQueryTask}

Set the query parameters to be used for batched query requests

Parameters:
Name Type Description
query_params Object

Query parameters built using the OsduQueryBuilder

View Source task/R2/updateByQuery.js, line 28

Itself to allow chaining