Skip to content

DOCSP-35941 connection options #2892

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 14 commits into from
Apr 22, 2024

Conversation

ccho-mongodb
Copy link
Contributor

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

Note:
I used the list of connection options that we feature on other driver pages such as this Rust one, edited for grammar and clarity. I will test all the options featured on the page to see if they're picked up in laravel-mongodb/src/Connection.php, but might not be able to verify whether the PHP Library completely supports them.

Staging:

Checklist

  • Add tests and ensure they pass
  • Add an entry to the CHANGELOG.md file
  • Update documentation for new features

- Boolean
- ``false``
- Specifies whether to directly connect to a single host instead of
discovering and connecting to all servers in the cluster.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: I'll add a link to the Connection Guide section in the cleanup task on "Direct Connection" since that section is currently awaiting approval.

Copy link
Contributor

@norareidy norareidy left a comment

Choose a reason for hiding this comment

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

LGTM with some non-blocking suggestions!

Comment on lines 20 to 22
Learn how to set up a connection and specify connection behavior from your
Laravel application to a MongoDB deployment by using {+odm-short+} in the
following sections:
Copy link
Contributor

Choose a reason for hiding this comment

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

S: I think this could be a little more concise

Suggested change
Learn how to set up a connection and specify connection behavior from your
Laravel application to a MongoDB deployment by using {+odm-short+} in the
following sections:
Learn how to use {+odm-short+} to set up a connection to a MongoDB deployment and specify connection behavior in the
following sections:

-------------------------------------

Learn how to add common connection and authentication options to your
configuration file in the following sections.
Copy link
Contributor

Choose a reason for hiding this comment

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

S: you could add a list of the subsections here

- Append the setting and value as a query string parameter on the connection
string specified in the ``dsn`` array item.

To specify an option in the ``options`` array, add its name and value value as
Copy link
Contributor

Choose a reason for hiding this comment

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

I: remove the repeated word (value)

Suggested change
To specify an option in the ``options`` array, add its name and value value as
To specify an option in the ``options`` array, add its name and value as

- Non-negative integer
- 0
- | Specifies the time in milliseconds that a connection can remain idle
in a connection pool the server closes it.
Copy link
Contributor

Choose a reason for hiding this comment

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

I: I think there's a missing conjunction here

Suggested change
in a connection pool the server closes it.
in a connection pool before the server closes it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, thanks!

* - **minPoolSize**
- Non-negative integer
- ``0``
- | Specifies the minimum number of connections available in a server'
Copy link
Contributor

Choose a reason for hiding this comment

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

I: add an "s"

Suggested change
- | Specifies the minimum number of connections available in a server'
- | Specifies the minimum number of connections available in a server's

discovering and connecting to all servers in the cluster.

* - **heartbeatFrequencyMS**
- Integer greater than or equal to 500
Copy link
Contributor

Choose a reason for hiding this comment

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

S: since you use monospace for most of the integer values in the table, I think this should be monospaced too

Suggested change
- Integer greater than or equal to 500
- Integer greater than or equal to ``500``

Copy link
Contributor

Choose a reason for hiding this comment

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

Applies elsewhere in the table (the localThresholdMS, maxIdleTimeMS, and zlibCompressionLevel rows)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, thanks!

// ...
]

See the `$driverOptions: array section <https://www.mongodb.com/docs/php-library/current/reference/method/MongoDBClient__construct/#parameters>`__
Copy link
Contributor

Choose a reason for hiding this comment

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

S: I'd take "section" out of the hyperlinked text

Suggested change
See the `$driverOptions: array section <https://www.mongodb.com/docs/php-library/current/reference/method/MongoDBClient__construct/#parameters>`__
See the `$driverOptions: array <https://www.mongodb.com/docs/php-library/current/reference/method/MongoDBClient__construct/#parameters>`__ section

@ccho-mongodb ccho-mongodb marked this pull request as ready for review April 22, 2024 16:58
@ccho-mongodb ccho-mongodb requested a review from a team as a code owner April 22, 2024 16:58
@ccho-mongodb ccho-mongodb merged commit eea4950 into mongodb:4.1 Apr 22, 2024
@ccho-mongodb ccho-mongodb deleted the DOCSP-35941-connection-options branch April 22, 2024 17:44
This was referenced Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants