Methods
-
addToOperationsList(bulkOperation, docType, document){OrderedBulkOperation}
-
Add to internal list of Operations
Name Type Description bulkOperationOrderedBulkOperation docTypenumber number indicating the document type
documentobject -
addToOperationsList(bulkOperation, docType, document){UnorderedBulkOperation}
-
Add to internal list of Operations
Name Type Description bulkOperationUnorderedBulkOperation docTypenumber number indicating the document type
documentobject -
applySession(session, command, topology, options){MongoError|null}
-
Optionally decorate a command with sessions specific keys
Name Type Description sessionClientSession the session tracking transaction state
commandObject the command to decorate
topologyObject the topology for tracking the cluster time
optionsObject optional Optional settings passed to calling operation
Returns:
error, if some error condition was met
-
handleMongoWriteConcernError(batch, bulkResult, ordered, err, callback)
-
handles write concern error
Name Type Description batchobject bulkResultobject orderedboolean errWriteConcernError callbackfunction -
isRetryableError(error)
-
Determines whether an error is something the driver should attempt to retry
Name Type Description errorMongoError | 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.- See:
Properties:
Name Type Description level'local' | 'available' | 'majority' | 'linearizable' | 'snapshot' The readConcern Level
-
ReadConcernLevel'local' 'available' 'majority' 'linearizable' 'snapshot'
-
A string specifying the level of a ReadConcern
-
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 causalConsistencyboolean <optional>
true Whether causal consistency should be enabled on this session
defaultTransactionOptionsTransactionOptions <optional>
The default TransactionOptions to use for transactions started on this session.
-
TransactionOptionsObject
-
Configuration options for a transaction.
Properties:
Name Type Argument Description readConcernReadConcern <optional>
A default read concern for commands in this transaction
writeConcernWriteConcern <optional>
A default writeConcern for commands in this transaction
readPreferenceReadPreference <optional>
A default read preference for commands in this transaction
-
WithTransactionCallback(session){Promise}
-
A user provided function to be run within a transaction
Name Type Description sessionClientSession The parent session of the transaction running the operation. This should be passed into each operation within the lambda.
Returns:
resulting Promise of operations run within this transaction
-
WriteConcernObject
-
A MongoDB WriteConcern, which describes the level of acknowledgement
requested from MongoDB for write operations.- See:
Properties:
Name Type Argument Default Description wnumber | 'majority' | string <optional>
1 requests acknowledgement that the write operation has
propagated to a specified number of mongod hostsjboolean <optional>
false requests acknowledgement from MongoDB that the write operation has
been written to the journalwtimeoutnumber <optional>
a time limit, in milliseconds, for the write concern