File tree Expand file tree Collapse file tree 3 files changed +3
-27
lines changed Expand file tree Collapse file tree 3 files changed +3
-27
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ import (
26
26
"github.com/mongodb/mongo-go-driver/mongo/countopt"
27
27
"github.com/mongodb/mongo-go-driver/mongo/deleteopt"
28
28
"github.com/mongodb/mongo-go-driver/mongo/distinctopt"
29
+ "github.com/mongodb/mongo-go-driver/mongo/dropcollopt"
29
30
"github.com/mongodb/mongo-go-driver/mongo/findopt"
30
31
"github.com/mongodb/mongo-go-driver/mongo/insertopt"
31
32
"github.com/mongodb/mongo-go-driver/mongo/replaceopt"
@@ -1075,14 +1076,14 @@ func (coll *Collection) Indexes() IndexView {
1075
1076
}
1076
1077
1077
1078
// Drop drops this collection from database.
1078
- func (coll * Collection ) Drop (ctx context.Context , opts ... collectionopt. Drop ) error {
1079
+ func (coll * Collection ) Drop (ctx context.Context , opts ... dropcollopt. DropColl ) error {
1079
1080
if ctx == nil {
1080
1081
ctx = context .Background ()
1081
1082
}
1082
1083
1083
1084
var sess * session.Client
1084
1085
for _ , opt := range opts {
1085
- if conv , ok := opt .(collectionopt .DropCollSession ); ok {
1086
+ if conv , ok := opt .(dropcollopt .DropCollSession ); ok {
1086
1087
sess = conv .ConvertDropCollSession ()
1087
1088
}
1088
1089
}
Original file line number Diff line number Diff line change 5
5
6
6
"github.com/mongodb/mongo-go-driver/core/readconcern"
7
7
"github.com/mongodb/mongo-go-driver/core/readpref"
8
- "github.com/mongodb/mongo-go-driver/core/session"
9
8
"github.com/mongodb/mongo-go-driver/core/writeconcern"
10
9
)
11
10
@@ -38,27 +37,6 @@ func (*CollectionBundle) collectionOption() {}
38
37
// OptionFunc implements Option.
39
38
func (optionFunc ) collectionOption () {}
40
39
41
- // Drop represents all possible params for the drop() function.
42
- type Drop interface {
43
- drop ()
44
- }
45
-
46
- // DropCollSession is the session for the drop() function.
47
- type DropCollSession interface {
48
- Drop
49
- ConvertDropCollSession () * session.Client
50
- }
51
-
52
- // DropSessionOpt is a drop session option.
53
- type DropSessionOpt struct {}
54
-
55
- func (DropSessionOpt ) drop () {}
56
-
57
- // ConvertDropCollSession implements the DropCollSession interface.
58
- func (DropSessionOpt ) ConvertDropCollSession () * session.Client {
59
- return nil
60
- }
61
-
62
40
// BundleCollection bundles collection options.
63
41
func BundleCollection (opts ... Option ) * CollectionBundle {
64
42
head := collectionBundle
Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ import (
12
12
"github.com/mongodb/mongo-go-driver/core/session"
13
13
"github.com/mongodb/mongo-go-driver/mongo/aggregateopt"
14
14
"github.com/mongodb/mongo-go-driver/mongo/changestreamopt"
15
- "github.com/mongodb/mongo-go-driver/mongo/collectionopt"
16
15
"github.com/mongodb/mongo-go-driver/mongo/countopt"
17
16
"github.com/mongodb/mongo-go-driver/mongo/dbopt"
18
17
"github.com/mongodb/mongo-go-driver/mongo/deleteopt"
@@ -39,7 +38,6 @@ type Session struct {
39
38
countopt.CountSessionOpt
40
39
deleteopt.DeleteSessionOpt
41
40
distinctopt.DistinctSessionOpt
42
- collectionopt.DropSessionOpt
43
41
dbopt.DropDBSessionOpt
44
42
findopt.FindSessionOpt
45
43
dropcollopt.DropCollSessionOpt
59
57
_ changestreamopt.ChangeStream = (* Session )(nil )
60
58
_ deleteopt.Delete = (* Session )(nil )
61
59
_ distinctopt.Distinct = (* Session )(nil )
62
- _ collectionopt.Drop = (* Session )(nil )
63
60
_ dbopt.DropDB = (* Session )(nil )
64
61
_ findopt.Find = (* Session )(nil )
65
62
_ findopt.One = (* Session )(nil )
You can’t perform that action at this time.
0 commit comments