A class representing a client session on the server
NOTE: not meant to be instantiated directly.
Create a client session.
The current client's topology (Internal Class)
The server session pool (Internal Class)
Optional settings provided when creating a MongoClient
Sets or gets the default captureRejection value for all emitters.
This symbol shall be used to install a listener for only monitoring
events. Listeners installed using this symbol are called before the regular
'error' listeners are called.
Installing a listener using this symbol does not change the behavior once an
'error' event is emitted, therefore the process will still crash if no
'error' listener is installed.
The server id associated with this session
Whether or not this session is configured for snapshot reads
Advances the clusterTime for a ClientSession to the provided clusterTime of another ClientSession
the $clusterTime returned by the server from another session in the form of a document containing the
BSON.Timestamp clusterTime and signature
Advances the operationTime for a ClientSession.
BSON.Timestamp of the operation type it is desired to advance to
Used to determine if this session equals another
The session to compare to
whether this session is currently in a transaction or not
Increment the transaction number on the internal ServerSession
Starts a new transaction with the given options.
Options for the transaction
This is here to ensure that ClientSession is never serialized to BSON.
Runs a provided lambda within a transaction, retrying either the commit operation or entire transaction as needed (and when the error permits) to better ensure that the transaction can complete successfully.
IMPORTANT: This method requires the user to return a Promise, all lambdas that do not return a Promise will result in undefined behavior.
A lambda to run within a transaction
Optional settings for the transaction
Returns a list listener for a specific emitter event name.
Generated using TypeDoc