Skip to content

Conversation

omniCoder77
Copy link

Closes #530.

Summary

This PR adds an example demonstrating the $geoIntersects query with Spring Data MongoDB. The new code is placed in the customer package to centralize geospatial examples.

Implementation

  • Store Entity: A new entity with a GeoJsonPolygon field annotated with @GeoSpatialIndexed(type = GeoSpatialIndexType.GEO_2DSPHERE).
  • Integration Test: A new test in CustomerRepositoryIntegrationTest uses MongoOperations and Criteria.where("serviceArea").intersects(point) to show how to execute the query programmatically.
  • Test Scenarios: The test covers finding a Store where a point is both inside and outside the service area to ensure correctness.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add example for $geoIntersects with Criteria
2 participants