Skip to content

Commit 55cd133

Browse files
improve sptial type filtering section
1 parent f1bf35a commit 55cd133

File tree

1 file changed

+26
-10
lines changed

1 file changed

+26
-10
lines changed

modules/ROOT/pages/filtering.adoc

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Here is an example of how to use them:
9696
[source, graphql, indent=0]
9797
----
9898
query {
99-
users(where: {age: { lt: 50 } }) {
99+
users(where: { age: { lt: 50 } }) {
100100
id
101101
name
102102
age
@@ -107,14 +107,32 @@ query {
107107
Spatial types use numerical filtering differently and they also have additional options.
108108
See xref:filtering.adoc#_spatial_type_filtering[] for more information.
109109

110-
==== Spatial type filtering
110+
=== Spatial type filtering
111111

112-
Spatial filtering for Point and CartesianPoint types now uses an enhanced filter format.
113-
The filter accepts a "distance" object with the following keys:
114-
- lt / lte / gt / gte: compares the spatial distance against the provided numeric value.
115-
- from: specifies the reference coordinates (such as longitude, latitude, and optionally height).
112+
Spatial filters are available for both Point and Cartesian fields.
113+
They allow you to filter spatial data either by exact equality or based on a distance criterion.
116114

117-
For example, to find all users within a 5km (5000m) radius of a certain point, you can use:
115+
For exact matching, use the eq operator:
116+
[source, graphql, indent=0]
117+
----
118+
query {
119+
users(
120+
where: {
121+
location: {
122+
eq: { longitude: 9, latitude: 10, height: 11 }
123+
}
124+
}
125+
) {
126+
name
127+
location {
128+
longitude
129+
latitude
130+
}
131+
}
132+
}
133+
----
134+
135+
For distance-based filtering, combine xref:#_numerical_operators[numerical operators] operators with the distance operator:
118136
[source, graphql, indent=0]
119137
----
120138
query CloseByUsers {
@@ -134,9 +152,7 @@ query CloseByUsers {
134152
}
135153
----
136154

137-
138-
The same query for a `CartesianPoint`:
139-
155+
For Cartesian points, use:
140156
[source, graphql, indent=0]
141157
----
142158
query CloseByUsers {

0 commit comments

Comments
 (0)