Skip to content

DOCSP-49699: compound ops page typo fix #496

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 15 additions & 17 deletions source/fundamentals/crud/compound-operations.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ Compound Operations
.. meta::
: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.

.. default-domain:: mongodb

.. contents:: On this page
:local:
:backlinks: none
Expand Down Expand Up @@ -78,22 +76,22 @@ the specified query filter and deletes it. The method returns a

The ``FindOneAndDelete()`` method is an atomic operation, which means it prevents
any other write operations from changing the matching document until it
completes. The ``deleteOne()`` method is also an atomic operation, but differs from
completes. The ``DeleteOne()`` method is also an atomic operation, but differs from
``FindOneAndDelete()`` in that you cannot specify a sort order for the
matched documents.

To find a document and delete it in separate operations, call the
``findOne()`` method followed by the ``deleteOne()`` method.
``FindOne()`` method followed by the ``DeleteOne()`` method.

Modify Behavior
~~~~~~~~~~~~~~~

You can modify the behavior of the ``FindOneAndDelete()`` method by
passing in a ``FineOneAndDeleteOptions``. If you don't specify a
``FineOneAndDeleteOptions``, the driver uses the default values for each
passing in a ``FindOneAndDeleteOptions``. If you don't specify a
``FindOneAndDeleteOptions``, the driver uses the default values for each
option.

The ``FineOneAndDeleteOptions`` type allows you to configure options
The ``FindOneAndDeleteOptions`` type allows you to configure options
with the following methods:

.. list-table::
Expand Down Expand Up @@ -163,22 +161,22 @@ document.

The ``FindOneAndUpdate()`` method is an atomic operation, which means it prevents
any other write operations from changing the matching document until it
completes. The ``updateOne()`` method is also an atomic operation, but differs from
``FindOneAndUpdate()`` in that you cannot specify a sort order for the
matched documents.
completes. The ``UpdateOne()`` method is also an atomic operation, but differs from
``FindOneAndUpdate()`` because you cannot return the pre-image of the
updated document when using ``UpdateOne()``.

To find a document and update it in separate operations, call
the ``findOne()`` method followed by the ``updateOne()`` method.
the ``FindOne()`` method followed by the ``UpdateOne()`` method.

Modify Behavior
~~~~~~~~~~~~~~~

You can modify the behavior of the ``FindOneAndUpdate()`` method by
passing in a ``FineOneAndUpdateOptions``. If you don't specify a
``FineOneAndUpdateOptions``, the driver uses the default values for each
passing in a ``FindOneAndUpdateOptions``. If you don't specify a
``FindOneAndUpdateOptions``, the driver uses the default values for each
option.

The ``FineOneAndUpdateOptions`` type allows you to configure options
The ``FindOneAndUpdateOptions`` type allows you to configure options
with the following methods:

.. list-table::
Expand Down Expand Up @@ -276,11 +274,11 @@ Modify Behavior
~~~~~~~~~~~~~~~

You can modify the behavior of the ``FindOneAndReplace()`` method by
passing in a ``FineOneAndReplaceOptions``. If you don't specify a
``FineOneAndReplaceOptions``, the driver uses the default values for each
passing in a ``FindOneAndReplaceOptions``. If you don't specify a
``FindOneAndReplaceOptions``, the driver uses the default values for each
option.

The ``FineOneAndReplaceOptions`` type allows you to configure options
The ``FindOneAndReplaceOptions`` type allows you to configure options
with the following methods:

.. list-table::
Expand Down
2 changes: 0 additions & 2 deletions source/fundamentals/crud/read-operations/skip.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ Skip Returned Results
.. meta::
: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.

.. default-domain:: mongodb

.. contents:: On this page
:local:
:backlinks: none
Expand Down
4 changes: 1 addition & 3 deletions source/fundamentals/crud/read-operations/sort.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ Sort Results
.. meta::
:description: Learn how to sort query results, handle ties, and apply sorting in aggregation pipelines with the MongoDB Go Driver.

.. default-domain:: mongodb

.. contents:: On this page
:local:
:backlinks: none
Expand Down Expand Up @@ -286,4 +284,4 @@ guide, see the following API Documentation:
- `FindOneAndDelete() <{+api+}/mongo#Collection.FindOneAndDelete>`__
- `FindOneAndUpdate() <{+api+}/mongo#Collection.FindOneAndUpdate>`__
- `FindOneAndReplace() <{+api+}/mongo#Collection.FindOneAndReplace>`__
- `GridFSBucket.Find() <{+api+}/mongo#GridFSBucket.Find>`__
- `GridFSBucket.Find() <{+api+}/mongo#GridFSBucket.Find>`__
5 changes: 2 additions & 3 deletions source/fundamentals/crud/write-operations/bulk.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ Bulk Operations
.. meta::
:description: Learn to perform bulk write operations with the MongoDB Go Driver, including inserts, updates, replacements, and deletions, using the bulkWrite() method.

.. default-domain:: mongodb

.. contents:: On this page
:local:
:backlinks: none
Expand Down Expand Up @@ -789,4 +787,5 @@ see the following API documentation:
- `NewClientUpdateOneModel() <{+api+}/mongo#NewClientUpdateOneModel>`__
- `NewClientUpdateManyModel() <{+api+}/mongo#NewClientUpdateManyModel>`__
- `NewClientDeleteOneModel() <{+api+}/mongo#NewClientDeleteOneModel>`__
- `NewClientDeleteManyModel() <{+api+}/mongo#NewClientDeleteManyModel>`__
- `NewClientDeleteManyModel()
<{+api+}/mongo#NewClientDeleteManyModel>`__
2 changes: 1 addition & 1 deletion source/fundamentals/crud/write-operations/delete.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Delete Documents
================

.. meta::
:description: Learn how to remove documents from collections with the deleteOne() and deleteMany() methods in the MongoDB Go Driver, with examples and options.
:description: Learn how to remove documents from collections with the DeleteOne() and DeleteMany() methods in the MongoDB Go Driver, with examples and options.

.. contents:: On this page
:local:
Expand Down
2 changes: 1 addition & 1 deletion source/fundamentals/crud/write-operations/insert.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Insert a Document

.. meta::
:keywords: code example, write operation, add data
:description: Learn how to insert documents into a MongoDB collection using the insertOne() and insertMany() methods, with options to modify their behavior.
:description: Learn how to insert documents into a MongoDB collection using the InsertOne() and InsertMany() methods, with options to modify their behavior.

.. contents:: On this page
:local:
Expand Down
2 changes: 1 addition & 1 deletion source/fundamentals/crud/write-operations/modify.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Modify Documents

.. meta::
:keywords: code example, write operation, change data
:description: Learn how to modify MongoDB documents using update and replace operations, including methods like updateOne(), updateMany(), and replaceOne().
:description: Learn how to modify MongoDB documents using update and replace operations, including methods like UpdateOne(), UpdateMany(), and ReplaceOne().

.. contents:: On this page
:local:
Expand Down
4 changes: 2 additions & 2 deletions source/fundamentals/indexes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ results directly from the index, also called a **covered query**.
- ``name`` ascending, ``age`` descending
- ``name`` descending, ``age`` ascending

Specifying a sort order of ``name`` and :guilabel:`age` ascending or :guilabel:`name` and ``age``
descending requires an in-memory sort.
However, specifying a sort order of both fields in the same
direction requires an in-memory sort.

To learn how to ensure your index covers your query criteria and
projection, see :manual:`Query Coverage
Expand Down
4 changes: 1 addition & 3 deletions source/fundamentals/stable-api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
.. meta::
:description: Learn how to specify Stable API compatibility in the MongoDB Go Driver to ensure operations align with a defined API version.

.. default-domain:: mongodb

.. contents:: On this page
:local:
:backlinks: none
Expand Down Expand Up @@ -152,4 +150,4 @@ API Documentation:
- `ServerAPIOptions <{+api+}/mongo/options#ServerAPIOptions>`__
- `ServerApiVersion <{+api+}/mongo/options#ServerAPIVersion>`__
- `SetDeprecationErrors() <{+api+}/mongo/options#ServerAPIOptions.SetDeprecationErrors>`__
- `SetStrict() <{+api+}/mongo/options#ServerAPIOptions.SetStrict>`__
- `SetStrict() <{+api+}/mongo/options#ServerAPIOptions.SetStrict>`__
2 changes: 0 additions & 2 deletions source/quick-reference.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ Quick Reference
.. meta::
: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.

.. default-domain:: mongodb

This page shows the driver syntax for several MongoDB commands and links to
their related reference and API documentation.

Expand Down
2 changes: 0 additions & 2 deletions source/usage-examples/command.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ Run a Command Example
.. meta::
:description: Learn how to execute commands on a MongoDB server using the runCommand() method in Go, with an example retrieving database statistics.

.. default-domain:: mongodb

You can run commands directly on your MongoDB server by using the
``RunCommand()`` method.

Expand Down
4 changes: 1 addition & 3 deletions source/usage-examples/deleteMany.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ Delete Multiple Documents
=========================

.. meta::
:description: Learn how to delete multiple documents from a collection using the deleteMany() method in the MongoDB Go Driver.

.. default-domain:: mongodb
:description: Learn how to delete multiple documents from a collection using the DeleteMany() method in the MongoDB Go Driver.

You can delete multiple documents in a collection by using the
``DeleteMany()`` method.
Expand Down
2 changes: 1 addition & 1 deletion source/usage-examples/deleteOne.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Delete a Document
=================

.. meta::
:description: Learn how to delete a document from a collection using the deleteOne() method in the MongoDB Go Driver.
:description: Learn how to delete a document from a collection using the DeleteOne() method in the MongoDB Go Driver.

You can delete a document in a collection by using the ``DeleteOne()``
method.
Expand Down
4 changes: 1 addition & 3 deletions source/usage-examples/findOne.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ Find a Document
===============

.. meta::
:description: Retrieve a single document from a collection using the findOne() method in the MongoDB Go Driver.

.. default-domain:: mongodb
:description: Retrieve a single document from a collection using the FindOne() method in the MongoDB Go Driver.

You can retrieve a single document from a collection by using the
``FindOne()`` method.
Expand Down
4 changes: 1 addition & 3 deletions source/usage-examples/insertMany.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ Insert Multiple Documents
=========================

.. meta::
:description: Learn how to insert multiple documents into a collection using the insertMany() method in the MongoDB Go Driver.

.. default-domain:: mongodb
:description: Learn how to insert multiple documents into a collection using the InsertMany() method in the MongoDB Go Driver.

You can insert multiple documents into a collection by using the ``InsertMany()``
method.
Expand Down
4 changes: 1 addition & 3 deletions source/usage-examples/insertOne.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ Insert a Document Example
=========================

.. meta::
:description: Learn how to insert a document into a collection using the insertOne() method in the MongoDB Go Driver.

.. default-domain:: mongodb
:description: Learn how to insert a document into a collection using the InsertOne() method in the MongoDB Go Driver.

You can insert a document into a collection by using the ``InsertOne()``
method.
Expand Down
4 changes: 1 addition & 3 deletions source/usage-examples/replaceOne.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ Replace a Document
==================

.. meta::
:description: Learn how to replace a document in a MongoDB collection using the replaceOne() method with the MongoDB Go Driver.

.. default-domain:: mongodb
:description: Learn how to replace a document in a MongoDB collection using the ReplaceOne() method with the MongoDB Go Driver.

You can replace a document in a collection by using the ``ReplaceOne()``
method.
Expand Down
2 changes: 1 addition & 1 deletion source/usage-examples/updateMany.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Update Multiple Documents
=========================

.. meta::
:description: Learn how to update multiple documents in a collection using the updateMany() method in the MongoDB Go Driver.
:description: Learn how to update multiple documents in a collection using the UpdateMany() method in the MongoDB Go Driver.

You can update multiple documents in a collection by using the ``UpdateMany()``
method.
Expand Down
2 changes: 1 addition & 1 deletion source/usage-examples/updateOne.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Update a Document
=================

.. meta::
:description: Learn how to update a document in a collection using the updateOne() method in the MongoDB Go Driver.
:description: Learn how to update a document in a collection using the UpdateOne() method in the MongoDB Go Driver.

You can update a document in a collection by using the ``UpdateOne()``
method.
Expand Down
12 changes: 6 additions & 6 deletions source/whats-new.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,23 +86,23 @@ What's New in 2.1
The 2.1 {+driver-short+} release includes the following improvements
and fixes:

- Introduces the new `Client.BulkWrite <{+api+}/mongo#Client.BulkWrite>`__ method,
- Introduces the `Client.BulkWrite <{+api+}/mongo#Client.BulkWrite>`__ method,
enabling clients to perform multiple insert, update, and delete operations across
multiple databases and collections in a single request. To learn more, see the
:ref:`golang-bulk` guide.

- Introduces the new `bson.Vector <{+api+}/bson#Vector>`__ type to make inserting and querying
- Introduces the `bson.Vector <{+api+}/bson#Vector>`__ type to make inserting and querying
vector data by using :atlas:`Atlas Vector Search </atlas-vector-search/vector-search-overview/>`
easier and more efficient. For an example using the ``bson.Vector`` type, see
the {+driver-short+}'s :ref:`Atlas Vector Search <golang-atlas-vector-search>` guide.
easier and more efficient. To view an example that uses the ``bson.Vector`` type, see
the :ref:`Atlas Vector Search <golang-atlas-vector-search>` guide.

- Extends the `ServerError <{+api+}/mongo#ServerError>`__ interface to include
``ErrorCodes``, which returns a list of deduplicated error codes returned by
the server during the lifetime of operation execution.

- Adds the ``sort`` option to `UpdateOneOptions <{+api+}/mongo/options#UpdateOneOptions>`__
and `ReplaceOptions <{+api+}/mongo/options#ReplaceOptions>`__ for the ``updateOne``
and ``replaceOne`` operations.
and `ReplaceOptions <{+api+}/mongo/options#ReplaceOptions>`__ for
standalone update and replace operations and in bulk operations.

For more information about the changes in this version, see the
:github:`v2.1 release notes </mongodb/mongo-go-driver/releases/tag/v2.1.0>`
Expand Down
Loading