@@ -55,10 +55,6 @@ type FindOptions struct {
55
55
// MaxAwaitTime is the maximum amount of time that the server should wait for new documents to satisfy a tailable cursor
56
56
// query. This option is only valid for tailable await cursors (see the CursorType option for more information) and
57
57
// MongoDB versions >= 3.2. For other cursor types or previous server versions, this option is ignored.
58
- //
59
- // Deprecated: This option is deprecated and will eventually be removed in version 2.0 of the driver. The more general
60
- // Timeout option should be used in its place to control the amount of time that the Find operation can run before
61
- // returning an error. MaxAwaitTime is still usable through the deprecated setter.
62
58
MaxAwaitTime * time.Duration
63
59
64
60
// MaxTime is the maximum amount of time that the query can run on the server. The default value is nil, meaning that there
@@ -181,10 +177,6 @@ func (f *FindOptions) SetMax(max interface{}) *FindOptions {
181
177
}
182
178
183
179
// SetMaxAwaitTime sets the value for the MaxAwaitTime field.
184
- //
185
- // Deprecated: This option is deprecated and will eventually be removed in version 2.0 of the driver.
186
- // The more general Timeout option should be used in its place to control the amount of time that the
187
- // Find operation can run before returning an error.
188
180
func (f * FindOptions ) SetMaxAwaitTime (d time.Duration ) * FindOptions {
189
181
f .MaxAwaitTime = & d
190
182
return f
@@ -377,6 +369,10 @@ type FindOneOptions struct {
377
369
378
370
// The maximum amount of time that the query can run on the server. The default value is nil, meaning that there
379
371
// is no time limit for query execution.
372
+ //
373
+ // Deprecated: This option is deprecated and will eventually be removed in version 2.0 of the driver. The more general
374
+ // Timeout option should be used in its place to control the amount of time that the FindOne operation can run before
375
+ // returning an error. MaxTime is still usable through the deprecated setter.
380
376
MaxTime * time.Duration
381
377
382
378
// A document specifying the inclusive lower bound for a specific index. The default value is 0, which means that
@@ -481,6 +477,10 @@ func (f *FindOneOptions) SetMaxAwaitTime(d time.Duration) *FindOneOptions {
481
477
}
482
478
483
479
// SetMaxTime sets the value for the MaxTime field.
480
+ //
481
+ // Deprecated: This option is deprecated and will eventually be removed in version 2.0 of the driver. The more general
482
+ // Timeout option should be used in its place to control the amount of time that the FindOne operation can run before
483
+ // returning an error.
484
484
func (f * FindOneOptions ) SetMaxTime (d time.Duration ) * FindOneOptions {
485
485
f .MaxTime = & d
486
486
return f
@@ -633,6 +633,10 @@ type FindOneAndReplaceOptions struct {
633
633
634
634
// The maximum amount of time that the query can run on the server. The default value is nil, meaning that there
635
635
// is no time limit for query execution.
636
+ //
637
+ // Deprecated: This option is deprecated and will eventually be removed in version 2.0 of the driver. The more general
638
+ // Timeout option should be used in its place to control the amount of time that the FindOneAndReplace operation can
639
+ // run before returning an error. MaxTime is still usable through the deprecated setter.
636
640
MaxTime * time.Duration
637
641
638
642
// A document describing which fields will be included in the document returned by the operation. The default value
@@ -691,6 +695,10 @@ func (f *FindOneAndReplaceOptions) SetComment(comment interface{}) *FindOneAndRe
691
695
}
692
696
693
697
// SetMaxTime sets the value for the MaxTime field.
698
+ //
699
+ // Deprecated: This option is deprecated and will eventually be removed in version 2.0 of the driver. The more general
700
+ // Timeout option should be used in its place to control the amount of time that the FindOneAndReplace operation can
701
+ // run before returning an error.
694
702
func (f * FindOneAndReplaceOptions ) SetMaxTime (d time.Duration ) * FindOneAndReplaceOptions {
695
703
f .MaxTime = & d
696
704
return f
@@ -799,6 +807,10 @@ type FindOneAndUpdateOptions struct {
799
807
800
808
// The maximum amount of time that the query can run on the server. The default value is nil, meaning that there
801
809
// is no time limit for query execution.
810
+ //
811
+ // Deprecated: This option is deprecated and will eventually be removed in version 2.0 of the driver. The more general
812
+ // Timeout option should be used in its place to control the amount of time that the FindOneAndUpdate operation can run
813
+ // before returning an error. MaxTime is still usable through the deprecated setter.
802
814
MaxTime * time.Duration
803
815
804
816
// A document describing which fields will be included in the document returned by the operation. The default value
@@ -863,6 +875,10 @@ func (f *FindOneAndUpdateOptions) SetComment(comment interface{}) *FindOneAndUpd
863
875
}
864
876
865
877
// SetMaxTime sets the value for the MaxTime field.
878
+ //
879
+ // Deprecated: This option is deprecated and will eventually be removed in version 2.0 of the driver. The more general
880
+ // Timeout option should be used in its place to control the amount of time that the FindOneAndUpdate operation can run
881
+ // before returning an error.
866
882
func (f * FindOneAndUpdateOptions ) SetMaxTime (d time.Duration ) * FindOneAndUpdateOptions {
867
883
f .MaxTime = & d
868
884
return f
@@ -963,6 +979,10 @@ type FindOneAndDeleteOptions struct {
963
979
964
980
// The maximum amount of time that the query can run on the server. The default value is nil, meaning that there
965
981
// is no time limit for query execution.
982
+ //
983
+ // Deprecated: This option is deprecated and will eventually be removed in version 2.0 of the driver. The more general
984
+ // Timeout option should be used in its place to control the amount of time that the FindOneAndDelete operation can run
985
+ // before returning an error. MaxTime is still usable through the deprecated setter.
966
986
MaxTime * time.Duration
967
987
968
988
// A document describing which fields will be included in the document returned by the operation. The default value
@@ -1007,6 +1027,10 @@ func (f *FindOneAndDeleteOptions) SetComment(comment interface{}) *FindOneAndDel
1007
1027
}
1008
1028
1009
1029
// SetMaxTime sets the value for the MaxTime field.
1030
+ //
1031
+ // Deprecated: This option is deprecated and will eventually be removed in version 2.0 of the driver. The more general
1032
+ // Timeout option should be used in its place to control the amount of time that the FindOneAndDelete operation can run
1033
+ // before returning an error.
1010
1034
func (f * FindOneAndDeleteOptions ) SetMaxTime (d time.Duration ) * FindOneAndDeleteOptions {
1011
1035
f .MaxTime = & d
1012
1036
return f
0 commit comments