Skip to content

Commit 0681d9f

Browse files
committed
LM PR fixes 1
1 parent e39cfd8 commit 0681d9f

File tree

8 files changed

+37
-46
lines changed

8 files changed

+37
-46
lines changed

source/archive-reference-files/fundamentals/crud/read-operations/changestream.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
.. _golang-watch-changes:
2-
.. _golang-monitor-changes:
3-
41
====================
52
Monitor Data Changes
63
====================

source/archive-reference-files/fundamentals/crud/read-operations/count.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
.. _golang-count-documents:
2-
31
===============
42
Count Documents
53
===============

source/archive-reference-files/fundamentals/crud/read-operations/limit.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
.. _golang-limit:
2-
31
====================================
42
Limit the Number of Returned Results
53
====================================

source/archive-reference-files/fundamentals/crud/read-operations/skip.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
.. _golang-skip:
2-
31
=====================
42
Skip Returned Results
53
=====================

source/archive-reference-files/fundamentals/crud/read-operations/sort.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
.. _golang-sort-results:
2-
31
============
42
Sort Results
53
============
@@ -286,4 +284,4 @@ guide, see the following API Documentation:
286284
- `FindOneAndDelete() <{+api+}/mongo#Collection.FindOneAndDelete>`__
287285
- `FindOneAndUpdate() <{+api+}/mongo#Collection.FindOneAndUpdate>`__
288286
- `FindOneAndReplace() <{+api+}/mongo#Collection.FindOneAndReplace>`__
289-
- `GridFSBucket.Find() <{+api+}/mongo#GridFSBucket.Find>`__
287+
- `GridFSBucket.Find() <{+api+}/mongo#GridFSBucket.Find>`__

source/crud/query.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ Query Operations
88

99
Specify a Query </crud/query/query-document>
1010
Find Documents </crud/query/retrieve>
11+
Access Data from a Cursor </crud/query/cursor>
1112
Specify Documents to Return </crud/query/specify-return-documents>
1213
Specify Fields to Return </crud/query/project>
1314
Count Documents </crud/query/count>
1415
Distinct Field Values </crud/query/distinct>
15-
Access Data from a Cursor </crud/query/cursor>
16+
Search Text </crud/query/text>
1617
Geospatial Queries </crud/query/geo>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.. _golang-search-text:
22

3-
===========
4-
Search Text
5-
===========
3+
=====================
4+
Perform a Text Search
5+
=====================
66

77
.. meta::
88
:description: Learn how to perform text searches with the MongoDB Go Driver, including creating text indexes and sorting results by relevance.

source/reference/quick-reference.txt

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ documentation.
6969
result, err := coll.InsertOne(
7070
context.TODO(),
7171
bson.D{
72-
{"animal", "Dog"},
73-
{"breed", "Beagle"}
72+
{"firstName", "Aliya"},
73+
{"lastName", "Sanders"}
7474
}
7575
)
7676

@@ -107,13 +107,13 @@ documentation.
107107
bson.D{{"firstName", "Erik"}},
108108
bson.D{{"$set", bson.D{{"age", 28}}}}
109109
)
110-
fmt.Printf("The number of modified documents: %d\n", result.ModifiedCount)
110+
fmt.Printf("Number of modified documents: %d\n", result.ModifiedCount)
111111

112112
.. output::
113113
:language: go
114114
:visible: false
115115

116-
The number of modified documents: 1
116+
Number of modified documents: 1
117117

118118
* - | **Update Multiple Documents**
119119
|
@@ -128,16 +128,16 @@ documentation.
128128

129129
result, err := coll.UpdateMany(
130130
context.TODO(),
131-
bson.D{{"age", bson.D{{"$gte", 58}}}},
132-
bson.D{{"$set", bson.D{{"description", "Senior"}}}}
131+
bson.D{{"age", bson.D{{"$gte", 65}}}},
132+
bson.D{{"$set", bson.D{{"classification", "senior"}}}}
133133
)
134-
fmt.Printf("The number of modified documents: %d\n", result.ModifiedCount)
134+
fmt.Printf("Number of modified documents: %d\n", result.ModifiedCount)
135135

136136
.. output::
137137
:language: go
138138
:visible: false
139139

140-
The number of modified documents: 4
140+
Number of modified documents: 4
141141

142142
* - | **Update Arrays in Documents**
143143
|
@@ -153,15 +153,15 @@ documentation.
153153
result, err := coll.UpdateMany(
154154
context.TODO(),
155155
bson.D{},
156-
bson.D{{"$push", bson.D{{family, "brother"}}}}
156+
bson.D{{"$push", bson.D{{"hobbies", "painting"}}}}
157157
)
158158

159159
.. output::
160160
:language: go
161-
:visible: false
161+
:visible: false
162162

163-
[{firstName Xiao}, {family ["brother"]}, ... ]
164-
[{firstName Omar}, {family ["brother", "mother"]}, ... ]
163+
[{firstName Xiao}, {hobbies ["painting"]}, ... ]
164+
[{firstName Omar}, {hobbies ["kayaking", "painting"]}, ... ]
165165
...
166166

167167
* - | **Replace a Document**
@@ -177,15 +177,15 @@ documentation.
177177

178178
result, err := coll.ReplaceOne(
179179
context.TODO(),
180-
bson.D{{"firstName", "Mick"}},
181-
bson.D{{"firstName", "Mike"}, {"lastName", "Doe"}}
180+
bson.D{{"firstName", "Mick"}, {"lastName", "Salazar"}},
181+
bson.D{{"firstName", "Michael"}, {"lastName", "Salazar Jr."}}
182182
)
183183

184184
.. output::
185185
:language: go
186186
:visible: false
187187

188-
[{{firstName Mike}, {lastName Doe} }]
188+
[{{firstName Michael}, {lastName Salazar Jr.} }]
189189

190190
* - | **Delete a Document**
191191
|
@@ -254,7 +254,7 @@ documentation.
254254
* - | **Access Data from a Cursor Iteratively**
255255
|
256256
| `API Documentation <{+api+}/mongo#Cursor.Next>`__
257-
| :ref:`Cursor Guide <golang-individual-documents>`
257+
| :ref:`Retrieve Documents Individually Reference <golang-individual-documents>`
258258

259259
- .. io-code-block::
260260
:copyable: true
@@ -278,13 +278,13 @@ documentation.
278278

279279
[{firstName Doug} ... ]
280280
[{firstName Erik} ...]
281-
[{lastName Chang} ...]
281+
[{firstName Oleg} ...]
282282
...
283283

284284
* - | **Access Data from a Cursor as an Array**
285285
|
286286
| `API Documentation <{+api+}/mongo#Cursor.All>`__
287-
| :ref:`Cursor Guide <golang-all-documents>`
287+
| :ref:`Retrieve All Documents Reference <golang-all-documents>`
288288

289289
- .. io-code-block::
290290
:copyable: true
@@ -303,9 +303,9 @@ documentation.
303303
:language: go
304304
:visible: false
305305

306-
[{name Mike} ... ]
307-
[{name Edgar} ...]
308-
[{name Freddie} ...]
306+
[{firstName Mike} ... ]
307+
[{firstName Edgar} ...]
308+
[{firstName Freddie} ...]
309309
...
310310

311311
* - | **Count Documents**
@@ -325,7 +325,7 @@ documentation.
325325
:language: go
326326
:visible: false
327327

328-
6
328+
17
329329

330330
* - | **List Distinct Field Values**
331331
|
@@ -364,8 +364,8 @@ documentation.
364364
:language: go
365365
:visible: false
366366

367-
[{breed Beagle} ... ]
368-
[{breed German Shepard} ...]
367+
[{firstName Xiao} ... ]
368+
[{firstName Oleg} ...]
369369

370370
* - | **Skip Retrieved Documents**
371371
|
@@ -385,8 +385,8 @@ documentation.
385385
:language: go
386386
:visible: false
387387

388-
[{item Pen} ... ]
389-
[{item Chair} ...]
388+
[{firstName Sandy} ... ]
389+
[{firstName Michael} ...]
390390

391391
* - | **Sort Retrieved Documents**
392392
|
@@ -432,7 +432,7 @@ documentation.
432432
:language: go
433433
:visible: false
434434

435-
[{firstName Lester}]
435+
[{firstName Lester} {lastName Franklin}]
436436
[{firstName Wendall} {lastName Griffin}]
437437
...
438438

@@ -458,11 +458,12 @@ documentation.
458458
.. input::
459459
:language: go
460460

461-
// only searches fields with text indexes
462-
cursor, err := coll.Find(context.TODO(), bson.D{{"$text", bson.D{{"$search", "beagle"}}}})
461+
// Only searches on fields covered by text indexes
462+
cursor, err := coll.Find(context.TODO(), bson.D{{"$text", bson.D{{"$search", "arts"}}}})
463463

464464
.. output::
465465
:language: go
466466
:visible: false
467467

468-
[{"firstName": "Emily" , "Description": "I love to play sports and walk my beagle."} ... ]
468+
[{"firstName": "Emily" , "biography": "I am involved with arts and culture in my community."} ... ]
469+
[{"firstName": "Juan" , "biography": "I attended the School of Arts for cello performance."} ... ]

0 commit comments

Comments
 (0)