You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/fundamentals/crud/compound-operations.txt
+15-17
Original file line number
Diff line number
Diff line change
@@ -7,8 +7,6 @@ Compound Operations
7
7
.. meta::
8
8
:description: Learn how to perform compound operations in MongoDB using Go, combining read and write actions into a single atomic operation to prevent data alteration.
9
9
10
-
.. default-domain:: mongodb
11
-
12
10
.. contents:: On this page
13
11
:local:
14
12
:backlinks: none
@@ -78,22 +76,22 @@ the specified query filter and deletes it. The method returns a
78
76
79
77
The ``FindOneAndDelete()`` method is an atomic operation, which means it prevents
80
78
any other write operations from changing the matching document until it
81
-
completes. The ``deleteOne()`` method is also an atomic operation, but differs from
79
+
completes. The ``DeleteOne()`` method is also an atomic operation, but differs from
82
80
``FindOneAndDelete()`` in that you cannot specify a sort order for the
83
81
matched documents.
84
82
85
83
To find a document and delete it in separate operations, call the
86
-
``findOne()`` method followed by the ``deleteOne()`` method.
84
+
``FindOne()`` method followed by the ``DeleteOne()`` method.
87
85
88
86
Modify Behavior
89
87
~~~~~~~~~~~~~~~
90
88
91
89
You can modify the behavior of the ``FindOneAndDelete()`` method by
92
-
passing in a ``FineOneAndDeleteOptions``. If you don't specify a
93
-
``FineOneAndDeleteOptions``, the driver uses the default values for each
90
+
passing in a ``FindOneAndDeleteOptions``. If you don't specify a
91
+
``FindOneAndDeleteOptions``, the driver uses the default values for each
94
92
option.
95
93
96
-
The ``FineOneAndDeleteOptions`` type allows you to configure options
94
+
The ``FindOneAndDeleteOptions`` type allows you to configure options
97
95
with the following methods:
98
96
99
97
.. list-table::
@@ -163,22 +161,22 @@ document.
163
161
164
162
The ``FindOneAndUpdate()`` method is an atomic operation, which means it prevents
165
163
any other write operations from changing the matching document until it
166
-
completes. The ``updateOne()`` method is also an atomic operation, but differs from
167
-
``FindOneAndUpdate()`` in that you cannot specify a sort order for the
168
-
matched documents.
164
+
completes. The ``UpdateOne()`` method is also an atomic operation, but differs from
165
+
``FindOneAndUpdate()`` because you cannot return the pre-image of the
166
+
updated document when using ``UpdateOne()``.
169
167
170
168
To find a document and update it in separate operations, call
171
-
the ``findOne()`` method followed by the ``updateOne()`` method.
169
+
the ``FindOne()`` method followed by the ``UpdateOne()`` method.
172
170
173
171
Modify Behavior
174
172
~~~~~~~~~~~~~~~
175
173
176
174
You can modify the behavior of the ``FindOneAndUpdate()`` method by
177
-
passing in a ``FineOneAndUpdateOptions``. If you don't specify a
178
-
``FineOneAndUpdateOptions``, the driver uses the default values for each
175
+
passing in a ``FindOneAndUpdateOptions``. If you don't specify a
176
+
``FindOneAndUpdateOptions``, the driver uses the default values for each
179
177
option.
180
178
181
-
The ``FineOneAndUpdateOptions`` type allows you to configure options
179
+
The ``FindOneAndUpdateOptions`` type allows you to configure options
182
180
with the following methods:
183
181
184
182
.. list-table::
@@ -276,11 +274,11 @@ Modify Behavior
276
274
~~~~~~~~~~~~~~~
277
275
278
276
You can modify the behavior of the ``FindOneAndReplace()`` method by
279
-
passing in a ``FineOneAndReplaceOptions``. If you don't specify a
280
-
``FineOneAndReplaceOptions``, the driver uses the default values for each
277
+
passing in a ``FindOneAndReplaceOptions``. If you don't specify a
278
+
``FindOneAndReplaceOptions``, the driver uses the default values for each
281
279
option.
282
280
283
-
The ``FineOneAndReplaceOptions`` type allows you to configure options
281
+
The ``FindOneAndReplaceOptions`` type allows you to configure options
Copy file name to clipboardExpand all lines: source/fundamentals/crud/read-operations/skip.txt
-2
Original file line number
Diff line number
Diff line change
@@ -7,8 +7,6 @@ Skip Returned Results
7
7
.. meta::
8
8
:description: Learn how to skip a specified number of results in MongoDB read operations using the setSkip() method or the $skip stage in aggregation pipelines.
Copy file name to clipboardExpand all lines: source/fundamentals/crud/write-operations/bulk.txt
+2-3
Original file line number
Diff line number
Diff line change
@@ -7,8 +7,6 @@ Bulk Operations
7
7
.. meta::
8
8
:description: Learn to perform bulk write operations with the MongoDB Go Driver, including inserts, updates, replacements, and deletions, using the bulkWrite() method.
9
9
10
-
.. default-domain:: mongodb
11
-
12
10
.. contents:: On this page
13
11
:local:
14
12
:backlinks: none
@@ -789,4 +787,5 @@ see the following API documentation:
Copy file name to clipboardExpand all lines: source/fundamentals/crud/write-operations/delete.txt
+1-1
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ Delete Documents
5
5
================
6
6
7
7
.. meta::
8
-
:description: Learn how to remove documents from collections with the deleteOne() and deleteMany() methods in the MongoDB Go Driver, with examples and options.
8
+
:description: Learn how to remove documents from collections with the DeleteOne() and DeleteMany() methods in the MongoDB Go Driver, with examples and options.
Copy file name to clipboardExpand all lines: source/fundamentals/crud/write-operations/insert.txt
+1-1
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ Insert a Document
10
10
11
11
.. meta::
12
12
:keywords: code example, write operation, add data
13
-
:description: Learn how to insert documents into a MongoDB collection using the insertOne() and insertMany() methods, with options to modify their behavior.
13
+
:description: Learn how to insert documents into a MongoDB collection using the InsertOne() and InsertMany() methods, with options to modify their behavior.
Copy file name to clipboardExpand all lines: source/fundamentals/crud/write-operations/modify.txt
+1-1
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ Modify Documents
10
10
11
11
.. meta::
12
12
:keywords: code example, write operation, change data
13
-
:description: Learn how to modify MongoDB documents using update and replace operations, including methods like updateOne(), updateMany(), and replaceOne().
13
+
:description: Learn how to modify MongoDB documents using update and replace operations, including methods like UpdateOne(), UpdateMany(), and ReplaceOne().
Copy file name to clipboardExpand all lines: source/quick-reference.txt
-2
Original file line number
Diff line number
Diff line change
@@ -7,8 +7,6 @@ Quick Reference
7
7
.. meta::
8
8
:description: Explore with the MongoDB Go Driver syntax for various commands, including find, insert, update, delete, and more, with links to API documentation and usage examples.
9
9
10
-
.. default-domain:: mongodb
11
-
12
10
This page shows the driver syntax for several MongoDB commands and links to
0 commit comments