Skip to content

Commit 3cd3fa5

Browse files
author
Isabella Siu
committed
GODRIVER-280 remove maxScan query option
Change-Id: I1ea0fa641ebf7b9fe5cce3e7fe30a2f29ea8f9df
1 parent fd9e1c0 commit 3cd3fa5

File tree

6 files changed

+0
-65
lines changed

6 files changed

+0
-65
lines changed

core/option/options.go

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ var (
227227
_ FindOptioner = (*OptHint)(nil)
228228
_ FindOptioner = (*OptLimit)(nil)
229229
_ FindOptioner = (*OptMaxAwaitTime)(nil)
230-
_ FindOptioner = (*OptMaxScan)(nil)
231230
_ FindOptioner = (*OptMaxTime)(nil)
232231
_ FindOptioner = (*OptMin)(nil)
233232
_ FindOptioner = (*OptNoCursorTimeout)(nil)
@@ -244,7 +243,6 @@ var (
244243
_ FindOneOptioner = (*OptComment)(nil)
245244
_ FindOneOptioner = (*OptHint)(nil)
246245
_ FindOneOptioner = (*OptMaxAwaitTime)(nil)
247-
_ FindOneOptioner = (*OptMaxScan)(nil)
248246
_ FindOneOptioner = (*OptMaxTime)(nil)
249247
_ FindOneOptioner = (*OptMin)(nil)
250248
_ FindOneOptioner = (*OptNoCursorTimeout)(nil)
@@ -597,23 +595,6 @@ func (opt OptMaxAwaitTime) String() string {
597595
return "OptMaxAwaitTime: " + strconv.FormatInt(int64(opt), 10)
598596
}
599597

600-
// OptMaxScan is for internal use.
601-
type OptMaxScan int64
602-
603-
// Option implements the Optioner interface.
604-
func (opt OptMaxScan) Option(d *bson.Document) error {
605-
d.Append(bson.EC.Int64("maxScan", int64(opt)))
606-
return nil
607-
}
608-
609-
func (OptMaxScan) findOption() {}
610-
func (OptMaxScan) findOneOption() {}
611-
612-
// String implements the Stringer interface.
613-
func (opt OptMaxScan) String() string {
614-
return "OptMaxScan: " + strconv.FormatInt(int64(opt), 10)
615-
}
616-
617598
// OptMaxTime is for internal use.
618599
type OptMaxTime time.Duration
619600

mongo/findopt/find.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -151,16 +151,6 @@ func (fb *FindBundle) MaxAwaitTime(d time.Duration) *FindBundle {
151151
return bundle
152152
}
153153

154-
// MaxScan adds an option to specify the max number of documents or index keys to scan.
155-
func (fb *FindBundle) MaxScan(i int64) *FindBundle {
156-
bundle := &FindBundle{
157-
option: MaxScan(i),
158-
next: fb,
159-
}
160-
161-
return bundle
162-
}
163-
164154
// MaxTime adds an option to specify the max time to allow the query to run.
165155
func (fb *FindBundle) MaxTime(d time.Duration) *FindBundle {
166156
bundle := &FindBundle{

mongo/findopt/findopt.go

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ var (
3131
_ Find = (*OptLimit)(nil)
3232
_ Find = (*OptMax)(nil)
3333
_ Find = (*OptMaxAwaitTime)(nil)
34-
_ Find = (*OptMaxScan)(nil)
3534
_ Find = (*OptMaxTime)(nil)
3635
_ Find = (*OptMin)(nil)
3736
_ Find = (*OptNoCursorTimeout)(nil)
@@ -50,7 +49,6 @@ var (
5049
_ One = (*OptHint)(nil)
5150
_ One = (*OptMax)(nil)
5251
_ One = (*OptMaxAwaitTime)(nil)
53-
_ One = (*OptMaxScan)(nil)
5452
_ One = (*OptMaxTime)(nil)
5553
_ One = (*OptMin)(nil)
5654
_ One = (*OptNoCursorTimeout)(nil)
@@ -149,12 +147,6 @@ func MaxAwaitTime(d time.Duration) OptMaxAwaitTime {
149147
return OptMaxAwaitTime(d)
150148
}
151149

152-
// MaxScan specifies the maximum number of documents or index keys to scan.
153-
// Find, One
154-
func MaxScan(i int64) OptMaxScan {
155-
return OptMaxScan(i)
156-
}
157-
158150
// MaxTime specifies the max time to allow the query to run.
159151
// Find, One, DeleteOne, ReplaceOne, UpdateOne
160152
func MaxTime(d time.Duration) OptMaxTime {
@@ -427,22 +419,6 @@ func (opt OptMaxAwaitTime) ConvertFindOneOption() option.FindOptioner {
427419
return option.OptMaxAwaitTime(opt)
428420
}
429421

430-
// OptMaxScan specifies the maximum number of documents or index keys to scan.
431-
type OptMaxScan option.OptMaxScan
432-
433-
func (OptMaxScan) find() {}
434-
func (OptMaxScan) one() {}
435-
436-
// ConvertFindOption implements the Find interface.
437-
func (opt OptMaxScan) ConvertFindOption() option.FindOptioner {
438-
return option.OptMaxScan(opt)
439-
}
440-
441-
// ConvertFindOneOption implements the One interface.
442-
func (opt OptMaxScan) ConvertFindOneOption() option.FindOptioner {
443-
return option.OptMaxScan(opt)
444-
}
445-
446422
// OptMaxTime specifies the max time to allow the query to run.
447423
type OptMaxTime option.OptMaxTime
448424

mongo/findopt/findopt_many_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ func TestFindOpt(t *testing.T) {
172172
Limit(10),
173173
Max("max for find"),
174174
MaxAwaitTime(100),
175-
MaxScan(1000),
176175
MaxTime(5000),
177176
Min("min for find"),
178177
NoCursorTimeout(false),

mongo/findopt/findopt_one_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ func TestFindOneOpt(t *testing.T) {
171171
Hint("hint for find"),
172172
Max("max for find"),
173173
MaxAwaitTime(100),
174-
MaxScan(1000),
175174
MaxTime(5000),
176175
Min("min for find"),
177176
NoCursorTimeout(false),

mongo/findopt/one.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -141,16 +141,6 @@ func (ob *OneBundle) MaxAwaitTime(d time.Duration) *OneBundle {
141141
return bundle
142142
}
143143

144-
// MaxScan adds an option to specify the number of documents or index keys to scan.
145-
func (ob *OneBundle) MaxScan(i int64) *OneBundle {
146-
bundle := &OneBundle{
147-
option: MaxScan(i),
148-
next: ob,
149-
}
150-
151-
return bundle
152-
}
153-
154144
// MaxTime adds an option to specify the max time to allow the query to run.
155145
func (ob *OneBundle) MaxTime(d time.Duration) *OneBundle {
156146
bundle := &OneBundle{

0 commit comments

Comments
 (0)