Skip to content

Comments

Fix $geoNear stage with empty query#2743

Merged
GromNaN merged 1 commit intodoctrine:2.11.xfrom
GromNaN:geonear-empty-query
Mar 6, 2025
Merged

Fix $geoNear stage with empty query#2743
GromNaN merged 1 commit intodoctrine:2.11.xfrom
GromNaN:geonear-empty-query

Conversation

@GromNaN
Copy link
Member

@GromNaN GromNaN commented Mar 5, 2025

Q A
Type bug
BC Break no
Fixed issues #2739 (comment)

Summary

The $geoNear stage property query requires a document. When nothing is set, an empty array is currently sent; which is invalid.

@GromNaN GromNaN requested a review from jmikola March 5, 2025 09:39
@GromNaN GromNaN added the Bug label Mar 5, 2025
@GromNaN GromNaN added this to the 2.11.0 milestone Mar 5, 2025
@GromNaN GromNaN force-pushed the geonear-empty-query branch 2 times, most recently from 90af756 to 66996ef Compare March 5, 2025 10:02
@GromNaN GromNaN force-pushed the geonear-empty-query branch from 66996ef to 24e0f5b Compare March 5, 2025 10:03
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.

Decide if the test case should be renamed. Everything else LGTM.

use Doctrine\ODM\MongoDB\Tests\BaseTestCase;
use Documents\Place;

class GeoTest extends BaseTestCase
Copy link
Member

Choose a reason for hiding this comment

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

Should this be titled GeoNearTest, or would you intend for other geospatial operators to get added to this down the line?

Copy link
Member Author

Choose a reason for hiding this comment

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

My idea is that we can add other tests for other operators using the fixtures already defined.

@GromNaN GromNaN merged commit b545c21 into doctrine:2.11.x Mar 6, 2025
19 checks passed
@GromNaN GromNaN deleted the geonear-empty-query branch March 6, 2025 17:00
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.

2 participants