Skip to content

Commit 4199644

Browse files
authored
v1.1.6 ft (#291)
* v1.1.6 ft * v1.1.6 ft * v1.1.6 ft
1 parent d2c76fd commit 4199644

File tree

10 files changed

+71
-52
lines changed

10 files changed

+71
-52
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: go
22
go:
3-
- "1.14"
3+
- "1.16"
44
env:
55
- GO111MODULE=on
66
services:

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
[![Go Report Card](https://goreportcard.com/badge/github.com/qiniu/qmgo)](https://goreportcard.com/report/github.com/qiniu/qmgo)
66
[![GitHub release](https://img.shields.io/github/v/tag/qiniu/qmgo.svg?label=release)](https://github.com/qiniu/qmgo/releases)
77
[![GoDoc](https://pkg.go.dev/badge/github.com/qiniu/qmgo?status.svg)](https://pkg.go.dev/github.com/qiniu/qmgo?tab=doc)
8-
[![Join the chat at https://gitter.im/qiniu/qmgo](https://badges.gitter.im/qiniu/qmgo.svg)](https://gitter.im/qiniu/qmgo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
98

109
English | [简体中文](README_ZH.md)
1110

aggregate.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,13 @@ func (a *Aggregate) One(result interface{}) error {
7272
}
7373

7474
// Iter return the cursor after aggregate
75+
// Deprecated, please use Cursor
7576
func (a *Aggregate) Iter() CursorI {
77+
return a.Cursor()
78+
}
79+
80+
// Cursor return the cursor after aggregate
81+
func (a *Aggregate) Cursor() CursorI {
7682
opts := options.Aggregate()
7783
if len(a.options) > 0 {
7884
opts = a.options[0].AggregateOptions

client.go

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
"go.mongodb.org/mongo-driver/bson"
2525
"go.mongodb.org/mongo-driver/bson/bsoncodec"
2626
"go.mongodb.org/mongo-driver/mongo"
27-
opts "go.mongodb.org/mongo-driver/mongo/options"
27+
officialOpts "go.mongodb.org/mongo-driver/mongo/options"
2828
"go.mongodb.org/mongo-driver/mongo/readpref"
2929
)
3030

@@ -153,7 +153,7 @@ func NewClient(ctx context.Context, conf *Config, o ...options.ClientOptions) (c
153153
}
154154

155155
// client creates connection to MongoDB
156-
func client(ctx context.Context, opt *opts.ClientOptions) (client *mongo.Client, err error) {
156+
func client(ctx context.Context, opt *officialOpts.ClientOptions) (client *mongo.Client, err error) {
157157
client, err = mongo.Connect(ctx, opt)
158158
if err != nil {
159159
fmt.Println(err)
@@ -173,10 +173,10 @@ func client(ctx context.Context, opt *opts.ClientOptions) (client *mongo.Client,
173173
// Qmgo will follow this way official mongodb driver do:
174174
// - the configuration in uri takes precedence over the configuration in the setter
175175
// - Check the validity of the configuration in the uri, while the configuration in the setter is basically not checked
176-
func newConnectOpts(conf *Config, o ...options.ClientOptions) (*opts.ClientOptions, error) {
177-
option := opts.Client()
176+
func newConnectOpts(conf *Config, o ...options.ClientOptions) (*officialOpts.ClientOptions, error) {
177+
option := officialOpts.Client()
178178
for _, apply := range o {
179-
option = opts.MergeClientOptions(apply.ClientOptions)
179+
option = officialOpts.MergeClientOptions(apply.ClientOptions)
180180
}
181181
if conf.ConnectTimeoutMS != nil {
182182
timeoutDur := time.Duration(*conf.ConnectTimeoutMS) * time.Millisecond
@@ -215,7 +215,7 @@ func newConnectOpts(conf *Config, o ...options.ClientOptions) (*opts.ClientOptio
215215
}
216216

217217
// newAuth create options.Credential from conf.Auth
218-
func newAuth(auth Credential) (credential opts.Credential, err error) {
218+
func newAuth(auth Credential) (credential officialOpts.Credential, err error) {
219219
if auth.AuthMechanism != "" {
220220
credential.AuthMechanism = auth.AuthMechanism
221221
}
@@ -288,19 +288,18 @@ func (c *Client) Ping(timeout int64) error {
288288

289289
// Database create connection to database
290290
func (c *Client) Database(name string, options ...*options.DatabaseOptions) *Database {
291-
opts := opts.Database()
292-
if len(options) > 0 {
293-
if options[0].DatabaseOptions != nil {
294-
opts = options[0].DatabaseOptions
295-
}
291+
opts := make([]*officialOpts.DatabaseOptions, 0, len(options))
292+
for _, o := range options {
293+
opts = append(opts, o.DatabaseOptions)
296294
}
297-
return &Database{database: c.client.Database(name, opts), registry: c.registry}
295+
databaseOpts := officialOpts.MergeDatabaseOptions(opts...)
296+
return &Database{database: c.client.Database(name, databaseOpts), registry: c.registry}
298297
}
299298

300299
// Session create one session on client
301300
// Watch out, close session after operation done
302301
func (c *Client) Session(opt ...*options.SessionOptions) (*Session, error) {
303-
sessionOpts := opts.Session()
302+
sessionOpts := officialOpts.Session()
304303
if len(opt) > 0 && opt[0].SessionOptions != nil {
305304
sessionOpts = opt[0].SessionOptions
306305
}

client_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ func TestClient(t *testing.T) {
130130
ast.Equal(nil, err)
131131

132132
opts := &options.DatabaseOptions{DatabaseOptions: officialOpts.Database().SetReadPreference(readpref.PrimaryPreferred())}
133-
coll := c.Database("qmgotest", opts).Collection("testopen")
133+
cOpts := &options.CollectionOptions{CollectionOptions: officialOpts.Collection().SetReadPreference(readpref.PrimaryPreferred())}
134+
coll := c.Database("qmgotest", opts).Collection("testopen", cOpts)
134135

135136
res, err := coll.InsertOne(context.Background(), bson.D{{Key: "x", Value: 1}})
136137
ast.NoError(err)

database.go

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ package qmgo
1616
import (
1717
"context"
1818

19-
opts "github.com/qiniu/qmgo/options"
19+
"github.com/qiniu/qmgo/options"
2020
"go.mongodb.org/mongo-driver/bson/bsoncodec"
2121
"go.mongodb.org/mongo-driver/mongo"
22-
"go.mongodb.org/mongo-driver/mongo/options"
22+
officialOpts "go.mongodb.org/mongo-driver/mongo/options"
2323
)
2424

2525
// Database is a handle to a MongoDB database
@@ -30,9 +30,14 @@ type Database struct {
3030
}
3131

3232
// Collection gets collection from database
33-
func (d *Database) Collection(name string) *Collection {
33+
func (d *Database) Collection(name string, opts ...*options.CollectionOptions) *Collection {
3434
var cp *mongo.Collection
35-
cp = d.database.Collection(name)
35+
var opt = make([]*officialOpts.CollectionOptions, 0, len(opts))
36+
for _, o := range opts {
37+
opt = append(opt, o.CollectionOptions)
38+
}
39+
collOpt := officialOpts.MergeCollectionOptions(opt...)
40+
cp = d.database.Collection(name, collOpt)
3641

3742
return &Collection{
3843
collection: cp,
@@ -57,8 +62,8 @@ func (d *Database) DropDatabase(ctx context.Context) error {
5762
// If the command document contains a session ID or any transaction-specific fields, the behavior is undefined.
5863
//
5964
// The opts parameter can be used to specify options for this operation (see the options.RunCmdOptions documentation).
60-
func (d *Database) RunCommand(ctx context.Context, runCommand interface{}, opts ...opts.RunCommandOptions) *mongo.SingleResult {
61-
option := options.RunCmd()
65+
func (d *Database) RunCommand(ctx context.Context, runCommand interface{}, opts ...options.RunCommandOptions) *mongo.SingleResult {
66+
option := officialOpts.RunCmd()
6267
if len(opts) > 0 && opts[0].RunCmdOptions != nil {
6368
option = opts[0].RunCmdOptions
6469
}
@@ -71,12 +76,12 @@ func (d *Database) RunCommand(ctx context.Context, runCommand interface{}, opts
7176
//
7277
// The opts parameter can be used to specify options for the operation (see the options.CreateCollectionOptions
7378
// documentation).
74-
func (db *Database) CreateCollection(ctx context.Context, name string, opts ...opts.CreateCollectionOptions) error {
75-
var option = make([]*options.CreateCollectionOptions,0,len(opts))
76-
for _,opt := range opts{
77-
if opt.CreateCollectionOptions != nil{
78-
option = append(option,opt.CreateCollectionOptions)
79+
func (db *Database) CreateCollection(ctx context.Context, name string, opts ...options.CreateCollectionOptions) error {
80+
var option = make([]*officialOpts.CreateCollectionOptions, 0, len(opts))
81+
for _, opt := range opts {
82+
if opt.CreateCollectionOptions != nil {
83+
option = append(option, opt.CreateCollectionOptions)
7984
}
8085
}
81-
return db.database.CreateCollection(ctx,name,option...)
82-
}
86+
return db.database.CreateCollection(ctx, name, option...)
87+
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ go 1.16
55
require (
66
github.com/go-playground/validator/v10 v10.4.1
77
github.com/stretchr/testify v1.6.1
8-
go.mongodb.org/mongo-driver v1.9.0
8+
go.mongodb.org/mongo-driver v1.11.6
99
)

go.sum

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD87
99
github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
1010
github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE=
1111
github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4=
12-
github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk=
13-
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
1412
github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4=
1513
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
1614
github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM=
@@ -24,6 +22,7 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
2422
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
2523
github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y=
2624
github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
25+
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe h1:iruDEfMl2E6fbMZ9s0scYfZQ84/6SPL6zC8ACM2oIL0=
2726
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
2827
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
2928
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
@@ -38,39 +37,41 @@ github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4=
3837
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
3938
github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c=
4039
github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
41-
github.com/xdg-go/scram v1.0.2 h1:akYIkZ28e6A96dkWNJQu3nmCzH3YfwMPQExUYDaRv7w=
42-
github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs=
43-
github.com/xdg-go/stringprep v1.0.2 h1:6iq84/ryjjeRmMJwxutI51F2GIPlP5BfTvXHeYjyhBc=
44-
github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM=
40+
github.com/xdg-go/scram v1.1.1 h1:VOMT+81stJgXW3CpHyqHN3AXDYIMsx56mEFrB37Mb/E=
41+
github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g=
42+
github.com/xdg-go/stringprep v1.0.3 h1:kdwGpVNwPFtjs98xCGkHjQtGKh86rDcRZN17QEMCOIs=
43+
github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8=
4544
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d h1:splanxYIlg+5LfHAM6xpdFEAYOk8iySO56hMFq6uLyA=
4645
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA=
47-
go.mongodb.org/mongo-driver v1.9.0 h1:f3aLGJvQmBl8d9S40IL+jEyBC6hfLPbJjv9t5hEM9ck=
48-
go.mongodb.org/mongo-driver v1.9.0/go.mod h1:0sQWfOeY63QTntERDJJ/0SuKK0T1uVSgKCuAROlKEPY=
46+
go.mongodb.org/mongo-driver v1.11.6 h1:XM7G6PjiGAO5betLF13BIa5TlLUUE3uJ/2Ox3Lz1K+o=
47+
go.mongodb.org/mongo-driver v1.11.6/go.mod h1:G9TgswdsWjX4tmDA5zfs2+6AEPpYJwqblyjsfuh8oXY=
4948
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
5049
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
51-
golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f h1:aZp0e2vLN4MToVqnjNEYEtrEA8RH8U8FN1CU7JgqsPU=
52-
golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
53-
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
50+
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d h1:sK3txAijHtOK88l68nt020reeT1ZdKLIYetKl95FzVY=
51+
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
5452
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
55-
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
56-
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY=
57-
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
53+
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
54+
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
55+
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
5856
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
5957
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
60-
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4=
61-
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
62-
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
58+
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
59+
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
60+
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 h1:SrN+KX8Art/Sf4HNj6Zcz06G7VEz+7w9tdXTPOZ7+l4=
61+
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
62+
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
6363
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
6464
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
65-
golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ=
66-
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
65+
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
66+
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
67+
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
6768
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
68-
golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
6969
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
7070
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
7171
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
7272
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
7373
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
7474
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
75-
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
7675
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
76+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
77+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

interface.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,6 @@ type QueryI interface {
7272
type AggregateI interface {
7373
All(results interface{}) error
7474
One(result interface{}) error
75-
Iter() CursorI
75+
Iter() CursorI // Deprecated, please use Cursor instead
76+
Cursor() CursorI
7677
}

options/collection_options.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package options
2+
3+
import "go.mongodb.org/mongo-driver/mongo/options"
4+
5+
type CollectionOptions struct {
6+
*options.CollectionOptions
7+
}

0 commit comments

Comments
 (0)