Skip to content

DOCSP-49972 Choose a Connection Target (Go) #512

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

Closed
Closed
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
4 changes: 3 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
[PR Reviewing Guidelines](https://github.com/mongodb/docs-golang/blob/master/REVIEWING.md)

JIRA - <https://jira.mongodb.org/browse/DOCSP-NNNNN>
Staging - <https://docs-mongodbcom-staging.corp.mongodb.com/drivers/docsworker-xlarge/NNNNN/>

### Staging Links
<!-- start insert-links --><!-- end insert-links -->

## Self-Review Checklist

Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/add-netlify-links.yml
Original file line number Diff line number Diff line change
@@ -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+="<li><a href=${base_link}${file}>${filenoslash}</a></li>"
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: "<!-- start insert-links -->.*<!-- end insert-links -->"
appendContentOnMatchOnly: true
regexFlags: is
content: "<!-- start insert-links -->\n${{ steps.build_page_links.outputs.staging_links }}\n<!-- end insert-links -->"
token: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions snooty.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ api-version = "v2"
driver-long = "MongoDB Go Driver"
driver-short = "Go driver"
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"
Expand Down
79 changes: 12 additions & 67 deletions source/archive-reference-files/fundamentals/auth.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ The Go driver supports the following authentication mechanisms:

* :ref:`SCRAM-SHA-256 <golang_sha_256>`
* :ref:`SCRAM-SHA-1 <golang-sha-1>`
* :ref:`MONGODB-CR <golang-mongodb-cr>`
* :ref:`MongoDB-AWS <golang-mongodb-aws>`
* :ref:`X.509 <golang-x509>`

Expand Down Expand Up @@ -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

Expand All @@ -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 </core/security-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
Expand All @@ -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 </core/security-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.
Expand All @@ -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.
Expand Down
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
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>`__
2 changes: 0 additions & 2 deletions source/archive-reference-files/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/archive-reference-files/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
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/archive-reference-files/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/archive-reference-files/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/archive-reference-files/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/archive-reference-files/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
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
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
6 changes: 3 additions & 3 deletions source/connect/connection-options/network-compression.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ your application.

The {+driver-short+} supports the following compression algorithms:

1. `Snappy <https://google.github.io/snappy/>`__: available in MongoDB 3.4 and later.
1. `Snappy <https://google.github.io/snappy/>`__

2. `Zlib <https://zlib.net/>`__: available in MongoDB 3.6 and later.
#. `Zlib <https://zlib.net/>`__

3. `Zstandard <https://github.com/facebook/zstd/>`__: available in MongoDB 4.2 and later.
#. `Zstandard <https://github.com/facebook/zstd/>`__

If you specify multiple compression algorithms, the driver selects the
first one in the list supported by your MongoDB deployment.
Expand Down
4 changes: 1 addition & 3 deletions source/connect/connection-options/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>`__
Loading
Loading