Class: ClientSession

ClientSession

A class representing a client session on the server
WARNING: not meant to be instantiated directly.

Members

The server id associated with this session

Methods

abortTransaction(callback){Promise}

Aborts the currently active transaction in this session.

Name Type Description
callback function optional

optional callback for completion of this operation

Returns:
promise is returned if no callback is provided

advanceOperationTime(operationTime)

Advances the operationTime for a ClientSession.

Name Type Description
operationTime Timestamp

the BSON.Timestamp of the operation type it is desired to advance to

commitTransaction(callback){Promise}

Commits the currently active transaction in this session.

Name Type Description
callback function optional

optional callback for completion of this operation

Returns:
promise is returned if no callback is provided

endSession(options, callback)

Ends this session on the server

Name Type Description
options Object optional

Optional settings. Currently reserved for future use

callback function optional

Optional callback for completion of this operation

Used to determine if this session equals another

Name Type Description
session ClientSession
Returns:
if the sessions are equal

incrementTransactionNumber()

Increment the transaction number on the internal ServerSession

Returns:
this session is currently in a transaction or not

Starts a new transaction with the given options.

Name Type Description
options TransactionOptions

Options for the transaction