On this page本页内容
Mongo.
startSession
(<options>)¶New in version 3.6.版本3.6中的新功能。
Starts a session for the connection. The mongo
shell assigns the session id to commands associated with the session.
The startSession()
method can take a document with session options. The options available are:
causalConsistency | Boolean. Enables or disables causal consistency for the session. After starting a session, you cannot modify its Note The session may have causal consistency enabled even though the |
readConcern | Document. Specifies the read concern. To modify the setting after starting a session, see |
readPreference | Document. Specifies the read preference. The readPreference document contains the To modify the setting after starting a session, see |
retryWrites | Boolean. Enables or disables the ability to retry writes upon encountering transient network errors. If you start the After starting a session, you cannot modify its |
writeConcern | Document. Specifies the write concern. To modify the setting after starting a session, see |