AshNeo4j.Functions.StDistance (AshNeo4j v0.7.0)

Copy Markdown View Source

Geodesic distance between two points, in meters. Mirrors ash_geo / PostGIS ST_Distance. v1 supports point-point only.

Place
|> Ash.Query.filter(st_distance(location, ^customer_point) < 5_000)
|> Ash.read!()

When used inside a comparison filter (<, <=, >, >=, ==), the whole comparison pushes down to Neo4j's native point.distance(p1, p2) <op> threshold — geodesic haversine in WGS-84, no Elixir-side math.

Other contexts (order_by, calculate, comparisons against non-numeric RHS) fall back to in-memory evaluate/1 using the same haversine formula. Pushdown in those contexts is future work.

Summary

Functions

args()

Callback implementation for Ash.Query.Function.args/0.

has_partial_evaluate?()