jsforce
    Preparing search index...

    Class BulkV2<S>

    Type Parameters

    Index
    pollInterval: number = 1000

    Polling interval in milliseconds

    Default: 1000 (1 second)

    pollTimeout: number = 30000

    Polling timeout in milliseconds

    Default: 30000 (30 seconds)

    • Create an instance of an ingest job object.

      Parameters

      • options: NewIngestJobOptions

      Returns IngestJobV2<S>

      An ingest job instance

      options object

      // 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()
    • Get an ingest or query job instance specified by a given job ID

      Parameters

      • type: "query"
      • options: Pick<ExistingQueryJobV2Options, "id">

        Options object with a job ID

      Returns QueryJobV2<S>

      IngestJobV2 An ingest job

    • Get an ingest or query job instance specified by a given job ID

      Parameters

      • type: "ingest"
      • options: Pick<ExistingIngestJobOptions, "id">

        Options object with a job ID

      Returns IngestJobV2<S>

      IngestJobV2 An ingest job

    • 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

      • Optionaloptions: 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