Skip to content

Commit 447bb73

Browse files
authored
fix imports and api links for builders pattern (#419)
* fix imports and api links for builders pattern * small fix * small fix * remove quickstart as its in another ticket
1 parent e4d07b6 commit 447bb73

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+162
-158
lines changed

snooty.toml

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ driver-long = "MongoDB Go Driver"
1919
driver-short = "Go driver"
2020
docs-branch = "master"
2121
version = "v2.0"
22+
full-version = "{+version+}.0"
2223
example = "https://raw.githubusercontent.com/mongodb/docs-golang/{+docs-branch+}/source/includes/usage-examples/code-snippets"
2324
api = "https://pkg.go.dev/go.mongodb.org/mongo-driver/{+api-version+}"
2425
stable-api = "Stable API"

source/fundamentals/aggregation.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ operations, keep the following in mind:
7272
- Returned documents must not violate the :manual:`BSON document size
7373
limit </reference/limits/#BSON-Document-Size>` of 16 megabytes.
7474
- Pipeline stages have a memory limit of 100 megabytes by default. If
75-
required, you may exceed this limit by using the `allowDiskUse
76-
<{+api+}/mongo/options#AggregateOptions.SetAllowDiskUse>`__
75+
required, you may exceed this limit by using the `allowDiskUse()
76+
<{+api+}/mongo/options#AggregateOptionsBuilder.SetAllowDiskUse>`__
7777
method.
7878
- The :manual:`$graphLookup
7979
</reference/operator/aggregation/graphLookup/>` stage
80-
has a strict memory limit of 100 megabytes and ignores
81-
``allowDiskUse``.
80+
has a strict memory limit of 100 megabytes and ignores the
81+
``allowDiskUse`` setting.
8282

8383
Examples
8484
--------

source/fundamentals/collations.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -306,4 +306,5 @@ API Documentation:
306306
- `IndexModel <{+api+}/mongo#IndexModel>`__
307307
- `CreateOne() <{+api+}/mongo#IndexView.CreateOne>`__
308308
- `IndexOptions <{+api+}/mongo/options#IndexOptions>`__
309-
- `UpdateOptions <{+api+}/mongo/options#UpdateOptions>`__
309+
- `UpdateOneOptions <{+api+}/mongo/options#UpdateOneOptions>`__
310+
- `UpdateManyOptions <{+api+}/mongo/options#UpdateManyOptions>`__

source/fundamentals/connections/tls.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,4 +209,4 @@ guide, see the following API documentation:
209209
- `ClientOptions <{+api+}/mongo/options#ClientOptions>`__
210210
- `SetTLSConfig() <{+api+}/mongo/options#ClientOptions.SetTLSConfig>`__
211211
- `tls package <https://pkg.go.dev/crypto/tls>`__
212-
- `x509 package <https://pkg.go.dev/crypto/x509>`__
212+
- `x509 package <https://pkg.go.dev/crypto/x509>`__

source/fundamentals/crud/read-operations/limit.txt

+4-3
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,10 @@ API Documentation
218218
To learn more about any of the methods or types discussed in this
219219
guide, see the following API Documentation:
220220

221-
- `FindOptions.SetLimit() <{+api+}/mongo/options#FindOptions.SetLimit>`__
222-
- `FindOptions.SetSort() <{+api+}/mongo/options#FindOptions.SetSort>`__
223-
- `FindOptions.SetSkip() <{+api+}/mongo/options#FindOptions.SetSkip>`__
221+
- `FindOptionsBuilder.SetLimit() <{+api+}/mongo/options#FindOptionsBuilder.SetLimit>`__
222+
- `FindOptionsBuilder.SetSort() <{+api+}/mongo/options#FindOptionsBuilder.SetSort>`__
223+
- `FindOptionsBuilder.SetSkip() <{+api+}/mongo/options#FindOptionsBuilder.SetSkip>`__
224224
- `Aggregate() <{+api+}/mongo#Collection.Aggregate>`__
225225
- `CountDocuments() <{+api+}/mongo#Collection.CountDocuments>`__
226226
- `GridFSBucket.Find() <{+api+}/mongo#GridFSBucket.Find>`__
227+

source/fundamentals/crud/read-operations/project.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ To learn more about any of the methods or types discussed in this
228228
guide, see the following API Documentation:
229229

230230
- `Find() <{+api+}/mongo#Collection.Find>`__
231-
- `FindOptions.SetProjection() <{+api+}/mongo/options#FindOptions.SetProjection>`__
231+
- `FindOptionsBuilder.SetProjection() <{+api+}/mongo/options#FindOptionsBuilder.SetProjection>`__
232232
- `FindOne() <{+api+}/mongo#Collection.FindOne>`__
233233
- `FindOneAndDelete() <{+api+}/mongo#Collection.FindOneAndDelete>`__
234234
- `FindOneAndReplace() <{+api+}/mongo#Collection.FindOneAndReplace>`__

source/fundamentals/crud/read-operations/skip.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ To learn more about any of the methods or types discussed in this
174174
guide, see the following API Documentation:
175175

176176
- `Find() <{+api+}/mongo#Collection.Find>`__
177-
- `FindOptions.SetSkip() <{+api+}/mongo/options#FindOptions.SetSkip>`__
177+
- `FindOptionsBuilder.SetSkip() <{+api+}/mongo/options#FindOptionsBuilder.SetSkip>`__
178178
- `Aggregate() <{+api+}/mongo#Collection.Aggregate>`__
179179
- `CountDocuments() <{+api+}/mongo#Collection.CountDocuments>`__
180180
- `GridFSBucket.Find() <{+api+}/mongo#GridFSBucket.Find>`__

source/fundamentals/crud/read-operations/sort.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ To learn more about any of the methods or types discussed in this
277277
guide, see the following API Documentation:
278278

279279
- `Find() <{+api+}/mongo#Collection.Find>`__
280-
- `FindOptions.SetSort() <{+api+}/mongo/options#FindOptions.SetSort>`__
280+
- `FindOptionsBuilder.SetSort() <{+api+}/mongo/options#FindOptionsBuilder.SetSort>`__
281281
- `Aggregate() <{+api+}/mongo#Collection.Aggregate>`__
282282
- `FindOne() <{+api+}/mongo#Collection.FindOne>`__
283283
- `FindOneAndDelete() <{+api+}/mongo#Collection.FindOneAndDelete>`__

source/fundamentals/crud/read-operations/text.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -396,5 +396,5 @@ To learn more about any of the methods or types discussed in this
396396
guide, see the following API Documentation:
397397

398398
- `Find() <{+api+}/mongo#Collection.Find>`__
399-
- `FindOptions.SetSort() <{+api+}/mongo/options#FindOptions.SetSort>`__
400-
- `FindOptions.SetProjection() <{+api+}/mongo/options#FindOptions.SetProjection>`__
399+
- `FindOptionsBuilder.SetSort() <{+api+}/mongo/options#FindOptionsBuilder.SetSort>`__
400+
- `FindOptionsBuilder.SetProjection() <{+api+}/mongo/options#FindOptionsBuilder.SetProjection>`__

source/fundamentals/crud/write-operations/upsert.txt

+5-5
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ Example
8888

8989
The following example performs the following actions:
9090

91-
- Matches documents where the ``species`` is "Ledebouria socialis" and
92-
the ``plant_id`` is ``3``
91+
- Matches documents where the ``species`` is ``"Ledebouria socialis"``
92+
and the ``plant_id`` is ``3``
9393
- Updates the ``height`` of the matched document to ``8.3``
9494
- Inserts this document if there are no matches to the query filter
9595

@@ -101,7 +101,7 @@ The following example performs the following actions:
101101

102102
filter := bson.D{{"species", "Ledebouria socialis"}, {"plant_id", 3}}
103103
update := bson.D{{"$set", bson.D{{"species", "Ledebouria socialis"}, {"plant_id", 3}, {"height", 8.3}}}}
104-
opts := options.Update().SetUpsert(true)
104+
options.UpdateOne().SetUpsert(true)
105105

106106
result, err := coll.UpdateOne(context.TODO(), filter, update, opts)
107107
if err != nil {
@@ -152,6 +152,6 @@ guide, see the following API Documentation:
152152
- `ReplaceOne() <{+api+}/mongo#Collection.ReplaceOne>`__
153153
- `FindOneAndUpdate() <{+api+}/mongo#Collection.FindOneAndUpdate>`__
154154
- `FindOneAndReplace() <{+api+}/mongo#Collection.FindOneAndReplace>`__
155-
- `UpdateOptions.SetUpsert() <{+api+}/mongo/options#UpdateOptions.SetUpsert>`__
156-
- `ReplaceOptions.SetUpsert() <{+api+}/mongo/options#ReplaceOptions.SetUpsert>`__
155+
- `UpdateOneOptionsBuilder.SetUpsert() <{+api+}/mongo/options#UpdateOneOptionsBuilder.SetUpsert>`__
156+
- `ReplaceOptionsBuilder.SetUpsert() <{+api+}/mongo/options#ReplaceOptionsBuilder.SetUpsert>`__
157157
- `UpdateResult <{+api+}/mongo#UpdateResult>`__

source/fundamentals/indexes.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,8 @@ guide, see the following API Documentation:
489489
- `IndexModel <{+api+}/mongo#IndexModel>`__
490490
- `CreateOne() <{+api+}/mongo#IndexView.CreateOne>`__
491491
- `IndexOptions <{+api+}/mongo/options#IndexOptions>`__
492-
- `SetDefaultLanguage() <{+api+}/mongo/options#IndexOptions.SetDefaultLanguage>`__
492+
- `SetDefaultLanguage()
493+
<{+api+}/mongo/options#IndexOptionsBuilder.SetDefaultLanguage>`__
493494
- `DropOne() <{+api+}/mongo#IndexView.DropOne>`__
494495
- `CreateCollection() <{+api+}/mongo#Database.CreateCollection>`__
495496
- `CreateCollectionOptions <{+api+}/mongo/options#CreateCollectionOptions>`__

source/fundamentals/time-series.txt

+3-2
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ To learn more about any of the methods or types discussed in this
127127
guide, see the following API Documentation:
128128

129129
- `TimeSeriesOptions <{+api+}/mongo/options#TimeSeriesOptions>`__
130-
- `SetTimeField() <{+api+}/mongo/options#TimeSeriesOptions.SetTimeField>`__
130+
- `SetTimeField() <{+api+}/mongo/options#TimeSeriesOptionsBuilder.SetTimeField>`__
131131
- `CreateCollection() <{+api+}/mongo#Database.CreateCollection>`__
132-
- `SetTimeSeriesOptions() <{+api+}/mongo/options#CreateCollectionOptions.SetTimeSeriesOptions>`__
132+
- `SetTimeSeriesOptions()
133+
<{+api+}/mongo/options#CreateCollectionOptionsBuilder.SetTimeSeriesOptions>`__
133134
- `RunCommand() <{+api+}/mongo#Database.RunCommand>`__

source/fundamentals/transactions.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,5 +209,5 @@ guide, see the following API Documentation:
209209
- `Client <{+api+}/mongo#Client>`__
210210
- `StartSession() <{+api+}/mongo#Client.StartSession>`__
211211
- `TransactionOptions <{+api+}/mongo/options#TransactionOptions>`__
212-
- `SetWriteConcern() <{+api+}/mongo/options#TransactionOptions.SetWriteConcern>`__
212+
- `SetWriteConcern() <{+api+}/mongo/options#TransactionOptionsBuilder.SetWriteConcern>`__
213213
- `InsertMany() <{+api+}/mongo#Collection.InsertMany>`__

source/includes/authentication/azure-imds-client.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package main
22

33
import (
4-
"go.mongodb.org/mongo-driver/mongo"
5-
"go.mongodb.org/mongo-driver/mongo/options"
4+
"go.mongodb.org/mongo-driver/v2/mongo"
5+
"go.mongodb.org/mongo-driver/v2/mongo/options"
66
)
77

88
func main() {

source/includes/authentication/eks-custom-callback.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"context"
55
"os"
66

7-
"go.mongodb.org/mongo-driver/mongo"
8-
"go.mongodb.org/mongo-driver/mongo/options"
7+
"go.mongodb.org/mongo-driver/v2/mongo"
8+
"go.mongodb.org/mongo-driver/v2/mongo/options"
99
)
1010

1111
func main() {

source/includes/authentication/gcp-imds-client.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package main
22

33
import (
4-
"go.mongodb.org/mongo-driver/mongo"
5-
"go.mongodb.org/mongo-driver/mongo/options"
4+
"go.mongodb.org/mongo-driver/v2/mongo"
5+
"go.mongodb.org/mongo-driver/v2/mongo/options"
66
)
77

88
func main() {

source/includes/authentication/gke-callback.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"context"
55
"os"
66

7-
"go.mongodb.org/mongo-driver/mongo"
8-
"go.mongodb.org/mongo-driver/mongo/options"
7+
"go.mongodb.org/mongo-driver/v2/mongo"
8+
"go.mongodb.org/mongo-driver/v2/mongo/options"
99
)
1010

1111
func main() {

source/includes/fundamentals/code-snippets/CRUD/bulkOps.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77
"log"
88
"os"
99

10-
"go.mongodb.org/mongo-driver/bson"
11-
"go.mongodb.org/mongo-driver/mongo"
12-
"go.mongodb.org/mongo-driver/mongo/options"
10+
"go.mongodb.org/mongo-driver/v2/bson"
11+
"go.mongodb.org/mongo-driver/v2/mongo"
12+
"go.mongodb.org/mongo-driver/v2/mongo/options"
1313
)
1414

1515
// start-book-struct

source/includes/fundamentals/code-snippets/CRUD/changeStream.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77
"log"
88
"os"
99

10-
"go.mongodb.org/mongo-driver/bson"
11-
"go.mongodb.org/mongo-driver/mongo"
12-
"go.mongodb.org/mongo-driver/mongo/options"
10+
"go.mongodb.org/mongo-driver/v2/bson"
11+
"go.mongodb.org/mongo-driver/v2/mongo"
12+
"go.mongodb.org/mongo-driver/v2/mongo/options"
1313
)
1414

1515
// begin struct

source/includes/fundamentals/code-snippets/CRUD/compoundOperations.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77
"log"
88
"os"
99

10-
"go.mongodb.org/mongo-driver/bson"
11-
"go.mongodb.org/mongo-driver/mongo"
12-
"go.mongodb.org/mongo-driver/mongo/options"
10+
"go.mongodb.org/mongo-driver/v2/bson"
11+
"go.mongodb.org/mongo-driver/v2/mongo"
12+
"go.mongodb.org/mongo-driver/v2/mongo/options"
1313
)
1414

1515
// start-course-struct

source/includes/fundamentals/code-snippets/CRUD/countAndEstimate.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77
"log"
88
"os"
99

10-
"go.mongodb.org/mongo-driver/bson"
11-
"go.mongodb.org/mongo-driver/mongo"
12-
"go.mongodb.org/mongo-driver/mongo/options"
10+
"go.mongodb.org/mongo-driver/v2/bson"
11+
"go.mongodb.org/mongo-driver/v2/mongo"
12+
"go.mongodb.org/mongo-driver/v2/mongo/options"
1313
)
1414

1515
// start-tea-struct

source/includes/fundamentals/code-snippets/CRUD/cursor.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77
"log"
88
"os"
99

10-
"go.mongodb.org/mongo-driver/bson"
11-
"go.mongodb.org/mongo-driver/mongo"
12-
"go.mongodb.org/mongo-driver/mongo/options"
10+
"go.mongodb.org/mongo-driver/v2/bson"
11+
"go.mongodb.org/mongo-driver/v2/mongo"
12+
"go.mongodb.org/mongo-driver/v2/mongo/options"
1313
)
1414

1515
// start-sample-struct

source/includes/fundamentals/code-snippets/CRUD/delete.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77
"log"
88
"os"
99

10-
"go.mongodb.org/mongo-driver/bson"
11-
"go.mongodb.org/mongo-driver/mongo"
12-
"go.mongodb.org/mongo-driver/mongo/options"
10+
"go.mongodb.org/mongo-driver/v2/bson"
11+
"go.mongodb.org/mongo-driver/v2/mongo"
12+
"go.mongodb.org/mongo-driver/v2/mongo/options"
1313
)
1414

1515
// start-book-struct

source/includes/fundamentals/code-snippets/CRUD/distinctValues.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77
"log"
88
"os"
99

10-
"go.mongodb.org/mongo-driver/bson"
11-
"go.mongodb.org/mongo-driver/mongo"
12-
"go.mongodb.org/mongo-driver/mongo/options"
10+
"go.mongodb.org/mongo-driver/v2/bson"
11+
"go.mongodb.org/mongo-driver/v2/mongo"
12+
"go.mongodb.org/mongo-driver/v2/mongo/options"
1313
)
1414

1515
// start-course-struct

source/includes/fundamentals/code-snippets/CRUD/insertOptions.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package main
44
import (
55
"fmt"
66

7-
"go.mongodb.org/mongo-driver/mongo/options"
7+
"go.mongodb.org/mongo-driver/v2/mongo/options"
88
)
99

1010
// start-book-struct

source/includes/fundamentals/code-snippets/CRUD/limit.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77
"log"
88
"os"
99

10-
"go.mongodb.org/mongo-driver/bson"
11-
"go.mongodb.org/mongo-driver/mongo"
12-
"go.mongodb.org/mongo-driver/mongo/options"
10+
"go.mongodb.org/mongo-driver/v2/bson"
11+
"go.mongodb.org/mongo-driver/v2/mongo"
12+
"go.mongodb.org/mongo-driver/v2/mongo/options"
1313
)
1414

1515
// start-course-struct

source/includes/fundamentals/code-snippets/CRUD/projection.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77
"log"
88
"os"
99

10-
"go.mongodb.org/mongo-driver/bson"
11-
"go.mongodb.org/mongo-driver/mongo"
12-
"go.mongodb.org/mongo-driver/mongo/options"
10+
"go.mongodb.org/mongo-driver/v2/bson"
11+
"go.mongodb.org/mongo-driver/v2/mongo"
12+
"go.mongodb.org/mongo-driver/v2/mongo/options"
1313
)
1414

1515
// start-course-struct

source/includes/fundamentals/code-snippets/CRUD/query.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77
"log"
88
"os"
99

10-
"go.mongodb.org/mongo-driver/bson"
11-
"go.mongodb.org/mongo-driver/mongo"
12-
"go.mongodb.org/mongo-driver/mongo/options"
10+
"go.mongodb.org/mongo-driver/v2/bson"
11+
"go.mongodb.org/mongo-driver/v2/mongo"
12+
"go.mongodb.org/mongo-driver/v2/mongo/options"
1313
)
1414

1515
// start-tea-struct

source/includes/fundamentals/code-snippets/CRUD/retrieve.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import (
88
"os"
99
"time"
1010

11-
"go.mongodb.org/mongo-driver/bson"
12-
"go.mongodb.org/mongo-driver/bson/primitive"
13-
"go.mongodb.org/mongo-driver/mongo"
14-
"go.mongodb.org/mongo-driver/mongo/options"
11+
"go.mongodb.org/mongo-driver/v2/bson"
12+
"go.mongodb.org/mongo-driver/v2/bson/primitive"
13+
"go.mongodb.org/mongo-driver/v2/mongo"
14+
"go.mongodb.org/mongo-driver/v2/mongo/options"
1515
)
1616

1717
// start-tea-struct

source/includes/fundamentals/code-snippets/CRUD/runCommand.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import (
88
"log"
99
"os"
1010

11-
"go.mongodb.org/mongo-driver/bson"
12-
"go.mongodb.org/mongo-driver/mongo"
13-
"go.mongodb.org/mongo-driver/mongo/options"
11+
"go.mongodb.org/mongo-driver/v2/bson"
12+
"go.mongodb.org/mongo-driver/v2/mongo"
13+
"go.mongodb.org/mongo-driver/v2/mongo/options"
1414
)
1515

1616
func main() {

source/includes/fundamentals/code-snippets/CRUD/skip.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import (
88
"log"
99
"os"
1010

11-
"go.mongodb.org/mongo-driver/bson"
12-
"go.mongodb.org/mongo-driver/mongo"
13-
"go.mongodb.org/mongo-driver/mongo/options"
11+
"go.mongodb.org/mongo-driver/v2/bson"
12+
"go.mongodb.org/mongo-driver/v2/mongo"
13+
"go.mongodb.org/mongo-driver/v2/mongo/options"
1414
)
1515

1616
// start-course-struct

source/includes/fundamentals/code-snippets/CRUD/sort.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import (
88
"log"
99
"os"
1010

11-
"go.mongodb.org/mongo-driver/bson"
12-
"go.mongodb.org/mongo-driver/mongo"
13-
"go.mongodb.org/mongo-driver/mongo/options"
11+
"go.mongodb.org/mongo-driver/v2/bson"
12+
"go.mongodb.org/mongo-driver/v2/mongo"
13+
"go.mongodb.org/mongo-driver/v2/mongo/options"
1414
)
1515

1616
// start-course-struct

source/includes/fundamentals/code-snippets/CRUD/textSearch.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77
"log"
88
"os"
99

10-
"go.mongodb.org/mongo-driver/bson"
11-
"go.mongodb.org/mongo-driver/mongo"
12-
"go.mongodb.org/mongo-driver/mongo/options"
10+
"go.mongodb.org/mongo-driver/v2/bson"
11+
"go.mongodb.org/mongo-driver/v2/mongo"
12+
"go.mongodb.org/mongo-driver/v2/mongo/options"
1313
)
1414

1515
// start-dish-struct

0 commit comments

Comments
 (0)