Skip to content

Commit 9a8a71a

Browse files
committed
Update spatial queries
1 parent 937db03 commit 9a8a71a

File tree

1 file changed

+12
-12
lines changed
  • library/src/main/java/io/appwrite

1 file changed

+12
-12
lines changed

library/src/main/java/io/appwrite/Query.kt

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

318318
/**
319319
* Filter resources where attribute is not at a specific distance from the given coordinates.
@@ -324,7 +324,7 @@ class Query(
324324
* @param meters Whether the distance is in meters.
325325
* @returns The query string.
326326
*/
327-
fun distanceNotEqual(attribute: String, values: List<Any>, distance: Number, meters: Boolean = true) = Query("distanceNotEqual", attribute, listOf(values, distance, meters)).toJson()
327+
fun distanceNotEqual(attribute: String, values: List<Any>, distance: Number, meters: Boolean = true) = Query("distanceNotEqual", attribute, listOf(listOf(values, distance, meters))).toJson()
328328

329329
/**
330330
* Filter resources where attribute is at a distance greater than the specified value from the given coordinates.
@@ -335,7 +335,7 @@ class Query(
335335
* @param meters Whether the distance is in meters.
336336
* @returns The query string.
337337
*/
338-
fun distanceGreaterThan(attribute: String, values: List<Any>, distance: Number, meters: Boolean = true) = Query("distanceGreaterThan", attribute, listOf(values, distance, meters)).toJson()
338+
fun distanceGreaterThan(attribute: String, values: List<Any>, distance: Number, meters: Boolean = true) = Query("distanceGreaterThan", attribute, listOf(listOf(values, distance, meters))).toJson()
339339

340340
/**
341341
* Filter resources where attribute is at a distance less than the specified value from the given coordinates.
@@ -346,7 +346,7 @@ class Query(
346346
* @param meters Whether the distance is in meters.
347347
* @returns The query string.
348348
*/
349-
fun distanceLessThan(attribute: String, values: List<Any>, distance: Number, meters: Boolean = true) = Query("distanceLessThan", attribute, listOf(values, distance, meters)).toJson()
349+
fun distanceLessThan(attribute: String, values: List<Any>, distance: Number, meters: Boolean = true) = Query("distanceLessThan", attribute, listOf(listOf(values, distance, meters))).toJson()
350350

351351
/**
352352
* Filter resources where attribute intersects with the given geometry.
@@ -355,7 +355,7 @@ class Query(
355355
* @param values The coordinate values.
356356
* @returns The query string.
357357
*/
358-
fun intersects(attribute: String, values: List<Any>) = Query("intersects", attribute, values).toJson()
358+
fun intersects(attribute: String, values: List<Any>) = Query("intersects", attribute, listOf(values)).toJson()
359359

360360
/**
361361
* Filter resources where attribute does not intersect with the given geometry.
@@ -364,7 +364,7 @@ class Query(
364364
* @param values The coordinate values.
365365
* @returns The query string.
366366
*/
367-
fun notIntersects(attribute: String, values: List<Any>) = Query("notIntersects", attribute, values).toJson()
367+
fun notIntersects(attribute: String, values: List<Any>) = Query("notIntersects", attribute, listOf(values)).toJson()
368368

369369
/**
370370
* Filter resources where attribute crosses the given geometry.
@@ -373,7 +373,7 @@ class Query(
373373
* @param values The coordinate values.
374374
* @returns The query string.
375375
*/
376-
fun crosses(attribute: String, values: List<Any>) = Query("crosses", attribute, values).toJson()
376+
fun crosses(attribute: String, values: List<Any>) = Query("crosses", attribute, listOf(values)).toJson()
377377

378378
/**
379379
* Filter resources where attribute does not cross the given geometry.
@@ -382,7 +382,7 @@ class Query(
382382
* @param values The coordinate values.
383383
* @returns The query string.
384384
*/
385-
fun notCrosses(attribute: String, values: List<Any>) = Query("notCrosses", attribute, values).toJson()
385+
fun notCrosses(attribute: String, values: List<Any>) = Query("notCrosses", attribute, listOf(values)).toJson()
386386

387387
/**
388388
* Filter resources where attribute overlaps with the given geometry.
@@ -391,7 +391,7 @@ class Query(
391391
* @param values The coordinate values.
392392
* @returns The query string.
393393
*/
394-
fun overlaps(attribute: String, values: List<Any>) = Query("overlaps", attribute, values).toJson()
394+
fun overlaps(attribute: String, values: List<Any>) = Query("overlaps", attribute, listOf(values)).toJson()
395395

396396
/**
397397
* Filter resources where attribute does not overlap with the given geometry.
@@ -400,7 +400,7 @@ class Query(
400400
* @param values The coordinate values.
401401
* @returns The query string.
402402
*/
403-
fun notOverlaps(attribute: String, values: List<Any>) = Query("notOverlaps", attribute, values).toJson()
403+
fun notOverlaps(attribute: String, values: List<Any>) = Query("notOverlaps", attribute, listOf(values)).toJson()
404404

405405
/**
406406
* Filter resources where attribute touches the given geometry.
@@ -409,7 +409,7 @@ class Query(
409409
* @param values The coordinate values.
410410
* @returns The query string.
411411
*/
412-
fun touches(attribute: String, values: List<Any>) = Query("touches", attribute, values).toJson()
412+
fun touches(attribute: String, values: List<Any>) = Query("touches", attribute, listOf(values)).toJson()
413413

414414
/**
415415
* Filter resources where attribute does not touch the given geometry.
@@ -418,7 +418,7 @@ class Query(
418418
* @param values The coordinate values.
419419
* @returns The query string.
420420
*/
421-
fun notTouches(attribute: String, values: List<Any>) = Query("notTouches", attribute, values).toJson()
421+
fun notTouches(attribute: String, values: List<Any>) = Query("notTouches", attribute, listOf(values)).toJson()
422422

423423
/**
424424
* Parse the value to a list of values.

0 commit comments

Comments
 (0)