@@ -103,6 +103,7 @@ class ClientSession extends TypedEventEmitter<ClientSessionEvents> {
103
103
transaction : Transaction ;
104
104
/** @internal */
105
105
[ kServerSession ] ?: ServerSession ;
106
+ /** @internal */
106
107
[ kSnapshotTime ] ?: Timestamp ;
107
108
/** @internal */
108
109
[ kSnapshotEnabled ] = false ;
@@ -140,13 +141,10 @@ class ClientSession extends TypedEventEmitter<ClientSessionEvents> {
140
141
141
142
this [ kSnapshotEnabled ] = true ;
142
143
if ( options . causalConsistency === true ) {
143
- // TODO: throw validation error; MongoDriverError or more specific
144
144
throw new MongoDriverError (
145
145
'Properties "causalConsistency" and "snapshot" are mutually exclusive'
146
146
) ;
147
147
}
148
-
149
- // TODO(NODE-3394): also validate server version >= 5.0
150
148
}
151
149
152
150
this . topology = topology ;
@@ -283,7 +281,6 @@ class ClientSession extends TypedEventEmitter<ClientSessionEvents> {
283
281
*/
284
282
startTransaction ( options ?: TransactionOptions ) : void {
285
283
if ( this [ kSnapshotEnabled ] ) {
286
- // TODO: should this be a different type?
287
284
throw new MongoDriverError ( 'Transactions are not allowed with snapshot sessions' ) ;
288
285
}
289
286
@@ -849,7 +846,7 @@ function applySession(
849
846
command . readConcern = command . readConcern || { } ;
850
847
Object . assign ( command . readConcern , { afterClusterTime : session . operationTime } ) ;
851
848
} else if ( session [ kSnapshotEnabled ] ) {
852
- command . readConcern = command . readConcern || { level : ReadConcernLevel . snapshot } ; // TODO: is there a better place to set this?
849
+ command . readConcern = command . readConcern || { level : ReadConcernLevel . snapshot } ;
853
850
if ( session [ kSnapshotTime ] !== undefined ) {
854
851
Object . assign ( command . readConcern , { atClusterTime : session [ kSnapshotTime ] } ) ;
855
852
}
0 commit comments