Global

Methods

addToOperationsList(bulkOperation, docType, document){UnorderedBulkOperation}

Add to internal list of Operations

Name Type Description
bulkOperation UnorderedBulkOperation
docType number

number indicating the document type

document object

addToOperationsList(bulkOperation, docType, document){OrderedBulkOperation}

Add to internal list of Operations

Name Type Description
bulkOperation OrderedBulkOperation
docType number

number indicating the document type

document object

executeBatch(bulkOperation, batch, options, callback)

Execute the command

Name Type Description
bulkOperation UnorderedBulkOperation
batch object
options object
callback function

executeBatches(bulkOperation, options, callback)

Execute all the commands

Name Type Description
bulkOperation UnorderedBulkOperation
options object
callback function

executeCommands(bulkOperation, options, callback)

Execute next write command in a chain

Name Type Description
bulkOperation OrderedBulkOperation
options object
callback function

handleMongoWriteConcernError(batch, bulkResult, ordered, err, callback)

handles write concern error

Name Type Description
batch object
bulkResult object
ordered boolean
err WriteConcernError
callback function

Determines whether an error is something the driver should attempt to retry

Name Type Description
error MongoError | Error

Type Definitions

ReadConcernObject

The MongoDB ReadConcern, which allows for control of the consistency and isolation properties
of the data read from replica sets and replica set shards.

Properties:
Name Type Description
level 'local' | 'available' | 'majority' | 'linearizable' | 'snapshot'

The readConcern Level

See:

SessionIdObject

A BSON document reflecting the lsid of a ClientSession

SessionOptionsObject

Options to pass when creating a Client Session

Properties:
Name Type Argument Default Description
causalConsistency boolean <optional>
true

Whether causal consistency should be enabled on this session

defaultTransactionOptions TransactionOptions <optional>

The default TransactionOptions to use for transactions started on this session.

TransactionOptionsObject

Configuration options for a transaction.

Properties:
Name Type Argument Description
readConcern ReadConcern <optional>

A default read concern for commands in this transaction

writeConcern WriteConcern <optional>

A default writeConcern for commands in this transaction

readPreference ReadPreference <optional>

A default read preference for commands in this transaction

WriteConcernObject

A MongoDB WriteConcern, which describes the level of acknowledgement
requested from MongoDB for write operations.

Properties:
Name Type Argument Default Description
w number | 'majority' | string <optional>
1

requests acknowledgement that the write operation has
propagated to a specified number of mongod hosts

j boolean <optional>
false

requests acknowledgement from MongoDB that the write operation has
been written to the journal

wtimeout number <optional>

a time limit, in milliseconds, for the write concern

See: