Skip to content
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

PHPLIB-1609 Don't mandate the use of "distanceField" in $geoNear #1569

Merged
merged 1 commit into from
Jan 24, 2025

Conversation

GromNaN
Copy link
Member

@GromNaN GromNaN commented Jan 23, 2025

Fix PHPLIB-1609 see DRIVERS-3071

The $geoNear distanceField argument is now optional for queries on non-timeseries collections.

The $geoNear distanceField argument is now optional for queries on non-timeseries collections.
@GromNaN GromNaN requested a review from a team as a code owner January 23, 2025 13:10
@GromNaN GromNaN requested a review from jmikola January 23, 2025 13:10
@@ -265,8 +265,8 @@ public static function fill(
* Default: false.
*/
public static function geoNear(
string $distanceField,
Copy link
Member Author

Choose a reason for hiding this comment

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

The parameter was put first because required parameters must be before the optional ones. Changing the order of the parameters would be a breaking change one the library is released.

Copy link
Member

Choose a reason for hiding this comment

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

I worry that the server being able to make such changes at will (where we might require a BC break to maintain consistency) is going to inevitably become a problem down the line.

Had you not caught this before a release, how could PHPLIB-1609 have been implemented?

Copy link
Member

@jmikola jmikola left a comment

Choose a reason for hiding this comment

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

Change looks fine but I'm concerned about how we might get screwed over by a similar change down the line.

@@ -265,8 +265,8 @@ public static function fill(
* Default: false.
*/
public static function geoNear(
string $distanceField,
Copy link
Member

Choose a reason for hiding this comment

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

I worry that the server being able to make such changes at will (where we might require a BC break to maintain consistency) is going to inevitably become a problem down the line.

Had you not caught this before a release, how could PHPLIB-1609 have been implemented?

@GromNaN GromNaN merged commit 8b84786 into mongodb:v1.x Jan 24, 2025
31 checks passed
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.

2 participants