@@ -96,7 +96,7 @@ Here is an example of how to use them:
96
96
[source, graphql, indent=0]
97
97
----
98
98
query {
99
- users(where: {age: { lt: 50 } }) {
99
+ users(where: { age: { lt: 50 } }) {
100
100
id
101
101
name
102
102
age
@@ -107,14 +107,32 @@ query {
107
107
Spatial types use numerical filtering differently and they also have additional options.
108
108
See xref:filtering.adoc#_spatial_type_filtering[] for more information.
109
109
110
- ==== Spatial type filtering
110
+ === Spatial type filtering
111
111
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.
116
114
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:
118
136
[source, graphql, indent=0]
119
137
----
120
138
query CloseByUsers {
@@ -134,9 +152,7 @@ query CloseByUsers {
134
152
}
135
153
----
136
154
137
-
138
- The same query for a `CartesianPoint`:
139
-
155
+ For Cartesian points, use:
140
156
[source, graphql, indent=0]
141
157
----
142
158
query CloseByUsers {
0 commit comments