@@ -18,25 +18,14 @@ import (
1818 "context"
1919
2020 "github.com/mongodb/mongo-go-driver/mongo"
21- "github.com/mongodb/mongo-go-driver/mongo/aggregateopt"
22- "github.com/mongodb/mongo-go-driver/mongo/bulkwriteopt"
23- "github.com/mongodb/mongo-go-driver/mongo/changestreamopt"
24- "github.com/mongodb/mongo-go-driver/mongo/collectionopt"
25- "github.com/mongodb/mongo-go-driver/mongo/countopt"
26- "github.com/mongodb/mongo-go-driver/mongo/deleteopt"
27- "github.com/mongodb/mongo-go-driver/mongo/distinctopt"
28- "github.com/mongodb/mongo-go-driver/mongo/dropcollopt"
29- "github.com/mongodb/mongo-go-driver/mongo/findopt"
30- "github.com/mongodb/mongo-go-driver/mongo/insertopt"
31- "github.com/mongodb/mongo-go-driver/mongo/replaceopt"
32- "github.com/mongodb/mongo-go-driver/mongo/updateopt"
21+ "github.com/mongodb/mongo-go-driver/mongo/options"
3322)
3423
3524type WrappedCollection struct {
3625 coll * mongo.Collection
3726}
3827
39- func (wc * WrappedCollection ) Aggregate (ctx context.Context , pipeline interface {}, opts ... aggregateopt. Aggregate ) (mongo.Cursor , error ) {
28+ func (wc * WrappedCollection ) Aggregate (ctx context.Context , pipeline interface {}, opts ... * options. AggregateOptions ) (mongo.Cursor , error ) {
4029 ctx , span := roundtripTrackingSpan (ctx , "github.com/mongodb/mongo-go-driver.Collection.Aggregate" )
4130 defer span .end (ctx )
4231
@@ -47,7 +36,7 @@ func (wc *WrappedCollection) Aggregate(ctx context.Context, pipeline interface{}
4736 return cur , err
4837}
4938
50- func (wc * WrappedCollection ) BulkWrite (ctx context.Context , models []mongo.WriteModel , opts ... bulkwriteopt. BulkWrite ) (* mongo.BulkWriteResult , error ) {
39+ func (wc * WrappedCollection ) BulkWrite (ctx context.Context , models []mongo.WriteModel , opts ... * options. BulkWriteOptions ) (* mongo.BulkWriteResult , error ) {
5140 ctx , span := roundtripTrackingSpan (ctx , "github.com/mongodb/mongo-go-driver.Collection.BulkWrite" )
5241 defer span .end (ctx )
5342
@@ -58,11 +47,11 @@ func (wc *WrappedCollection) BulkWrite(ctx context.Context, models []mongo.Write
5847 return bwres , err
5948}
6049
61- func (wc * WrappedCollection ) Clone (opts ... collectionopt. Option ) (* mongo.Collection , error ) {
50+ func (wc * WrappedCollection ) Clone (opts ... * options. CollectionOptions ) (* mongo.Collection , error ) {
6251 return wc .coll .Clone (opts ... )
6352}
6453
65- func (wc * WrappedCollection ) Count (ctx context.Context , filter interface {}, opts ... countopt. Count ) (int64 , error ) {
54+ func (wc * WrappedCollection ) Count (ctx context.Context , filter interface {}, opts ... * options. CountOptions ) (int64 , error ) {
6655 ctx , span := roundtripTrackingSpan (ctx , "github.com/mongodb/mongo-go-driver.Collection.Count" )
6756 defer span .end (ctx )
6857
@@ -73,7 +62,7 @@ func (wc *WrappedCollection) Count(ctx context.Context, filter interface{}, opts
7362 return count , err
7463}
7564
76- func (wc * WrappedCollection ) CountDocuments (ctx context.Context , filter interface {}, opts ... countopt. Count ) (int64 , error ) {
65+ func (wc * WrappedCollection ) CountDocuments (ctx context.Context , filter interface {}, opts ... * options. CountOptions ) (int64 , error ) {
7766 ctx , span := roundtripTrackingSpan (ctx , "github.com/mongodb/mongo-go-driver.Collection.CountDocuments" )
7867 defer span .end (ctx )
7968
@@ -86,7 +75,7 @@ func (wc *WrappedCollection) CountDocuments(ctx context.Context, filter interfac
8675
8776func (wc * WrappedCollection ) Database () * mongo.Database { return wc .coll .Database () }
8877
89- func (wc * WrappedCollection ) DeleteMany (ctx context.Context , filter interface {}, opts ... deleteopt. Delete ) (* mongo.DeleteResult , error ) {
78+ func (wc * WrappedCollection ) DeleteMany (ctx context.Context , filter interface {}, opts ... * options. DeleteOptions ) (* mongo.DeleteResult , error ) {
9079 ctx , span := roundtripTrackingSpan (ctx , "github.com/mongodb/mongo-go-driver.Collection.DeleteMany" )
9180 defer span .end (ctx )
9281
@@ -97,7 +86,7 @@ func (wc *WrappedCollection) DeleteMany(ctx context.Context, filter interface{},
9786 return dmres , err
9887}
9988
100- func (wc * WrappedCollection ) DeleteOne (ctx context.Context , filter interface {}, opts ... deleteopt. Delete ) (* mongo.DeleteResult , error ) {
89+ func (wc * WrappedCollection ) DeleteOne (ctx context.Context , filter interface {}, opts ... * options. DeleteOptions ) (* mongo.DeleteResult , error ) {
10190 ctx , span := roundtripTrackingSpan (ctx , "github.com/mongodb/mongo-go-driver.Collection.DeleteOne" )
10291 defer span .end (ctx )
10392
@@ -108,7 +97,7 @@ func (wc *WrappedCollection) DeleteOne(ctx context.Context, filter interface{},
10897 return dor , err
10998}
11099
111- func (wc * WrappedCollection ) Distinct (ctx context.Context , fieldName string , filter interface {}, opts ... distinctopt. Distinct ) ([]interface {}, error ) {
100+ func (wc * WrappedCollection ) Distinct (ctx context.Context , fieldName string , filter interface {}, opts ... * options. DistinctOptions ) ([]interface {}, error ) {
112101 ctx , span := roundtripTrackingSpan (ctx , "github.com/mongodb/mongo-go-driver.Collection.Distinct" )
113102 defer span .end (ctx )
114103
@@ -119,18 +108,18 @@ func (wc *WrappedCollection) Distinct(ctx context.Context, fieldName string, fil
119108 return distinct , err
120109}
121110
122- func (wc * WrappedCollection ) Drop (ctx context.Context , opts ... dropcollopt. DropColl ) error {
111+ func (wc * WrappedCollection ) Drop (ctx context.Context ) error {
123112 ctx , span := roundtripTrackingSpan (ctx , "github.com/mongodb/mongo-go-driver.Collection.Drop" )
124113 defer span .end (ctx )
125114
126- err := wc .coll .Drop (ctx , opts ... )
115+ err := wc .coll .Drop (ctx )
127116 if err != nil {
128117 span .setError (err )
129118 }
130119 return err
131120}
132121
133- func (wc * WrappedCollection ) EstimatedDocumentCount (ctx context.Context , opts ... countopt. EstimatedDocumentCount ) (int64 , error ) {
122+ func (wc * WrappedCollection ) EstimatedDocumentCount (ctx context.Context , opts ... * options. EstimatedDocumentCountOptions ) (int64 , error ) {
134123 ctx , span := roundtripTrackingSpan (ctx , "github.com/mongodb/mongo-go-driver.Collection.EstimatedDocumentCount" )
135124 defer span .end (ctx )
136125
@@ -141,7 +130,7 @@ func (wc *WrappedCollection) EstimatedDocumentCount(ctx context.Context, opts ..
141130 return count , err
142131}
143132
144- func (wc * WrappedCollection ) Find (ctx context.Context , filter interface {}, opts ... findopt. Find ) (mongo.Cursor , error ) {
133+ func (wc * WrappedCollection ) Find (ctx context.Context , filter interface {}, opts ... * options. FindOptions ) (mongo.Cursor , error ) {
145134 ctx , span := roundtripTrackingSpan (ctx , "github.com/mongodb/mongo-go-driver.Collection.Find" )
146135 defer span .end (ctx )
147136
@@ -152,28 +141,28 @@ func (wc *WrappedCollection) Find(ctx context.Context, filter interface{}, opts
152141 return cur , err
153142}
154143
155- func (wc * WrappedCollection ) FindOne (ctx context.Context , filter interface {}, opts ... findopt. One ) * mongo.DocumentResult {
144+ func (wc * WrappedCollection ) FindOne (ctx context.Context , filter interface {}, opts ... * options. FindOneOptions ) * mongo.SingleResult {
156145 ctx , span := roundtripTrackingSpan (ctx , "github.com/mongodb/mongo-go-driver.Collection.FindOne" )
157146 defer span .end (ctx )
158147
159148 return wc .coll .FindOne (ctx , filter , opts ... )
160149}
161150
162- func (wc * WrappedCollection ) FindOneAndDelete (ctx context.Context , filter interface {}, opts ... findopt. DeleteOne ) * mongo.DocumentResult {
151+ func (wc * WrappedCollection ) FindOneAndDelete (ctx context.Context , filter interface {}, opts ... * options. FindOneAndDeleteOptions ) * mongo.SingleResult {
163152 ctx , span := roundtripTrackingSpan (ctx , "github.com/mongodb/mongo-go-driver.Collection.FindOneAndDelete" )
164153 defer span .end (ctx )
165154
166155 return wc .coll .FindOneAndDelete (ctx , filter , opts ... )
167156}
168157
169- func (wc * WrappedCollection ) FindOneAndReplace (ctx context.Context , filter , replacement interface {}, opts ... findopt. ReplaceOne ) * mongo.DocumentResult {
158+ func (wc * WrappedCollection ) FindOneAndReplace (ctx context.Context , filter , replacement interface {}, opts ... * options. FindOneAndReplaceOptions ) * mongo.SingleResult {
170159 ctx , span := roundtripTrackingSpan (ctx , "github.com/mongodb/mongo-go-driver.Collection.FindOneAndReplace" )
171160 defer span .end (ctx )
172161
173162 return wc .coll .FindOneAndReplace (ctx , filter , replacement , opts ... )
174163}
175164
176- func (wc * WrappedCollection ) FindOneAndUpdate (ctx context.Context , filter , update interface {}, opts ... findopt. UpdateOne ) * mongo.DocumentResult {
165+ func (wc * WrappedCollection ) FindOneAndUpdate (ctx context.Context , filter , update interface {}, opts ... * options. FindOneAndUpdateOptions ) * mongo.SingleResult {
177166 ctx , span := roundtripTrackingSpan (ctx , "github.com/mongodb/mongo-go-driver.Collection.FindOneAndUpdate" )
178167 defer span .end (ctx )
179168
@@ -182,7 +171,7 @@ func (wc *WrappedCollection) FindOneAndUpdate(ctx context.Context, filter, updat
182171
183172func (wc * WrappedCollection ) Indexes () mongo.IndexView { return wc .coll .Indexes () }
184173
185- func (wc * WrappedCollection ) InsertMany (ctx context.Context , documents []interface {}, opts ... insertopt. Many ) (* mongo.InsertManyResult , error ) {
174+ func (wc * WrappedCollection ) InsertMany (ctx context.Context , documents []interface {}, opts ... * options. InsertManyOptions ) (* mongo.InsertManyResult , error ) {
186175 ctx , span := roundtripTrackingSpan (ctx , "github.com/mongodb/mongo-go-driver.Collection.InsertMany" )
187176 defer span .end (ctx )
188177
@@ -193,7 +182,7 @@ func (wc *WrappedCollection) InsertMany(ctx context.Context, documents []interfa
193182 return insmres , err
194183}
195184
196- func (wc * WrappedCollection ) InsertOne (ctx context.Context , document interface {}, opts ... insertopt. One ) (* mongo.InsertOneResult , error ) {
185+ func (wc * WrappedCollection ) InsertOne (ctx context.Context , document interface {}, opts ... * options. InsertOneOptions ) (* mongo.InsertOneResult , error ) {
197186 ctx , span := roundtripTrackingSpan (ctx , "github.com/mongodb/mongo-go-driver.Collection.InsertOne" )
198187 defer span .end (ctx )
199188
@@ -206,7 +195,7 @@ func (wc *WrappedCollection) InsertOne(ctx context.Context, document interface{}
206195
207196func (wc * WrappedCollection ) Name () string { return wc .coll .Name () }
208197
209- func (wc * WrappedCollection ) ReplaceOne (ctx context.Context , filter , replacement interface {}, opts ... replaceopt. Replace ) (* mongo.UpdateResult , error ) {
198+ func (wc * WrappedCollection ) ReplaceOne (ctx context.Context , filter , replacement interface {}, opts ... * options. ReplaceOptions ) (* mongo.UpdateResult , error ) {
210199 ctx , span := roundtripTrackingSpan (ctx , "github.com/mongodb/mongo-go-driver.Collection.ReplaceOne" )
211200 defer span .end (ctx )
212201
@@ -217,7 +206,7 @@ func (wc *WrappedCollection) ReplaceOne(ctx context.Context, filter, replacement
217206 return repres , err
218207}
219208
220- func (wc * WrappedCollection ) UpdateMany (ctx context.Context , filter , replacement interface {}, opts ... updateopt. Update ) (* mongo.UpdateResult , error ) {
209+ func (wc * WrappedCollection ) UpdateMany (ctx context.Context , filter , replacement interface {}, opts ... * options. UpdateOptions ) (* mongo.UpdateResult , error ) {
221210 ctx , span := roundtripTrackingSpan (ctx , "github.com/mongodb/mongo-go-driver.Collection.UpdateMany" )
222211 defer span .end (ctx )
223212
@@ -228,7 +217,7 @@ func (wc *WrappedCollection) UpdateMany(ctx context.Context, filter, replacement
228217 return umres , err
229218}
230219
231- func (wc * WrappedCollection ) UpdateOne (ctx context.Context , filter , replacement interface {}, opts ... updateopt. Update ) (* mongo.UpdateResult , error ) {
220+ func (wc * WrappedCollection ) UpdateOne (ctx context.Context , filter , replacement interface {}, opts ... * options. UpdateOptions ) (* mongo.UpdateResult , error ) {
232221 ctx , span := roundtripTrackingSpan (ctx , "github.com/mongodb/mongo-go-driver.Collection.UpdateOne" )
233222 defer span .end (ctx )
234223
@@ -239,7 +228,7 @@ func (wc *WrappedCollection) UpdateOne(ctx context.Context, filter, replacement
239228 return uores , err
240229}
241230
242- func (wc * WrappedCollection ) Watch (ctx context.Context , pipeline interface {}, opts ... changestreamopt. ChangeStream ) (mongo.Cursor , error ) {
231+ func (wc * WrappedCollection ) Watch (ctx context.Context , pipeline interface {}, opts ... * options. ChangeStreamOptions ) (mongo.Cursor , error ) {
243232 ctx , span := roundtripTrackingSpan (ctx , "github.com/mongodb/mongo-go-driver.Collection.Watch" )
244233 defer span .end (ctx )
245234
0 commit comments