最新的稳定版本请使用 Spring Data Neo4j 7.3.1

最新的稳定版本请使用 Spring Data Neo4j 7.3.1

Spring Data Neo4j 支持以下空间类型

支持的转换

  • Spring Data common's(必须是数据库中的 WGS 84-2D/SRID 4326 点)Point

  • GeographicPoint2d(WGS84 2D/SRID 4326)

  • GeographicPoint3d(WGS84 3D/SRID 4979)

  • CartesianPoint2d(笛卡尔 2D/SRID 7203)

  • CartesianPoint3d(笛卡尔 3D/SRID 9157)

派生的查找器关键字

如果您使用的是原生 Neo4j Java 驱动程序类型, 您可以在派生的 Finder 方法中使用以下关键字和参数类型。org.neo4j.driver.types.Point

区域内查询:

  • findBy[…​]Within(org.springframework.data.geo.Circle circle)

  • findBy[…​]Within(org.springframework.data.geo.Box box)

  • findBy[…​]Within(org.springframework.data.neo4j.repository.query.BoundingBox boundingBox)

您也可以使用 a,但需要通过调用 将其传递给 。org.springframework.data.geo.PolygonBoundingBoxBoundingBox#of

在某个点附近查询:

  • findBy[…​]Near(org.neo4j.driver.types.Point point)- 返回按到给定点的距离排序的结果

  • findBy[…​]Near(Point point, org.springframework.data.geo.Distance max)

  • findBy[…​]Near(Point point, org.springframework.data.domain.Range<Distance> between)

  • findBy[…​]Near(Range<Distance> between, Point p)

您也可以使用 a,但需要通过调用 将其传递给 。org.springframework.data.geo.PolygonBoundingBoxBoundingBox#of