@@ -25,46 +25,47 @@ import (
2525
2626// Find performs a find operation.
2727type Find struct {
28- authenticator driver.Authenticator
29- allowDiskUse * bool
30- allowPartialResults * bool
31- awaitData * bool
32- batchSize * int32
33- collation bsoncore.Document
34- comment * string
35- filter bsoncore.Document
36- hint bsoncore.Value
37- let bsoncore.Document
38- limit * int64
39- max bsoncore.Document
40- maxTime * time.Duration
41- min bsoncore.Document
42- noCursorTimeout * bool
43- oplogReplay * bool
44- projection bsoncore.Document
45- returnKey * bool
46- showRecordID * bool
47- singleBatch * bool
48- skip * int64
49- snapshot * bool
50- sort bsoncore.Document
51- tailable * bool
52- session * session.Client
53- clock * session.ClusterClock
54- collection string
55- monitor * event.CommandMonitor
56- crypt driver.Crypt
57- database string
58- deployment driver.Deployment
59- readConcern * readconcern.ReadConcern
60- readPreference * readpref.ReadPref
61- selector description.ServerSelector
62- retry * driver.RetryMode
63- result driver.CursorResponse
64- serverAPI * driver.ServerAPIOptions
65- timeout * time.Duration
66- omitCSOTMaxTimeMS bool
67- logger * logger.Logger
28+ authenticator driver.Authenticator
29+ allowDiskUse * bool
30+ allowPartialResults * bool
31+ awaitData * bool
32+ batchSize * int32
33+ collation bsoncore.Document
34+ comment * string
35+ filter bsoncore.Document
36+ hint bsoncore.Value
37+ let bsoncore.Document
38+ limit * int64
39+ max bsoncore.Document
40+ maxTime * time.Duration
41+ min bsoncore.Document
42+ noCursorTimeout * bool
43+ oplogReplay * bool
44+ projection bsoncore.Document
45+ returnKey * bool
46+ showRecordID * bool
47+ singleBatch * bool
48+ skip * int64
49+ snapshot * bool
50+ sort bsoncore.Document
51+ tailable * bool
52+ session * session.Client
53+ clock * session.ClusterClock
54+ collection string
55+ monitor * event.CommandMonitor
56+ crypt driver.Crypt
57+ database string
58+ deployment driver.Deployment
59+ readConcern * readconcern.ReadConcern
60+ readPreference * readpref.ReadPref
61+ selector description.ServerSelector
62+ retry * driver.RetryMode
63+ result driver.CursorResponse
64+ serverAPI * driver.ServerAPIOptions
65+ timeout * time.Duration
66+ omitCSOTMaxTimeMS bool
67+ logger * logger.Logger
68+ unsafeAllowSeperateMaxTimeMS bool
6869}
6970
7071// NewFind constructs and returns a new Find.
@@ -93,27 +94,28 @@ func (f *Find) Execute(ctx context.Context) error {
9394 }
9495
9596 return driver.Operation {
96- CommandFn : f .command ,
97- ProcessResponseFn : f .processResponse ,
98- RetryMode : f .retry ,
99- Type : driver .Read ,
100- Client : f .session ,
101- Clock : f .clock ,
102- CommandMonitor : f .monitor ,
103- Crypt : f .crypt ,
104- Database : f .database ,
105- Deployment : f .deployment ,
106- MaxTime : f .maxTime ,
107- ReadConcern : f .readConcern ,
108- ReadPreference : f .readPreference ,
109- Selector : f .selector ,
110- Legacy : driver .LegacyFind ,
111- ServerAPI : f .serverAPI ,
112- Timeout : f .timeout ,
113- Logger : f .logger ,
114- Name : driverutil .FindOp ,
115- OmitCSOTMaxTimeMS : f .omitCSOTMaxTimeMS ,
116- Authenticator : f .authenticator ,
97+ CommandFn : f .command ,
98+ ProcessResponseFn : f .processResponse ,
99+ RetryMode : f .retry ,
100+ Type : driver .Read ,
101+ Client : f .session ,
102+ Clock : f .clock ,
103+ CommandMonitor : f .monitor ,
104+ Crypt : f .crypt ,
105+ Database : f .database ,
106+ Deployment : f .deployment ,
107+ MaxTime : f .maxTime ,
108+ ReadConcern : f .readConcern ,
109+ ReadPreference : f .readPreference ,
110+ Selector : f .selector ,
111+ Legacy : driver .LegacyFind ,
112+ ServerAPI : f .serverAPI ,
113+ Timeout : f .timeout ,
114+ Logger : f .logger ,
115+ Name : driverutil .FindOp ,
116+ OmitCSOTMaxTimeMS : f .omitCSOTMaxTimeMS ,
117+ Authenticator : f .authenticator ,
118+ UnsafeAllowSeperateMaxTimeMS : f .unsafeAllowSeperateMaxTimeMS ,
117119 }.Execute (ctx )
118120
119121}
@@ -587,3 +589,13 @@ func (f *Find) Authenticator(authenticator driver.Authenticator) *Find {
587589 f .authenticator = authenticator
588590 return f
589591}
592+
593+ // UnsafeAllowSeperateMaxTimeMS allows CSOT with independent maxTimeMS.
594+ func (f * Find ) UnsafeAllowSeperateMaxTimeMS (val bool ) * Find {
595+ if f == nil {
596+ f = new (Find )
597+ }
598+
599+ f .unsafeAllowSeperateMaxTimeMS = val
600+ return f
601+ }
0 commit comments