Class: Bulk

Bulk

new Bulk(conn)

Class for Bulk API
Parameters:
Name Type Description
conn Connection Connection object
Source:

Classes

Batch
Job

Members

pollInterval :Number

Polling interval in milliseconds
Type:
  • Number
Source:

pollTimeout :Number

Polling timeout in milliseconds
Type:
  • Number
Source:

Methods

createJob(type, operation, optionsopt) → {Bulk~Job}

Create a new job instance
Parameters:
Name Type Attributes Description
type String SObject type
operation String Bulk load operation ('insert', 'update', 'upsert', 'delete', 'hardDelete', or 'query')
options Object <optional>
Options for bulk loading operation
Source:
Returns:
Type
Bulk~Job

job(jobId) → {Bulk~Job}

Get a job instance specified by given job ID
Parameters:
Name Type Description
jobId String Job ID
Source:
Returns:
Type
Bulk~Job

load(type, operation, optionsopt, inputopt, callbackopt) → {Bulk~Batch}

Create and start bulkload job and batch
Parameters:
Name Type Attributes Description
type String SObject type
operation String Bulk load operation ('insert', 'update', 'upsert', 'delete', or 'hardDelete')
options Object <optional>
Options for bulk loading operation
Properties
Name Type Attributes Description
extIdField String <optional>
External ID field name (used when upsert operation).
concurrencyMode String <optional>
'Serial' or 'Parallel'. Defaults to Parallel.
input Array.<Record> | stream.Stream | String <optional>
Input source for bulkload. Accepts array of records, CSV string, and CSV data input stream in insert/update/upsert/delete/hardDelete operation, SOQL string in query operation.
callback Callback.<(Array.<RecordResult>|Array.<Bulk~BatchResultInfo>)> <optional>
Callback function
Source:
Returns:
Type
Bulk~Batch

query(soql) → {RecordStream.Parsable}

Execute bulk query and get record stream
Parameters:
Name Type Description
soql String SOQL to execute in bulk job
Source:
Returns:
- Record stream, convertible to CSV data stream
Type
RecordStream.Parsable

Type Definitions

BatchInfo

Type:
  • Object
Properties:
Name Type Description
id String Batch ID
jobId String Job ID
state String Batch state
stateMessage String Batch state message
Source:

BatchResultInfo

Type:
  • Object
Properties:
Name Type Description
id String Batch result ID
batchId String Batch ID which includes this batch result.
jobId String Job ID which includes this batch result.
Source:

JobInfo

Type:
  • Object
Properties:
Name Type Description
id String Job ID
object String Object type name
operation String Operation type of the job
state String Job status
Source: