Skip to content

DOCSP-49868 - MongoUrl #629

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

Open
wants to merge 32 commits into
base: docsp-45382-comp-cvg
Choose a base branch
from

Conversation

mongoKart
Copy link
Collaborator

@mongoKart mongoKart commented May 9, 2025

There are lots of small grammar changes in this PR. These are the only files that need tech review:

  • source/connect/connection-options.txt
  • source/connect/mongoclient.txt
  • source/includes/fundamentals/code-examples/connection/ConnectionOptions.cs
  • includes/fundamentals/connection-options/*.rst

Pull Request Info

PR Reviewing Guidelines

JIRA - https://jira.mongodb.org/browse/DOCSP-49868

Staging Links

  • connect/connection-options
  • connect/connection-options/stable-api
  • connect/mongoclient
  • Self-Review Checklist

    • Is this free of any warnings or errors in the RST?
    • Did you run a spell-check?
    • Did you run a grammar-check?
    • Are all the links working?
    • Are the facets and meta keywords accurate?
    • Are the page titles greater than 20 characters long and SEO relevant?

    Copy link

    netlify bot commented May 9, 2025

    Deploy Preview for docs-csharp ready!

    Name Link
    🔨 Latest commit ed1a52d
    🔍 Latest deploy log https://app.netlify.com/projects/docs-csharp/deploys/6842f7b22db5eb0008773fb6
    😎 Deploy Preview https://deploy-preview-629--docs-csharp.netlify.app
    📱 Preview on mobile
    Toggle QR Code...

    QR Code

    Use your smartphone camera to open QR code link.

    To edit notification comments on pull requests, go to your Netlify project configuration.

    @mongoKart mongoKart marked this pull request as ready for review May 29, 2025 15:25
    @rustagir rustagir self-requested a review May 29, 2025 17:31
    Copy link
    Collaborator

    @rustagir rustagir left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    mostly minor changes but i think itll be good to get a second review in!


    To learn more about the options that you can specify in a connection URI, see
    :manual:`Connection String Options </reference/connection-string-options>` in the
    +mdb-server+} manual.
    Copy link
    Collaborator

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Suggested change
    +mdb-server+} manual.
    {+mdb-server+} manual.

    Comment on lines 69 to 70
    To use a ``MongoClientSettings`` object, create an instance of the class, set
    its properties, and pass it as an argument to the ``MongoClient`` constructor:
    Copy link
    Collaborator

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    S: not in your PR but suggest updating this for clarity

    Suggested change
    To use a ``MongoClientSettings`` object, create an instance of the class, set
    its properties, and pass it as an argument to the ``MongoClient`` constructor:
    To set options in a ``MongoClientSettings`` object, perform the following actions:
    1. Create an instance of the ``MongoClientSettings``,
    2. Set connection properties
    3. Pass it as an argument to the ``MongoClient`` constructor
    The following code demonstrates how to..

    Comment on lines 80 to 81
    as shown in the following example. This is useful if you already have a connection string
    but want to modify some of the settings programmatically, or if you need to specify settings
    Copy link
    Collaborator

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Suggested change
    as shown in the following example. This is useful if you already have a connection string
    but want to modify some of the settings programmatically, or if you need to specify settings
    as shown in the following example. This is useful if you already have a connection string
    but want to modify some settings programmatically, or if you want to specify settings

    Comment on lines 92 to 93
    object, as shown in the following example. This is useful if you already have a ``MongoUrl``
    object but need to specify settings that aren't available in the ``MongoUrl`` class.
    Copy link
    Collaborator

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Suggested change
    object, as shown in the following example. This is useful if you already have a ``MongoUrl``
    object but need to specify settings that aren't available in the ``MongoUrl`` class.
    object, as shown in the following example. This is useful if you already have a ``MongoUrl``
    object but want to specify settings that aren't available in the ``MongoUrl`` class.

    Comment on lines 87 to 88
    :start-after: // start-mongo-client-settings
    :end-before: // end-mongo-client-settings
    Copy link
    Collaborator

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    S: Update to use the right code include

    Copy link
    Collaborator Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    doh

    Comment on lines 116 to 120
    .. literalinclude:: /includes/fundamentals/code-examples/connection/MongoClientSettingsConfig.cs
    :language: csharp
    :dedent:
    :start-after: // start mongo client settings config
    :end-before: // end mongo client settings config
    Copy link
    Collaborator

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    I: example not rendering

    @mongoKart mongoKart requested a review from rustagir May 30, 2025 16:28
    Copy link
    Collaborator

    @rustagir rustagir left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    can take another look if needed - mostly pointed out small stuff. Great work!

    This section describes the MongoDB connection and authentication options
    available in the {+driver-short+}. You can configure your connection using either
    the connection URI or a ``MongoClientSettings`` object.
    --------
    Copy link
    Collaborator

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    S: I think it works but I dont think we need to add the title formatting above and below, just below
    ie

    Overview
    --------
    

    Copy link
    Collaborator Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    yeah it makes the formatting confusing for the rest of the page. changed

    Comment on lines 37 to 39
    ---------------------------------
    How to Specify Connection Options
    ---------------------------------
    Copy link
    Collaborator

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    S: same as above, remove above title overline

    Comment on lines 126 to 130
    .. literalinclude:: /includes/fundamentals/code-examples/connection/MongoClientSettingsConfig.cs
    :language: csharp
    :dedent: 8
    :start-after: // start-mongo-url-builder
    :end-before: // end-mongo-url-builder
    Copy link
    Collaborator

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    S: code example not rendering

    :start-after: // start-mongo-url-builder
    :end-before: // end-mongo-url-builder

    ------------------
    Copy link
    Collaborator

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    S: dont need overline

    Comment on lines 916 to 917
    :start-after: // start-settings-read-encoding
    :end-before: // end-settings-read-encodin
    Copy link
    Collaborator

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Suggested change
    :start-after: // start-settings-read-encoding
    :end-before: // end-settings-read-encodin
    :start-after: // start-settings-read-encoding
    :end-before: // end-settings-read-encoding

    Comment on lines 1079 to 1080
    Indicates whether the settings have been frozen. Frozen settings can't be changed.
    This option is read-only. The default value is ``false``.
    Copy link
    Collaborator

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Suggested change
    Indicates whether the settings have been frozen. Frozen settings can't be changed.
    This option is read-only. The default value is ``false``.
    Indicates whether the settings have been frozen. You cannot change frozen settings.
    This option is read-only. The default value is ``false``.

    Comment on lines 1095 to 1096
    Alternatively, you can call the `FrozenCopy() <{+new-api-root+}/MongoDB.Driver/MongoDB.Driver.MongoClientSettings.FrozenCopy.html>`__
    method to create a new ``MongoClientSettings`` object with the current settings frozen.
    Copy link
    Collaborator

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    S: newline the link for readability

    Suggested change
    Alternatively, you can call the `FrozenCopy() <{+new-api-root+}/MongoDB.Driver/MongoDB.Driver.MongoClientSettings.FrozenCopy.html>`__
    method to create a new ``MongoClientSettings`` object with the current settings frozen.
    Alternatively, you can call the `FrozenCopy()
    <{+new-api-root+}/MongoDB.Driver/MongoDB.Driver.MongoClientSettings.FrozenCopy.html>`__
    method to create a new ``MongoClientSettings`` object with the current settings frozen.

    Comment on lines 1343 to 1345
    ======================
    Additional Information
    ======================
    Copy link
    Collaborator

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    S: convert to regular h2 underline

    Additional Information
    ----------------------
    

    Copy link
    Collaborator Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    i have no idea how the headings on this page got so out of whack 🙃

    Comment on lines 1 to 2
    Specifies whether the driver is connecting to a load balancer. You can set this
    property to ``true`` only if:
    Copy link
    Collaborator

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Suggested change
    Specifies whether the driver is connecting to a load balancer. You can set this
    property to ``true`` only if:
    Specifies whether the driver is connecting to a load balancer. You can set this
    property to ``true`` only in the following situations:

    Copy link
    Collaborator Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    it's just one situation (when all the criteria are met), but I did reword it

    Copy link
    Collaborator

    @rustagir rustagir left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    overall looks really good, i would suggest resolving the vale errors that you can, but its not blocking

    :language: csharp
    :dedent: 8
    :start-after: // start-mongo-url-builder
    :end-before: // end-mongo-url-builder

    Connection Options
    ------------------

    Copy link
    Collaborator

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    S: Consider adding a short intro to the sections here i.e. "The following sections describe how to set connection options in the xxx and yyy"

    Copy link
    Collaborator Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    whoops, lost that while testing heading levels

    public void ConnectionUriExample()
    {
    // start-connection-uri
    const string connectionUri = "mongodb+srv:/localhost:27017/?connectTimeoutMS=60000&tls=true";
    Copy link
    Collaborator

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    S: consider shortening the variable name so the options are more visible from under the cut

    Suggested change
    const string connectionUri = "mongodb+srv:/localhost:27017/?connectTimeoutMS=60000&tls=true";
    const string uri = "mongodb+srv:/localhost:27017/?connectTimeoutMS=60000&tls=true";

    @mongoKart mongoKart requested review from a team and sanych-sun and removed request for a team June 6, 2025 14:18
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    3 participants