Skip to content

Commit a4f21ba

Browse files
author
Chris Cho
committed
DOCSP-32073: Atomic typo and related fixes
(cherry picked from commit 6831e26)
1 parent 27e322f commit a4f21ba

Some content is hidden

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

43 files changed

+58
-62
lines changed

source/faq.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ the ``maxIdleTimeMS`` option, which defaults to ``None`` (no limit).
7878
The following default configuration for a ``Client`` works for most applications:
7979

8080
.. code-block:: go
81-
81+
8282
client := mongo.Connect("<connection string>")
8383

8484
Create a client once for each process, and reuse it for all
@@ -126,14 +126,14 @@ internally uses the ``bson.Marshal()`` method or when you call
126126
``bson.Marshal()`` directly to encode data.
127127

128128
The following code produces a ``WriteNull`` error because the driver
129-
cannot encode the ``null`` valued ``sortOrder`` variable to BSON during
129+
cannot encode the ``null`` value of ``sortOrder`` to BSON during
130130
the ``FindOneAndUpdate()`` operation:
131131

132132
.. code-block:: go
133133

134134
var sortOrder bson.D
135135
opts := options.FindOneAndUpdate().SetSort(sortOrder)
136-
136+
137137
updateDocument := bson.D{{"$inc", bson.D{{"counter", 1}}}}
138138
result := coll.FindOneAndUpdate(context.TODO(), bson.D{}, updateDocument, opts)
139139
if err := result.Err(); err != nil {
@@ -168,12 +168,12 @@ using string type-casting:
168168
:emphasize-lines: 3
169169

170170
bsonDocument := bson.D{{"hello", "world"}}
171-
171+
172172
jsonBytes, err := bson.MarshalExtJSON(bsonDocument, true, false)
173173
if err != nil {
174174
panic(err)
175175
}
176-
176+
177177
fmt.Println(string(jsonBytes))
178178

179179
.. output::

source/fundamentals/context.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Overview
1717

1818
The {+driver-long+} uses the `context package
1919
<https://pkg.go.dev/context>`__ from Go's standard library to allow
20-
applications to signal timeouts and cancellations for any **blocking method**
20+
applications to signal timeouts and cancelations for any **blocking method**
2121
call. A blocking method relies on an external event, such as a network
2222
input or output, to proceed with its task.
2323

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ In this guide, you can learn how to access data with a **cursor**.
2020
A cursor is a mechanism that allows an application to iterate over
2121
database results while holding only a subset of them in memory at a
2222
given time. Read operations that match multiple documents use a cursor
23-
to return those documents in batches as opposed to all at once.
23+
to return those documents in batches rather than all at once.
2424

2525
Sample Cursor
2626
~~~~~~~~~~~~~

source/fundamentals/gridfs.txt

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ Overview
1818
In this guide, you can learn how to store and retrieve large files in
1919
MongoDB using the **GridFS** specification. GridFS splits large files
2020
into chunks and stores each chunk as a separate document. When you query
21-
GridFS for a file, the driver will reassemble the chunks as needed. The
21+
GridFS for a file, the driver assembles the chunks as needed. The
2222
driver implementation of GridFS is an abstraction that manages the operations
23-
and organization of the file storage.
23+
and organization of the file storage.
2424

2525
Use GridFS if the size of your files exceeds the BSON document size limit of
2626
16 MB. GridFS is also useful for accessing files without loading the entire file
@@ -37,7 +37,7 @@ bucket contains the following collections:
3737
- The ``chunks`` collection, which stores the binary file chunks.
3838
- The ``files`` collection, which stores the file metadata.
3939

40-
When you create a new GridFS bucket, the driver creates the preceding
40+
When you create a new GridFS bucket, the driver creates the preceding
4141
collections. The default bucket name ``fs`` prefixes the collection names,
4242
unless you specify a different bucket name. The driver creates the new GridFS
4343
bucket during the first write operation.
@@ -98,15 +98,15 @@ call the ``NewBucket()`` method with a database parameter:
9898
reference to the bucket rather than instantiating a new one.
9999

100100
By default, the new bucket is named ``fs``. To instantiate a bucket with a
101-
custom name, call the ``SetName()`` method on a ``BucketOptions`` instance as
101+
custom name, call the ``SetName()`` method on a ``BucketOptions`` instance as
102102
follows:
103103

104104
.. code-block:: go
105105

106106
db := client.Database("myDB")
107107
opts := options.GridFSBucket().SetName("custom name")
108108
bucket, err := gridfs.NewBucket(db, opts)
109-
109+
110110
if err != nil {
111111
panic(err)
112112
}
@@ -122,7 +122,7 @@ You can upload a file into a GridFS bucket in one of the following ways:
122122
- Use the ``OpenUploadStream()`` method, which writes to an output stream.
123123

124124
For either upload process, you can specify configuration information on an instance
125-
of ``UploadOptions``. For a full list of ``UploadOptions`` fields, visit the
125+
of ``UploadOptions``. For a full list of ``UploadOptions`` fields, visit the
126126
`API documentation <{+api+}/mongo/options#UploadOptions>`__.
127127

128128
Upload with an Input Stream
@@ -159,12 +159,8 @@ content to a GridFS bucket. It uses an ``opts`` parameter to set file metadata:
159159
:language: none
160160
:visible: false
161161

162-
New file uploaded with ID 62e005408bc04f3816b8bcd2
163-
164-
.. note::
162+
New file uploaded with ID 62e00...
165163

166-
The driver uniquely generates each object ID number. The ID number outputted
167-
will resemble the sample output but varies with each file and user.
168164

169165
Upload with an Output Stream
170166
````````````````````````````
@@ -208,7 +204,7 @@ only certain file documents.
208204

209205
.. note::
210206

211-
The ``Find()`` method requires a query filter as a parameter. To match all
207+
The ``Find()`` method requires a query filter as a parameter. To match all
212208
documents in the ``files`` collection, pass an empty query filter to ``Find()``.
213209

214210
The following example retrieves the file name and length of documents in the
@@ -292,7 +288,7 @@ Rename Files
292288

293289
You can update the name of a GridFS file in your bucket by using the ``Rename()``
294290
method. Pass a file ID value and a new ``filename`` value as arguments to
295-
``Rename()``.
291+
``Rename()``.
296292

297293
The following example renames a file to ``"mongodbTutorial.zip"``:
298294

@@ -309,7 +305,7 @@ Delete Files
309305
~~~~~~~~~~~~
310306

311307
You can remove a file from your GridFS bucket by using the ``Delete()`` method.
312-
Pass a file ID value as an argument to ``Delete()``.
308+
Pass a file ID value as an argument to ``Delete()``.
313309

314310
The following example deletes a file:
315311

source/fundamentals/monitoring.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ to the ``ServerClosed`` event by instantiating a
4444
eventArray = append(eventArray, e)
4545
},
4646
}
47-
clientOpts := options.Client().ApplyURI(uri).SetServerMonitor(svrMonitor)
47+
clientOpts := options.Client().ApplyURI(uri).SetServerMonitor(srvMonitor)
4848
client, err := mongo.Connect(context.Background(), clientOpts)
4949

5050
Event Descriptions
@@ -393,4 +393,4 @@ API Documentation
393393
- `ServerMonitor <{+api+}/event#ServerMonitor>`__ type
394394
- `SetServerMonitor() <{+api+}/mongo/options#ClientOptions.SetServerMonitor>`__ method
395395
- `ServerKind <{+api+}/mongo/description#ServerKind>`__ type
396-
- `Server <{+api+}/mongo/description#Server>`__ type
396+
- `Server <{+api+}/mongo/description#Server>`__ type
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
.. tip:: Non-existent Databases and Collections
1+
.. tip:: Nonexistent Databases and Collections
22

33
If the necessary database and collection don't exist when
44
you perform a write operation, the server implicitly creates
55
them.
6-
6+

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type Book struct {
2323
func main() {
2424
var uri string
2525
if uri = os.Getenv("MONGODB_URI"); uri == "" {
26-
log.Fatal("You must set your 'MONGODB_URI' environmental variable. See\n\t https://www.mongodb.com/docs/drivers/go/current/usage-examples/")
26+
log.Fatal("You must set your 'MONGODB_URI' environment variable. See\n\t https://www.mongodb.com/docs/drivers/go/current/usage-examples/")
2727
}
2828

2929
client, err := mongo.Connect(context.TODO(), options.Client().ApplyURI(uri))

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ type Course struct {
2222
func main() {
2323
var uri string
2424
if uri = os.Getenv("MONGODB_URI"); uri == "" {
25-
log.Fatal("You must set your 'MONGODB_URI' environmental variable. See\n\t https://www.mongodb.com/docs/drivers/go/current/usage-examples/#environment-variable")
25+
log.Fatal("You must set your 'MONGODB_URI' environment variable. See\n\t https://www.mongodb.com/docs/drivers/go/current/usage-examples/#environment-variable")
2626
}
2727

2828
client, err := mongo.Connect(context.TODO(), options.Client().ApplyURI(uri))

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ type Tea struct {
2222
func main() {
2323
var uri string
2424
if uri = os.Getenv("MONGODB_URI"); uri == "" {
25-
log.Fatal("You must set your 'MONGODB_URI' environmental variable. See\n\t https://www.mongodb.com/docs/drivers/go/current/usage-examples/")
25+
log.Fatal("You must set your 'MONGODB_URI' environment variable. See\n\t https://www.mongodb.com/docs/drivers/go/current/usage-examples/")
2626
}
2727

2828
client, err := mongo.Connect(context.TODO(), options.Client().ApplyURI(uri))

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type MyStruct struct {
2121
func main() {
2222
var uri string
2323
if uri = os.Getenv("MONGODB_URI"); uri == "" {
24-
log.Fatal("You must set your 'MONGODB_URI' environmental variable. See\n\t https://www.mongodb.com/docs/drivers/go/current/usage-examples/")
24+
log.Fatal("You must set your 'MONGODB_URI' environment variable. See\n\t https://www.mongodb.com/docs/drivers/go/current/usage-examples/")
2525
}
2626

2727
client, err := mongo.Connect(context.TODO(), options.Client().ApplyURI(uri))

0 commit comments

Comments
 (0)