File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -137,7 +137,8 @@ class ClientSession {
137137}
138138```
139139
140- Getting the value of ` snapshotTime ` on a non-snapshot session MUST raise an error.
140+ The ` snapshotTime ` field MUST be read-only; in APIs that expose ` snapshotTime ` with a getter, attempting to read it on a
141+ non-snapshot session MUST raise an error.
141142
142143Transactions are not allowed with snapshot sessions. Calling ` session.startTransaction(options) ` on a snapshot session
143144MUST raise an error.
@@ -270,6 +271,7 @@ C# driver will provide the reference implementation. The corresponding ticket is
270271
271272## Changelog
272273
274+ - 2025-12-17: Clarify snapshotTime semantics: the field is either read-only or validated.
273275- 2025-09-23: Exposed snapshotTime to applications.
274276- 2024-05-08: Migrated from reStructuredText to Markdown.
275277- 2021-06-15: Initial version.
Original file line number Diff line number Diff line change @@ -270,10 +270,20 @@ Snapshot sessions tests require server of version 5.0 or higher and replica set
270270
271271Snapshot sessions tests require server of version 5.0 or higher and replica set or a sharded cluster deployment.
272272
273- - Start a session by calling ` startSession ` on with ` snapshot = false ` .
273+ - Start a session by calling ` startSession ` with ` snapshot = false ` .
274+
275+ Drivers SHOULD implement one of the following approaches:
276+
277+ ** Approach 1: Validation (preferred if idiomatic)**
278+
274279- Try to access the session's snapshot time.
275280- Assert that a client side error was raised.
276281
282+ ** Approach 2: Ensure Read-Only (if error-returning getters are not idiomatic)**
283+
284+ - Attempt to mutate the session's ` snapshotTime ` field through any publicly accessible API.
285+ - Assert that the original session's ` snapshotTime ` remains unchanged.
286+
277287## Changelog
278288
279289- 2025-09-25: Added tests for snapshotTime.
You can’t perform that action at this time.
0 commit comments