From 0ba7384a7674166f223be6fc39201e20b564f929 Mon Sep 17 00:00:00 2001 From: rustagir Date: Thu, 1 May 2025 11:32:39 -0400 Subject: [PATCH 01/15] v2.1+ client bw link in parallelism note --- source/crud/transactions.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source/crud/transactions.txt b/source/crud/transactions.txt index 1b00bc57..c37594c5 100644 --- a/source/crud/transactions.txt +++ b/source/crud/transactions.txt @@ -160,6 +160,14 @@ options, then creates a session with these options: .. sharedinclude:: dbx/transactions-parallelism.rst + .. replacement:: driver-specific-content + + If your application is connected to {+mdb-server+} v8.0 or later, + you can perform write operations on multiple namespaces within a + single transaction by using the client bulk write feature. To + learn more, see the :ref:`golang-bulk-client` section of the Bulk + Operations guide. + Example ------- @@ -211,4 +219,4 @@ guide, see the following API Documentation: - `StartSession() <{+api+}/mongo#Client.StartSession>`__ - `TransactionOptions <{+api+}/mongo/options#TransactionOptions>`__ - `SetWriteConcern() <{+api+}/mongo/options#TransactionOptionsBuilder.SetWriteConcern>`__ -- `InsertMany() <{+api+}/mongo#Collection.InsertMany>`__ \ No newline at end of file +- `InsertMany() <{+api+}/mongo#Collection.InsertMany>`__ From 2022fb22effe66fac7685fb47cfd7f52c6d6baee Mon Sep 17 00:00:00 2001 From: Rea Rustagi <85902999+rustagir@users.noreply.github.com> Date: Thu, 1 May 2025 13:10:45 -0400 Subject: [PATCH 02/15] DOCSP-49699: compound ops page typo fix (#496) * DOCSP-49699: compound ops page typo fix * more fixes I noticed * small fix * small fix * vale --- .../crud/read-operations/skip.txt | 2 -- .../crud/read-operations/sort.txt | 2 -- .../usage-examples/command.txt | 2 -- .../usage-examples/deleteMany.txt | 4 +-- .../usage-examples/deleteOne.txt | 2 +- .../usage-examples/findOne.txt | 4 +-- .../usage-examples/insertMany.txt | 4 +-- .../usage-examples/insertOne.txt | 4 +-- .../usage-examples/replaceOne.txt | 4 +-- .../usage-examples/updateMany.txt | 2 +- .../usage-examples/updateOne.txt | 2 +- .../connect/connection-options/stable-api.txt | 4 +-- source/crud/bulk.txt | 5 ++- source/crud/compound-operations.txt | 32 +++++++++---------- source/crud/delete.txt | 2 +- source/crud/insert.txt | 2 +- source/indexes.txt | 4 +-- source/quick-reference.txt | 2 -- source/reference/release-notes.txt | 12 +++---- 19 files changed, 36 insertions(+), 59 deletions(-) diff --git a/source/archive-reference-files/fundamentals/crud/read-operations/skip.txt b/source/archive-reference-files/fundamentals/crud/read-operations/skip.txt index d7ad895b..a5d34f3d 100644 --- a/source/archive-reference-files/fundamentals/crud/read-operations/skip.txt +++ b/source/archive-reference-files/fundamentals/crud/read-operations/skip.txt @@ -5,8 +5,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 diff --git a/source/archive-reference-files/fundamentals/crud/read-operations/sort.txt b/source/archive-reference-files/fundamentals/crud/read-operations/sort.txt index 4b44a237..9462f6ce 100644 --- a/source/archive-reference-files/fundamentals/crud/read-operations/sort.txt +++ b/source/archive-reference-files/fundamentals/crud/read-operations/sort.txt @@ -5,8 +5,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 diff --git a/source/archive-reference-files/usage-examples/command.txt b/source/archive-reference-files/usage-examples/command.txt index c8242586..5718e1b5 100644 --- a/source/archive-reference-files/usage-examples/command.txt +++ b/source/archive-reference-files/usage-examples/command.txt @@ -6,8 +6,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. diff --git a/source/archive-reference-files/usage-examples/deleteMany.txt b/source/archive-reference-files/usage-examples/deleteMany.txt index 05984844..788d4e9e 100644 --- a/source/archive-reference-files/usage-examples/deleteMany.txt +++ b/source/archive-reference-files/usage-examples/deleteMany.txt @@ -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. diff --git a/source/archive-reference-files/usage-examples/deleteOne.txt b/source/archive-reference-files/usage-examples/deleteOne.txt index bd0baba3..46f29095 100644 --- a/source/archive-reference-files/usage-examples/deleteOne.txt +++ b/source/archive-reference-files/usage-examples/deleteOne.txt @@ -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. diff --git a/source/archive-reference-files/usage-examples/findOne.txt b/source/archive-reference-files/usage-examples/findOne.txt index b7b86617..aadac355 100644 --- a/source/archive-reference-files/usage-examples/findOne.txt +++ b/source/archive-reference-files/usage-examples/findOne.txt @@ -4,9 +4,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. diff --git a/source/archive-reference-files/usage-examples/insertMany.txt b/source/archive-reference-files/usage-examples/insertMany.txt index 87550ff9..1a63c443 100644 --- a/source/archive-reference-files/usage-examples/insertMany.txt +++ b/source/archive-reference-files/usage-examples/insertMany.txt @@ -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. diff --git a/source/archive-reference-files/usage-examples/insertOne.txt b/source/archive-reference-files/usage-examples/insertOne.txt index 25cae79e..827d2d06 100644 --- a/source/archive-reference-files/usage-examples/insertOne.txt +++ b/source/archive-reference-files/usage-examples/insertOne.txt @@ -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. diff --git a/source/archive-reference-files/usage-examples/replaceOne.txt b/source/archive-reference-files/usage-examples/replaceOne.txt index 953dc92a..087887b3 100644 --- a/source/archive-reference-files/usage-examples/replaceOne.txt +++ b/source/archive-reference-files/usage-examples/replaceOne.txt @@ -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. diff --git a/source/archive-reference-files/usage-examples/updateMany.txt b/source/archive-reference-files/usage-examples/updateMany.txt index eb2a2e4f..b4b1e7d3 100644 --- a/source/archive-reference-files/usage-examples/updateMany.txt +++ b/source/archive-reference-files/usage-examples/updateMany.txt @@ -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. diff --git a/source/archive-reference-files/usage-examples/updateOne.txt b/source/archive-reference-files/usage-examples/updateOne.txt index 919fb98c..3b54bdc9 100644 --- a/source/archive-reference-files/usage-examples/updateOne.txt +++ b/source/archive-reference-files/usage-examples/updateOne.txt @@ -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. diff --git a/source/connect/connection-options/stable-api.txt b/source/connect/connection-options/stable-api.txt index 46b853b8..7d56cc11 100644 --- a/source/connect/connection-options/stable-api.txt +++ b/source/connect/connection-options/stable-api.txt @@ -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 @@ -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>`__ \ No newline at end of file +- `SetStrict() <{+api+}/mongo/options#ServerAPIOptions.SetStrict>`__ diff --git a/source/crud/bulk.txt b/source/crud/bulk.txt index 7daf6963..c63431bf 100644 --- a/source/crud/bulk.txt +++ b/source/crud/bulk.txt @@ -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 @@ -811,4 +809,5 @@ see the following API documentation: - `NewClientUpdateOneModel() <{+api+}/mongo#NewClientUpdateOneModel>`__ - `NewClientUpdateManyModel() <{+api+}/mongo#NewClientUpdateManyModel>`__ - `NewClientDeleteOneModel() <{+api+}/mongo#NewClientDeleteOneModel>`__ -- `NewClientDeleteManyModel() <{+api+}/mongo#NewClientDeleteManyModel>`__ \ No newline at end of file +- `NewClientDeleteManyModel() + <{+api+}/mongo#NewClientDeleteManyModel>`__ diff --git a/source/crud/compound-operations.txt b/source/crud/compound-operations.txt index e2a95cb8..652b05bd 100644 --- a/source/crud/compound-operations.txt +++ b/source/crud/compound-operations.txt @@ -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 @@ -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:: @@ -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:: @@ -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:: diff --git a/source/crud/delete.txt b/source/crud/delete.txt index 890b7a30..1f816754 100644 --- a/source/crud/delete.txt +++ b/source/crud/delete.txt @@ -6,7 +6,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: diff --git a/source/crud/insert.txt b/source/crud/insert.txt index df8e2a9f..f9fec9b4 100644 --- a/source/crud/insert.txt +++ b/source/crud/insert.txt @@ -10,7 +10,7 @@ Insert Documents .. 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: diff --git a/source/indexes.txt b/source/indexes.txt index 92768652..66dcf26d 100644 --- a/source/indexes.txt +++ b/source/indexes.txt @@ -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 diff --git a/source/quick-reference.txt b/source/quick-reference.txt index 93a7cc37..3e98c2ed 100644 --- a/source/quick-reference.txt +++ b/source/quick-reference.txt @@ -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. diff --git a/source/reference/release-notes.txt b/source/reference/release-notes.txt index 92f5ad6e..ea8162b7 100644 --- a/source/reference/release-notes.txt +++ b/source/reference/release-notes.txt @@ -83,23 +83,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 ` - easier and more efficient. For an example using the ``bson.Vector`` type, see - the {+driver-short+}'s :ref:`Atlas Vector Search ` guide. + easier and more efficient. To view an example that uses the ``bson.Vector`` type, see + the :ref:`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 ` From d94b2e6d7897abb8d84c63d431e4874da03483f3 Mon Sep 17 00:00:00 2001 From: Rachel Mackintosh Date: Fri, 2 May 2025 13:36:23 -0400 Subject: [PATCH 03/15] remove screenshots --- source/includes/quick-start/atlas-setup.rst | 28 ++++++--------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/source/includes/quick-start/atlas-setup.rst b/source/includes/quick-start/atlas-setup.rst index d9ee6259..76f14c5b 100644 --- a/source/includes/quick-start/atlas-setup.rst +++ b/source/includes/quick-start/atlas-setup.rst @@ -43,26 +43,14 @@ when applicable, and connection options. .. step:: Retrieve your MongoDB Atlas connection string To retrieve your connection string for the cluster you created in the - previous section, log in to your Atlas account. Navigate to the - :guilabel:`Database` section and click :guilabel:`Clusters`. Click the - :guilabel:`Connect` button for the cluster that you want to connect to as - shown below: - - .. figure:: /includes/figures/atlas_connection_select_cluster.png - :alt: Atlas Connection GUI cluster selection screen - - Then, select the :guilabel:`Drivers` option under the :guilabel:`Connect - to your application` header. Select "Go" from the :guilabel:`Driver` - selection menu and the version that best matches the version you installed - from the :guilabel:`Version` selection menu. - - .. step:: Copy your connection string - - Click the button to the right of the connection string to copy it to your - clipboard, as shown in the following screenshot: - - .. figure:: /includes/figures/atlas_connection_copy_string_go.png - :alt: Atlas Connection GUI connection string screen + previous section, do the following: + + 1. Log in to your Atlas account. + 2. Navigate to the :guilabel:`Database` section on the sidebar and select :guilabel:`Clusters`. + 3. Find the cluster you would like to connect to and click the :guilabel:`Connect` button. + 4. Under :guilable:`Connect to your application`, click the :guilabel:`Drivers` option. + 5. Select "Go" from the :guilabel:`Driver` selection menu and the appropriate version from the :guilabel:`Version` selection menu. + 6. Copy the connection string clipboard, as shown in the following screenshot: .. step:: Update the placeholders From d487f74ed36f70602b1fffc488dcb99957c861c7 Mon Sep 17 00:00:00 2001 From: Rachel Mackintosh Date: Fri, 2 May 2025 13:40:21 -0400 Subject: [PATCH 04/15] link description --- source/includes/quick-start/atlas-setup.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/includes/quick-start/atlas-setup.rst b/source/includes/quick-start/atlas-setup.rst index 76f14c5b..533de620 100644 --- a/source/includes/quick-start/atlas-setup.rst +++ b/source/includes/quick-start/atlas-setup.rst @@ -63,6 +63,5 @@ when applicable, and connection options. After completing these steps, you have a connection string that corresponds your Atlas cluster. -To learn more about connecting to the {+driver-long+} through Atlas, see -the :atlas:`Atlas driver connection guide ` -and select **Go** from the :guilabel:`Select your language` dropdown. +To learn more about connecting to Atlas through the {+driver-long+} and applying +connection options, see the :atlas:`Atlas driver connection guide `. From 8f0c297d57681aecf1ff24b125961179dd992b51 Mon Sep 17 00:00:00 2001 From: Rachel Mackintosh Date: Mon, 5 May 2025 10:22:15 -0400 Subject: [PATCH 05/15] MW feedback --- source/includes/quick-start/atlas-setup.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/includes/quick-start/atlas-setup.rst b/source/includes/quick-start/atlas-setup.rst index 533de620..35cae229 100644 --- a/source/includes/quick-start/atlas-setup.rst +++ b/source/includes/quick-start/atlas-setup.rst @@ -50,7 +50,7 @@ when applicable, and connection options. 3. Find the cluster you would like to connect to and click the :guilabel:`Connect` button. 4. Under :guilable:`Connect to your application`, click the :guilabel:`Drivers` option. 5. Select "Go" from the :guilabel:`Driver` selection menu and the appropriate version from the :guilabel:`Version` selection menu. - 6. Copy the connection string clipboard, as shown in the following screenshot: + 6. Copy the connection string clipboard. .. step:: Update the placeholders @@ -63,5 +63,5 @@ when applicable, and connection options. After completing these steps, you have a connection string that corresponds your Atlas cluster. -To learn more about connecting to Atlas through the {+driver-long+} and applying +To learn more about connecting to Atlas by using the {+driver-long+} and applying connection options, see the :atlas:`Atlas driver connection guide `. From 3236f3f8ca1b258989409fb649c57e1382d77465 Mon Sep 17 00:00:00 2001 From: Nora Reidy Date: Wed, 7 May 2025 15:12:01 -0400 Subject: [PATCH 06/15] DOCSP-49853: 2.2.1 release (#498) --- snooty.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snooty.toml b/snooty.toml index 96383e35..df720d7f 100644 --- a/snooty.toml +++ b/snooty.toml @@ -24,8 +24,8 @@ driver-long = "MongoDB Go Driver" driver-short = "Go driver" language = "Go" docs-branch = "master" -version = "v2.1" -full-version = "{+version+}.0" +version = "v2.2" +full-version = "{+version+}.1" example = "https://raw.githubusercontent.com/mongodb/docs-golang/{+docs-branch+}/source/includes/usage-examples/code-snippets" api = "https://pkg.go.dev/go.mongodb.org/mongo-driver/{+api-version+}" stable-api = "Stable API" From 7f5ac3196406f489cd074d19910d3f2a66ebc42e Mon Sep 17 00:00:00 2001 From: Nora Reidy Date: Thu, 15 May 2025 14:32:25 -0400 Subject: [PATCH 07/15] DOCSP-50090: Add netlify links action (#500) --- .github/pull_request_template.md | 4 +- .github/workflows/add-netlify-links.yml | 58 +++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/add-netlify-links.yml diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index daab1e6c..7fe5d675 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -3,7 +3,9 @@ [PR Reviewing Guidelines](https://github.com/mongodb/docs-golang/blob/master/REVIEWING.md) JIRA - -Staging - + +### Staging Links + ## Self-Review Checklist diff --git a/.github/workflows/add-netlify-links.yml b/.github/workflows/add-netlify-links.yml new file mode 100644 index 00000000..01bb48bc --- /dev/null +++ b/.github/workflows/add-netlify-links.yml @@ -0,0 +1,58 @@ +name: Add Netlify Links To Changed Pages +on: + workflow_call: + pull_request_target: +jobs: + get-pr-changes: + name: Get Changed Files & Update PR Description + runs-on: ubuntu-latest + permissions: + issues: write + contents: write + pull-requests: write + repository-projects: write + steps: + - uses: actions/checkout@v4 + - name: Get Changed Files + id: changed-files + # pin to a specific commit to ensure stability + uses: tj-actions/changed-files@c65cd883420fd2eb864698a825fc4162dd94482c + with: + separator: "," + files: source/** + - name: Build Netlify Links for Changed Pages + id: build_page_links + env: + CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} + run: | + new_links="" + base_link='https://deploy-preview-${{ github.event.number }}--docs-golang.netlify.app' + files=$(echo "$CHANGED_FILES" | tr "," "\n") + for file in $files; do + echo "processing ${file}" + if (! grep -s "includes/" <<< "$file") && + (! grep -s "images/" <<< "$file") && + (! grep -s "examples/" <<< "$file"); then + file="${file#source}" + file="${file%.txt}" + filenoslash="${file:1}" + echo "${base_link}${file}" + new_links+="
  • ${filenoslash}
  • " + else + echo "(file skipped)" + fi + done + if [ "$new_links" == "" ]; then + new_links="No pages to preview" + fi + echo "Final new_links string: " + echo "${new_links}" + echo "staging_links=${new_links}" >> "$GITHUB_OUTPUT" + - name: Update the PR Description + uses: MongoCaleb/pr-description-action@master + with: + regex: ".*" + appendContentOnMatchOnly: true + regexFlags: is + content: "\n${{ steps.build_page_links.outputs.staging_links }}\n" + token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 6a489c7e548a43d13da62d4af59bf8e2532a8c3c Mon Sep 17 00:00:00 2001 From: Nora Reidy Date: Thu, 22 May 2025 13:31:21 -0400 Subject: [PATCH 08/15] DOCSP-50026: remove eol server versions (#501) * DOCSP-50026: remove eol server versions * build * fix * JS feedback --- .../fundamentals/auth.txt | 79 +++---------------- .../network-compression.txt | 6 +- .../mongodb-compatibility-table-go.rst | 25 ------ 3 files changed, 15 insertions(+), 95 deletions(-) diff --git a/source/archive-reference-files/fundamentals/auth.txt b/source/archive-reference-files/fundamentals/auth.txt index eda165ad..967f6bd9 100644 --- a/source/archive-reference-files/fundamentals/auth.txt +++ b/source/archive-reference-files/fundamentals/auth.txt @@ -33,7 +33,6 @@ The Go driver supports the following authentication mechanisms: * :ref:`SCRAM-SHA-256 ` * :ref:`SCRAM-SHA-1 ` -* :ref:`MONGODB-CR ` * :ref:`MongoDB-AWS ` * :ref:`X.509 ` @@ -63,33 +62,17 @@ Each authentication mechanism contains the following placeholders: authentication data. If you omit this option, the driver uses the default value ``admin``. +.. _golang_sha_256: .. _golang-default-auth-mechanism: -Default -~~~~~~~ - -The default mechanism uses one of the following authentication -mechanisms depending on what MongoDB versions your server supports: - -.. list-table:: - :header-rows: 1 - :stub-columns: 1 - :class: compatibility-large - - * - Mechanism - - Versions - - * - ``SCRAM-SHA-256`` - - MongoDB 4.0 and later - - * - ``SCRAM-SHA-1`` - - MongoDB 3.0, 3.2, 3.4, and 3.6 +``SCRAM-SHA-256`` +~~~~~~~~~~~~~~~~~ - * - ``MONGODB-CR`` - - MongoDB 2.6 and earlier +``SCRAM-SHA-256`` is a salted challenge-response authentication mechanism +(SCRAM) that uses your database username and password, encrypted with the ``SHA-256`` +algorithm, to authenticate your user. This is the default authentication mechanism. -To specify the default authentication mechanism, omit the -``AuthMechanism`` option: +To specify this default authentication mechanism, omit the ``AuthMechanism`` option: .. code-block:: go @@ -103,26 +86,8 @@ To specify the default authentication mechanism, omit the client, err := mongo.Connect(clientOpts) -To learn more about the challenge-response (CR) and salted -challenge-response authentication mechanisms (SCRAM) that MongoDB supports, -see the :manual:`SCRAM ` section of the server manual. - -.. _golang_sha_256: - -``SCRAM-SHA-256`` -~~~~~~~~~~~~~~~~~ - -.. important:: - - ``SCRAM-SHA-256`` is the default authentication method for MongoDB starting - in MongoDB 4.0. - -``SCRAM-SHA-256`` is a salted challenge-response authentication mechanism -(SCRAM) that uses your database username and password, encrypted with the ``SHA-256`` -algorithm, to authenticate your user. - -To specify the ``SCRAM-SHA-256`` authentication mechanism, assign the -``AuthMechanism`` option the value ``"SCRAM-SHA-256"``: +You can also explicitly specify the ``SCRAM-SHA-256`` authentication mechanism +by assigning the ``AuthMechanism`` option the value ``"SCRAM-SHA-256"``: .. code-block:: go :emphasize-lines: 2 @@ -138,17 +103,15 @@ To specify the ``SCRAM-SHA-256`` authentication mechanism, assign the client, err := mongo.Connect(clientOpts) +To learn more about the challenge-response authentication mechanisms (SCRAM) that MongoDB supports, +see the :manual:`SCRAM ` section of the Server manual. + .. _golang-scram-sha-1-auth-mechanism: .. _golang-sha-1: ``SCRAM-SHA-1`` ~~~~~~~~~~~~~~~ -.. important:: - - ``SCRAM-SHA-1`` is the default authentication method for MongoDB versions - 3.0, 3.2, 3.4, and 3.6. - ``SCRAM-SHA-1`` is a salted challenge-response mechanism (SCRAM) that uses your username and password, encrypted using the ``SHA-1`` algorithm, to authenticate your user. @@ -170,29 +133,11 @@ To specify the ``SCRAM-SHA-1`` authentication mechanism, assign the client, err := mongo.Connect(clientOpts) -.. _golang-mongodb-cr: - -``MONGODB-CR`` -~~~~~~~~~~~~~~ - -``MONGODB-CR`` is a challenge-response authentication mechanism that uses your -username and password to authenticate your user. - -.. important:: - - This authentication mechanism was deprecated starting in MongoDB 3.6 - and is no longer supported as of MongoDB 4.0. - .. _golang-mongodb-aws: ``MONGODB-AWS`` ~~~~~~~~~~~~~~~ -.. important:: - - The MONGODB-AWS authentication mechanism is available only in MongoDB - versions 4.4 and later. - The ``MONGODB-AWS`` authentication mechanism uses your Amazon Web Services Identity and Access Management (AWS IAM) credentials to authenticate your user. diff --git a/source/connect/connection-options/network-compression.txt b/source/connect/connection-options/network-compression.txt index ae9285ae..c0dad717 100644 --- a/source/connect/connection-options/network-compression.txt +++ b/source/connect/connection-options/network-compression.txt @@ -23,11 +23,11 @@ your application. The {+driver-short+} supports the following compression algorithms: -1. `Snappy `__: available in MongoDB 3.4 and later. +1. `Snappy `__ -2. `Zlib `__: available in MongoDB 3.6 and later. +#. `Zlib `__ -3. `Zstandard `__: available in MongoDB 4.2 and later. +#. `Zstandard `__ If you specify multiple compression algorithms, the driver selects the first one in the list supported by your MongoDB deployment. diff --git a/source/includes/mongodb-compatibility-table-go.rst b/source/includes/mongodb-compatibility-table-go.rst index 3b8a223f..a4c9ec20 100644 --- a/source/includes/mongodb-compatibility-table-go.rst +++ b/source/includes/mongodb-compatibility-table-go.rst @@ -8,54 +8,29 @@ - MongoDB 7.0 - MongoDB 6.1 - MongoDB 6.0 - - MongoDB 5.0 - - MongoDB 4.4 - - MongoDB 4.2 - - MongoDB 4.0 - - MongoDB 3.6 * - 2.2 - ✓ - ✓ - ✓ - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✗ * - 2.1 - ✓ - ✓ - ✓ - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ * - 1.12 to 2.0 - ⊛ [#8.0-support]_ - ✓ - ✓ - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ * - 1.11 - ⊛ - ⊛ - ✓ - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ .. [#8.0-support] {+driver-short+} v1.17 and v2.0 are partially compatible with {+mdb-server+} 8.0 but do not support client bulk write. From 9244ff50954ba31b926cca4a14990f6093618ab6 Mon Sep 17 00:00:00 2001 From: Nora Reidy Date: Fri, 6 Jun 2025 16:33:25 -0400 Subject: [PATCH 09/15] DOCSP-50565: Go v2.2.2 (#510) --- snooty.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snooty.toml b/snooty.toml index df720d7f..e284999d 100644 --- a/snooty.toml +++ b/snooty.toml @@ -25,7 +25,7 @@ driver-short = "Go driver" language = "Go" docs-branch = "master" version = "v2.2" -full-version = "{+version+}.1" +full-version = "{+version+}.2" example = "https://raw.githubusercontent.com/mongodb/docs-golang/{+docs-branch+}/source/includes/usage-examples/code-snippets" api = "https://pkg.go.dev/go.mongodb.org/mongo-driver/{+api-version+}" stable-api = "Stable API" From 90bc4c2767851ec38c363f411af855b5385fbd1e Mon Sep 17 00:00:00 2001 From: Stephanie <52582720+stephmarie17@users.noreply.github.com> Date: Mon, 7 Jul 2025 09:36:54 -0700 Subject: [PATCH 10/15] DOCSP-49780 Update Go min version (#523) --- snooty.toml | 1 + source/includes/language-compatibility-table-go.rst | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/snooty.toml b/snooty.toml index e284999d..87c142ea 100644 --- a/snooty.toml +++ b/snooty.toml @@ -28,6 +28,7 @@ version = "v2.2" full-version = "{+version+}.2" example = "https://raw.githubusercontent.com/mongodb/docs-golang/{+docs-branch+}/source/includes/usage-examples/code-snippets" api = "https://pkg.go.dev/go.mongodb.org/mongo-driver/{+api-version+}" +min-lang-version = "1.19" stable-api = "Stable API" qe = "Queryable Encryption" key-vault-long = "key vault collection" diff --git a/source/includes/language-compatibility-table-go.rst b/source/includes/language-compatibility-table-go.rst index 9c241472..370f7627 100644 --- a/source/includes/language-compatibility-table-go.rst +++ b/source/includes/language-compatibility-table-go.rst @@ -1 +1 @@ -The {+driver-long+} requires Go 1.18 or later. \ No newline at end of file +The {+driver-long+} requires Go {+min-lang-version+} or later. \ No newline at end of file From 95969944b396fa2d86a57814256b552b3144112a Mon Sep 17 00:00:00 2001 From: Angela Date: Mon, 28 Jul 2025 12:05:42 -0400 Subject: [PATCH 11/15] bson raw --- source/data-formats/bson.txt | 58 ++++++++++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 3 deletions(-) diff --git a/source/data-formats/bson.txt b/source/data-formats/bson.txt index 2cadcb55..30df7030 100644 --- a/source/data-formats/bson.txt +++ b/source/data-formats/bson.txt @@ -348,11 +348,63 @@ user-defined struct by using methods from the ``bson`` package: You can use the ``Raw`` type to retrieve elements from a BSON document byte slice without unmarshalling it to a Go type. This type allows you to look up individual elements without unmarshalling - the entire BSON document. + the entire BSON document. For more information about how to use the ``Raw`` type, see + the :ref:`golang-bson-raw` section. To learn more about the marshalling and unmarshalling methods used with the -``Cursor`` type, see the `Cursor API documentation <{+api+}/mongo#Cursor>`__ +``Cursor`` type, see the `Cursor API documentation <{+api+}/mongo#Cursor>`__. To learn more about the marshalling and unmarshalling methods in the ``bson`` package, see the `bson API documentation -<{+api+}/bson#hdr-Marshalling_and_Unmarshalling>`_ +<{+api+}/bson#hdr-Marshalling_and_Unmarshalling>`_. + +.. _golang-bson-raw: + +Work with Raw BSON Data +----------------------- + +The {+driver-short+} supports working with raw BSON documents through the ``Raw`` type. The ``Raw`` +type allows you to validate and retrieve elements from a slice of bytes without unmarshalling +the entire BSON document. This is useful in the following situations: + +- Performing lookups on specific fields without converting the entire document +- Reducing memory overhead by avoiding full document unmarshalling +- Working directly with binary BSON data received from the database + +The ``Raw`` type provides methods to validate the BSON document and look up individual +elements by their keys. The following example demonstrates how to validate a raw BSON document and retrieve +a specific field from it: + +.. io-code-block:: + :copyable: true + + .. input:: + :language: go + + collection := client.Database("sample_restaurants").Collection("restaurants") + findOptions := options.FindOne() + var raw bson.Raw + err = collection.FindOne( + context.TODO(), + bson.D{{"name", "Mongo's Pizza"}}, + findOptions, + ).Decode(&raw) + if err != nil { + log.Fatalf("Failed to find document: %v", err) + } + + // Print the document type + fmt.Printf("Document type: %T\n", raw) + + // Access a field from the raw document + name := raw.Lookup("name").StringValue() + fmt.Println("Restaurant name:", name) + + .. output:: + :language: none + :visible: false + + Document type: bson.Raw + Restaurant name: Mongo's Pizza + +To learn more about the Raw family of types, see the `Raw BSON API documentation <{+api+}/bson#hdr-Raw_BSON>`__. From 36d65a465ffe05230910f26464225e6a3c07c74c Mon Sep 17 00:00:00 2001 From: Angela Date: Mon, 28 Jul 2025 16:57:53 -0400 Subject: [PATCH 12/15] melanie feedback --- source/data-formats/bson.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/data-formats/bson.txt b/source/data-formats/bson.txt index 30df7030..15952230 100644 --- a/source/data-formats/bson.txt +++ b/source/data-formats/bson.txt @@ -407,4 +407,4 @@ a specific field from it: Document type: bson.Raw Restaurant name: Mongo's Pizza -To learn more about the Raw family of types, see the `Raw BSON API documentation <{+api+}/bson#hdr-Raw_BSON>`__. +To learn more about the ``Raw`` family of types, see the `Raw BSON API documentation <{+api+}/bson#hdr-Raw_BSON>`__. From ecf17774330bf2d3b307cb4c5cbba79be66f22b7 Mon Sep 17 00:00:00 2001 From: lindseymoore <71525840+lindseymoore@users.noreply.github.com> Date: Mon, 19 May 2025 13:03:04 -0700 Subject: [PATCH 13/15] DOCSP-47019 Shift Go ToC (#499) * DOCSP-47019 Shift Go ToC * generate staging * SA review * connection options drawer * fi crud refs --- source/connect.txt | 2 +- source/connect/connection-options.txt | 14 ++ .../connection-options/connection-pools.txt | 2 +- .../connection-options/server-selection.txt | 1 + .../specify-connection-options.txt | 131 ++++++++++++++++++ source/crud/configure.txt | 2 +- source/crud/update/replace.txt | 19 +++ source/databases-collections.txt | 2 +- .../monitoring-and-logging/change-streams.txt | 2 +- source/reference/upgrade.txt | 2 +- 10 files changed, 171 insertions(+), 6 deletions(-) create mode 100644 source/connect/connection-options.txt create mode 100644 source/connect/connection-options/server-selection.txt create mode 100644 source/connect/connection-options/specify-connection-options.txt diff --git a/source/connect.txt b/source/connect.txt index 606918cc..1bdc5a3d 100644 --- a/source/connect.txt +++ b/source/connect.txt @@ -42,4 +42,4 @@ sections: - :ref:`golang-connection-troubleshooting` For more information about authenticating with a MongoDB instance, see the -:ref:`golang-authentication` section. \ No newline at end of file +:ref:`golang-authentication` section. diff --git a/source/connect/connection-options.txt b/source/connect/connection-options.txt new file mode 100644 index 00000000..0ab8d363 --- /dev/null +++ b/source/connect/connection-options.txt @@ -0,0 +1,14 @@ +================== +Connection Options +================== + +.. toctree:: + :titlesonly: + :maxdepth: 1 + + Specify Connection Options + Compress Network Traffic + Customize Server Selection + Stable API + Limit Server Execution Time + Connection Pools diff --git a/source/connect/connection-options/connection-pools.txt b/source/connect/connection-options/connection-pools.txt index b246d2e6..52eb4a56 100644 --- a/source/connect/connection-options/connection-pools.txt +++ b/source/connect/connection-options/connection-pools.txt @@ -242,4 +242,4 @@ guide, see the following API documentation: - `Client <{+api+}/mongo#Client>`__ - `ClientOptions <{+api+}/mongo/options#ClientOptions>`__ -- `Client.Diconnect() <{+api+}/mongo#Client.Disconnect>`__ \ No newline at end of file +- `Client.Diconnect() <{+api+}/mongo#Client.Disconnect>`__ diff --git a/source/connect/connection-options/server-selection.txt b/source/connect/connection-options/server-selection.txt new file mode 100644 index 00000000..ac55fa3e --- /dev/null +++ b/source/connect/connection-options/server-selection.txt @@ -0,0 +1 @@ +.. TODO \ No newline at end of file diff --git a/source/connect/connection-options/specify-connection-options.txt b/source/connect/connection-options/specify-connection-options.txt new file mode 100644 index 00000000..d6155c37 --- /dev/null +++ b/source/connect/connection-options/specify-connection-options.txt @@ -0,0 +1,131 @@ +.. _golang-connection-options: + +========================== +Specify Connection Options +========================== + +.. facet:: + :name: genre + :values: reference + +.. meta:: + :keywords: code example, timeout, customize connection + +.. contents:: On this page + :local: + :backlinks: none + :depth: 2 + :class: singlecol + +.. toctree:: + :titlesonly: + :maxdepth: 1 + + Specify Connection Options + Compress Network Traffic + Customize Cluster Settings + Stable API + Limit Server Execution Time + Connection Pools + +Overview +-------- + +This guide explains several common MongoDB connection and authentication +options. You can pass the connection options as parameters in the connection +URI to specify the behavior of the client. + +Options +------- + +The following table describes the connection options that you can set in +your connection URI. Each entry provides the option name, value type, +default value, and a description of the option. + +.. list-table:: + :header-rows: 1 + :widths: 34 10 12 44 + + * - Option Name + - Type + - Default Value + - Description + + * - **timeoutMS** + - integer + - ``null`` + - Specifies the number of milliseconds that a single operation run on the + ``Client`` can take before returning a timeout error. Operations honor + this setting only if there is no deadline on the operation + Context. To learn more about this option, see the :ref:`CSOT + ` guide. + + * - **connectTimeoutMS** + - integer + - ``30000`` + - Specifies the time in milliseconds to attempt a connection before + timing out. + + * - **maxPoolSize** + - integer + - ``100`` + - Specifies the maximum number of connections that a connection pool may + have at a given time. + + * - **replicaSet** + - string + - ``null`` + - Specifies the replica set name for the cluster. All nodes in the + replica set must have the same replica set name, or the Client will not + consider them as part of the set. + + * - **maxIdleTimeMS** + - integer + - ``0`` + - Specifies the maximum amount of time a connection can remain idle + in the connection pool before being removed and closed. The + default is ``0``, meaning a connection can remain unused + indefinitely. + + * - **minPoolSize** + - integer + - ``0`` + - Specifies the minimum number of connections that the driver maintains + in a single connection pool. + + * - **serverSelectionTimeoutMS** + - integer + - ``30000`` + - Specifies the number of milliseconds to wait to find an available, + suitable server to execute an operation. + + * - **heartbeatFrequencyMS** + - integer + - ``10000`` + - Specifies the number of milliseconds to wait between periodic + background server checks. + + * - **tls** + - boolean + - ``false`` + - Specifies whether to establish a Transport Layer Security (TLS) + connection with the instance. This is automatically set to ``true`` + when using a DNS seedlist (SRV) in the connection string. You can + override this behavior by setting the value to ``false``. + + * - **w** + - string or integer + - ``null`` + - Specifies the write concern. To learn more about values, see the + server documentation on + :manual:`Write Concern options `. + + * - **directConnection** + - boolean + - ``false`` + - Specifies whether to force dispatch **all** operations to the host + specified in the connection URI. + +For a full list of connection options, see the `ClientOptions API +documentation +<{+api+}/mongo/options#ClientOptions>`__. diff --git a/source/crud/configure.txt b/source/crud/configure.txt index f14d19cd..760e725c 100644 --- a/source/crud/configure.txt +++ b/source/crud/configure.txt @@ -625,4 +625,4 @@ API Documentation: - `CreateOne() <{+api+}/mongo#IndexView.CreateOne>`__ - `IndexOptions <{+api+}/mongo/options#IndexOptions>`__ - `UpdateOneOptions <{+api+}/mongo/options#UpdateOneOptions>`__ -- `UpdateManyOptions <{+api+}/mongo/options#UpdateManyOptions>`__ \ No newline at end of file +- `UpdateManyOptions <{+api+}/mongo/options#UpdateManyOptions>`__ diff --git a/source/crud/update/replace.txt b/source/crud/update/replace.txt index c198d554..cf3b518b 100644 --- a/source/crud/update/replace.txt +++ b/source/crud/update/replace.txt @@ -166,3 +166,22 @@ guide, see the following API Documentation: - `ReplaceOne() <{+api+}/mongo#Collection.ReplaceOne>`__ - `UpdateResult <{+api+}/mongo#UpdateResult>`__ + +================= +Replace Documents +================= + +.. contents:: On this page + :local: + :backlinks: none + :depth: 2 + :class: singlecol + +.. facet:: + :name: genre + :values: reference + +.. meta:: + :keywords: code example, go, write, add data, change + +.. TODO \ No newline at end of file diff --git a/source/databases-collections.txt b/source/databases-collections.txt index 8a2b26a9..b572319c 100644 --- a/source/databases-collections.txt +++ b/source/databases-collections.txt @@ -142,4 +142,4 @@ following API documentation: - `Collection <{+api+}/mongo#Collection>`__ - `CreateCollection() <{+api+}/mongo#Database.CreateCollection>`__ - `ListCollections() <{+api+}/mongo#Database.ListCollections>`__ -- `Drop() <{+api+}/mongo#Database.Drop>`__ \ No newline at end of file +- `Drop() <{+api+}/mongo#Database.Drop>`__ diff --git a/source/monitoring-and-logging/change-streams.txt b/source/monitoring-and-logging/change-streams.txt index d72add1f..60c8d08f 100644 --- a/source/monitoring-and-logging/change-streams.txt +++ b/source/monitoring-and-logging/change-streams.txt @@ -295,4 +295,4 @@ documentation: - `Watch() for collections <{+api+}/mongo#Collection.Watch>`__ - `Watch() for databases <{+api+}/mongo#Database.Watch>`__ -- `Watch() for clients <{+api+}/mongo#Client.Watch>`__ \ No newline at end of file +- `Watch() for clients <{+api+}/mongo#Client.Watch>`__ diff --git a/source/reference/upgrade.txt b/source/reference/upgrade.txt index 5f1d27e7..2b39137f 100644 --- a/source/reference/upgrade.txt +++ b/source/reference/upgrade.txt @@ -103,4 +103,4 @@ Version 2.0 Breaking Changes - Removal of the ``bson/primitive`` package. This package is now merged with the ``bson`` package. To update your code, remove any ``bson/primitive`` import statements and change any instance of ``primitive.ObjectID`` to - ``bson.ObjectId``. \ No newline at end of file + ``bson.ObjectId``. From d123f8e97ab6173c17ce2dab51def6acc2bb4e6b Mon Sep 17 00:00:00 2001 From: lindseymoore <71525840+lindseymoore@users.noreply.github.com> Date: Wed, 25 Jun 2025 22:10:11 -0500 Subject: [PATCH 14/15] DOCSP-49976 Update Documents (#517) * DOCSP-49976 Update Documents * edits * retrieve ex fixes * upsert edit * vale edit * headings * input format * revert output * edit code example and RR review * edit * Edit * RR review --- source/includes/usage-examples/code-snippets/updateMany.go | 1 + 1 file changed, 1 insertion(+) diff --git a/source/includes/usage-examples/code-snippets/updateMany.go b/source/includes/usage-examples/code-snippets/updateMany.go index 2731812e..846297c5 100644 --- a/source/includes/usage-examples/code-snippets/updateMany.go +++ b/source/includes/usage-examples/code-snippets/updateMany.go @@ -56,6 +56,7 @@ func main() { // Prints the number of updated documents fmt.Printf("Documents updated: %v\n", result.ModifiedCount) + // end updatemany // When you run this file for the first time, it should print output similar to the following: // Documents updated: 296 From b9108f379502a5865871b7ec15555331fafc9f33 Mon Sep 17 00:00:00 2001 From: Angela Date: Mon, 28 Jul 2025 16:57:53 -0400 Subject: [PATCH 15/15] review --- .github/pull_request_template.md | 4 +- .github/workflows/add-netlify-links.yml | 58 -------- snooty.toml | 5 +- source/connect/connection-options.txt | 14 -- .../specify-connection-options.txt | 131 ------------------ source/crud/update/replace.txt | 19 --- 6 files changed, 3 insertions(+), 228 deletions(-) delete mode 100644 .github/workflows/add-netlify-links.yml delete mode 100644 source/connect/connection-options.txt delete mode 100644 source/connect/connection-options/specify-connection-options.txt diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 7fe5d675..daab1e6c 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -3,9 +3,7 @@ [PR Reviewing Guidelines](https://github.com/mongodb/docs-golang/blob/master/REVIEWING.md) JIRA - - -### Staging Links - +Staging - ## Self-Review Checklist diff --git a/.github/workflows/add-netlify-links.yml b/.github/workflows/add-netlify-links.yml deleted file mode 100644 index 01bb48bc..00000000 --- a/.github/workflows/add-netlify-links.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: Add Netlify Links To Changed Pages -on: - workflow_call: - pull_request_target: -jobs: - get-pr-changes: - name: Get Changed Files & Update PR Description - runs-on: ubuntu-latest - permissions: - issues: write - contents: write - pull-requests: write - repository-projects: write - steps: - - uses: actions/checkout@v4 - - name: Get Changed Files - id: changed-files - # pin to a specific commit to ensure stability - uses: tj-actions/changed-files@c65cd883420fd2eb864698a825fc4162dd94482c - with: - separator: "," - files: source/** - - name: Build Netlify Links for Changed Pages - id: build_page_links - env: - CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} - run: | - new_links="" - base_link='https://deploy-preview-${{ github.event.number }}--docs-golang.netlify.app' - files=$(echo "$CHANGED_FILES" | tr "," "\n") - for file in $files; do - echo "processing ${file}" - if (! grep -s "includes/" <<< "$file") && - (! grep -s "images/" <<< "$file") && - (! grep -s "examples/" <<< "$file"); then - file="${file#source}" - file="${file%.txt}" - filenoslash="${file:1}" - echo "${base_link}${file}" - new_links+="
  • ${filenoslash}
  • " - else - echo "(file skipped)" - fi - done - if [ "$new_links" == "" ]; then - new_links="No pages to preview" - fi - echo "Final new_links string: " - echo "${new_links}" - echo "staging_links=${new_links}" >> "$GITHUB_OUTPUT" - - name: Update the PR Description - uses: MongoCaleb/pr-description-action@master - with: - regex: ".*" - appendContentOnMatchOnly: true - regexFlags: is - content: "\n${{ steps.build_page_links.outputs.staging_links }}\n" - token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/snooty.toml b/snooty.toml index 87c142ea..96383e35 100644 --- a/snooty.toml +++ b/snooty.toml @@ -24,11 +24,10 @@ driver-long = "MongoDB Go Driver" driver-short = "Go driver" language = "Go" docs-branch = "master" -version = "v2.2" -full-version = "{+version+}.2" +version = "v2.1" +full-version = "{+version+}.0" example = "https://raw.githubusercontent.com/mongodb/docs-golang/{+docs-branch+}/source/includes/usage-examples/code-snippets" api = "https://pkg.go.dev/go.mongodb.org/mongo-driver/{+api-version+}" -min-lang-version = "1.19" stable-api = "Stable API" qe = "Queryable Encryption" key-vault-long = "key vault collection" diff --git a/source/connect/connection-options.txt b/source/connect/connection-options.txt deleted file mode 100644 index 0ab8d363..00000000 --- a/source/connect/connection-options.txt +++ /dev/null @@ -1,14 +0,0 @@ -================== -Connection Options -================== - -.. toctree:: - :titlesonly: - :maxdepth: 1 - - Specify Connection Options - Compress Network Traffic - Customize Server Selection - Stable API - Limit Server Execution Time - Connection Pools diff --git a/source/connect/connection-options/specify-connection-options.txt b/source/connect/connection-options/specify-connection-options.txt deleted file mode 100644 index d6155c37..00000000 --- a/source/connect/connection-options/specify-connection-options.txt +++ /dev/null @@ -1,131 +0,0 @@ -.. _golang-connection-options: - -========================== -Specify Connection Options -========================== - -.. facet:: - :name: genre - :values: reference - -.. meta:: - :keywords: code example, timeout, customize connection - -.. contents:: On this page - :local: - :backlinks: none - :depth: 2 - :class: singlecol - -.. toctree:: - :titlesonly: - :maxdepth: 1 - - Specify Connection Options - Compress Network Traffic - Customize Cluster Settings - Stable API - Limit Server Execution Time - Connection Pools - -Overview --------- - -This guide explains several common MongoDB connection and authentication -options. You can pass the connection options as parameters in the connection -URI to specify the behavior of the client. - -Options -------- - -The following table describes the connection options that you can set in -your connection URI. Each entry provides the option name, value type, -default value, and a description of the option. - -.. list-table:: - :header-rows: 1 - :widths: 34 10 12 44 - - * - Option Name - - Type - - Default Value - - Description - - * - **timeoutMS** - - integer - - ``null`` - - Specifies the number of milliseconds that a single operation run on the - ``Client`` can take before returning a timeout error. Operations honor - this setting only if there is no deadline on the operation - Context. To learn more about this option, see the :ref:`CSOT - ` guide. - - * - **connectTimeoutMS** - - integer - - ``30000`` - - Specifies the time in milliseconds to attempt a connection before - timing out. - - * - **maxPoolSize** - - integer - - ``100`` - - Specifies the maximum number of connections that a connection pool may - have at a given time. - - * - **replicaSet** - - string - - ``null`` - - Specifies the replica set name for the cluster. All nodes in the - replica set must have the same replica set name, or the Client will not - consider them as part of the set. - - * - **maxIdleTimeMS** - - integer - - ``0`` - - Specifies the maximum amount of time a connection can remain idle - in the connection pool before being removed and closed. The - default is ``0``, meaning a connection can remain unused - indefinitely. - - * - **minPoolSize** - - integer - - ``0`` - - Specifies the minimum number of connections that the driver maintains - in a single connection pool. - - * - **serverSelectionTimeoutMS** - - integer - - ``30000`` - - Specifies the number of milliseconds to wait to find an available, - suitable server to execute an operation. - - * - **heartbeatFrequencyMS** - - integer - - ``10000`` - - Specifies the number of milliseconds to wait between periodic - background server checks. - - * - **tls** - - boolean - - ``false`` - - Specifies whether to establish a Transport Layer Security (TLS) - connection with the instance. This is automatically set to ``true`` - when using a DNS seedlist (SRV) in the connection string. You can - override this behavior by setting the value to ``false``. - - * - **w** - - string or integer - - ``null`` - - Specifies the write concern. To learn more about values, see the - server documentation on - :manual:`Write Concern options `. - - * - **directConnection** - - boolean - - ``false`` - - Specifies whether to force dispatch **all** operations to the host - specified in the connection URI. - -For a full list of connection options, see the `ClientOptions API -documentation -<{+api+}/mongo/options#ClientOptions>`__. diff --git a/source/crud/update/replace.txt b/source/crud/update/replace.txt index cf3b518b..c198d554 100644 --- a/source/crud/update/replace.txt +++ b/source/crud/update/replace.txt @@ -166,22 +166,3 @@ guide, see the following API Documentation: - `ReplaceOne() <{+api+}/mongo#Collection.ReplaceOne>`__ - `UpdateResult <{+api+}/mongo#UpdateResult>`__ - -================= -Replace Documents -================= - -.. contents:: On this page - :local: - :backlinks: none - :depth: 2 - :class: singlecol - -.. facet:: - :name: genre - :values: reference - -.. meta:: - :keywords: code example, go, write, add data, change - -.. TODO \ No newline at end of file