MongoDB\Driver\Manager
PHP Manual

MongoDB\Driver\Manager::startSession

(mongodb >=1.4.0)

MongoDB\Driver\Manager::startSessionStart a new client session for use with this client

说明

final public MongoDB\Driver\Session MongoDB\Driver\Manager::startSession ([ array $options ] )

Creates a MongoDB\Driver\Session for the given options. The session may then be specified when executing commands, queries, and write operations.

Note: A MongoDB\Driver\Session can only be used with the MongoDB\Driver\Manager from which it was created.

参数

options

options
Option Type Description Default
causalConsistency boolean

Configure causal consistency in a session. If TRUE, each operation in the session will be causally ordered after the previous read or write operation. Set to FALSE to disable causal consistency.

See » Casual Consistency in the MongoDB manual for more information.

TRUE

返回值

Returns a MongoDB\Driver\Session.

错误/异常

参见


MongoDB\Driver\Manager
PHP Manual