Skip to content

Commit e6e57ef

Browse files
committed
Update spatial queries
1 parent 59e5700 commit e6e57ef

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/main/kotlin/io/appwrite/Query.kt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class Query(
8686
* @param meters Whether the distance is in meters.
8787
* @returns The query string.
8888
*/
89-
fun distanceEqual(attribute: String, values: List<Any>, distance: Number, meters: Boolean = true) = Query("distanceEqual", attribute, listOf(values, distance, meters)).toJson()
89+
fun distanceEqual(attribute: String, values: List<Any>, distance: Number, meters: Boolean = true) = Query("distanceEqual", attribute, listOf(listOf(values, distance, meters))).toJson()
9090

9191
/**
9292
* Filter resources where attribute is not at a specific distance from the given coordinates.
@@ -97,7 +97,7 @@ class Query(
9797
* @param meters Whether the distance is in meters.
9898
* @returns The query string.
9999
*/
100-
fun distanceNotEqual(attribute: String, values: List<Any>, distance: Number, meters: Boolean = true) = Query("distanceNotEqual", attribute, listOf(values, distance, meters)).toJson()
100+
fun distanceNotEqual(attribute: String, values: List<Any>, distance: Number, meters: Boolean = true) = Query("distanceNotEqual", attribute, listOf(listOf(values, distance, meters))).toJson()
101101

102102
/**
103103
* Filter resources where attribute is at a distance greater than the specified value from the given coordinates.
@@ -108,7 +108,7 @@ class Query(
108108
* @param meters Whether the distance is in meters.
109109
* @returns The query string.
110110
*/
111-
fun distanceGreaterThan(attribute: String, values: List<Any>, distance: Number, meters: Boolean = true) = Query("distanceGreaterThan", attribute, listOf(values, distance, meters)).toJson()
111+
fun distanceGreaterThan(attribute: String, values: List<Any>, distance: Number, meters: Boolean = true) = Query("distanceGreaterThan", attribute, listOf(listOf(values, distance, meters))).toJson()
112112

113113
/**
114114
* Filter resources where attribute is at a distance less than the specified value from the given coordinates.
@@ -119,23 +119,23 @@ class Query(
119119
* @param meters Whether the distance is in meters.
120120
* @returns The query string.
121121
*/
122-
fun distanceLessThan(attribute: String, values: List<Any>, distance: Number, meters: Boolean = true) = Query("distanceLessThan", attribute, listOf(values, distance, meters)).toJson()
122+
fun distanceLessThan(attribute: String, values: List<Any>, distance: Number, meters: Boolean = true) = Query("distanceLessThan", attribute, listOf(listOf(values, distance, meters))).toJson()
123123

124-
fun intersects(attribute: String, values: List<Any>) = Query("intersects", attribute, values).toJson()
124+
fun intersects(attribute: String, values: List<Any>) = Query("intersects", attribute, listOf(values)).toJson()
125125

126-
fun notIntersects(attribute: String, values: List<Any>) = Query("notIntersects", attribute, values).toJson()
126+
fun notIntersects(attribute: String, values: List<Any>) = Query("notIntersects", attribute, listOf(values)).toJson()
127127

128-
fun crosses(attribute: String, values: List<Any>) = Query("crosses", attribute, values).toJson()
128+
fun crosses(attribute: String, values: List<Any>) = Query("crosses", attribute, listOf(values)).toJson()
129129

130-
fun notCrosses(attribute: String, values: List<Any>) = Query("notCrosses", attribute, values).toJson()
130+
fun notCrosses(attribute: String, values: List<Any>) = Query("notCrosses", attribute, listOf(values)).toJson()
131131

132-
fun overlaps(attribute: String, values: List<Any>) = Query("overlaps", attribute, values).toJson()
132+
fun overlaps(attribute: String, values: List<Any>) = Query("overlaps", attribute, listOf(values)).toJson()
133133

134-
fun notOverlaps(attribute: String, values: List<Any>) = Query("notOverlaps", attribute, values).toJson()
134+
fun notOverlaps(attribute: String, values: List<Any>) = Query("notOverlaps", attribute, listOf(values)).toJson()
135135

136-
fun touches(attribute: String, values: List<Any>) = Query("touches", attribute, values).toJson()
136+
fun touches(attribute: String, values: List<Any>) = Query("touches", attribute, listOf(values)).toJson()
137137

138-
fun notTouches(attribute: String, values: List<Any>) = Query("notTouches", attribute, values).toJson()
138+
fun notTouches(attribute: String, values: List<Any>) = Query("notTouches", attribute, listOf(values)).toJson()
139139

140140
private fun parseValue(value: Any): List<Any> {
141141
return when (value) {

0 commit comments

Comments
 (0)