php8.5
Home/ Manual/ driver / session/ MongoDB\Driver\Session::advanceOperationTime

MongoDB\Driver\Session::advanceOperationTime

PHP function Edit on GitHub ✎

(mongodb >=1.4.0)

Advances the operation time for this session

Description

MongoDB\Driver\Session::advanceOperationTime(MongoDB\BSON\TimestampInterface $operationTime): void

Advances the operation time for this session. If the operation time is less than or equal to the session's current operation time, this function is a no-op.

By using this method in conjunction with MongoDB\Driver\Session::advanceClusterTime to copy the operation and cluster times from another session, you can ensure that operations in this session are causally consistent with the last operation in the other session.

Parameters

operationTime

The operation time is a logical timestamp. Typically, this value will be obtained by calling MongoDB\Driver\Session::getOperationTime on another session object.

Return Values

Void

Errors/Exceptions

See Also

  • MongoDB\Driver\Session::advanceClusterTime
  • MongoDB\Driver\Session::getClusterTime

Source: reference/mongodb/mongodb/driver/session/advanceoperationtime.xml · from the official PHP manual (php/doc-en)