Class BulkV2<S>

Type Parameters

Constructors

Properties

pollInterval: number = 1000

Polling interval in milliseconds

Default: 1000 (1 second)

pollTimeout: number = 30000

Polling timeout in milliseconds

Default: 30000 (30 seconds)

Methods

  • Create an instance of an ingest job object.

    Parameters

    • options: NewIngestJobOptions

    Returns IngestJobV2<S>

    An ingest job instance

    Params

    options object

    Example

    // Upsert records to the Account object.

    const job = connection.bulk2.createJob({
    operation: 'insert'
    object: 'Account',
    });

    // create the job in the org
    await job.open()

    // upload data
    await job.uploadData(csvFile)

    // finished uploading data, mark it as ready for processing
    await job.close()
  • Create, upload, and start bulkload job

    Parameters

    • options: Required<Pick<JobInfoV2, "object" | "operation">> & Partial<Pick<JobInfoV2, "assignmentRuleId" | "lineEnding" | "columnDelimiter" | "contentType" | "externalIdFieldName">> & Partial<BulkV2PollingOptions> & {
          input: string | Readable | Record[];
      }

    Returns Promise<IngestJobV2Results<S>>

  • Execute bulk query and get a record stream.

    Default timeout: 10000ms

    Parameters

    • soql: string

      SOQL query

    • Optional options: Partial<BulkV2PollingOptions> & {
          columnDelimiter?: "BACKQUOTE" | "CARET" | "COMMA" | "PIPE" | "SEMICOLON" | "TAB";
          lineEnding?: "LF" | "CRLF";
          scanAll?: boolean;
      }

    Returns Promise<Parsable<Record>>

    • Record stream, convertible to a CSV data stream