Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Kotlin 如何从Firestore数据库中仅获取特定位置?_Kotlin_Google Cloud Firestore - Fatal编程技术网

Kotlin 如何从Firestore数据库中仅获取特定位置?

Kotlin 如何从Firestore数据库中仅获取特定位置?,kotlin,google-cloud-firestore,Kotlin,Google Cloud Firestore,我试图对我的Firestore数据库进行一些调整,但由于某些原因,我的查询无法工作。我收集了很多地方。这是我的数据库: places - place_id - name: Concert Hall - image: https://www...... - capacity: 550 - location: center 我需要从places节点获取容量大于500的所有位置,按位置(location)排序 这是我的代码: val que

我试图对我的Firestore数据库进行一些调整,但由于某些原因,我的查询无法工作。我收集了很多地方。这是我的数据库:

places
  - place_id
       - name: Concert Hall
       - image: https://www......
       - capacity: 550
       - location: center
我需要从places节点获取容量大于500的所有位置,按位置(location)排序

这是我的代码:

val query = placesRef.whereGreaterThan("capacity", 500).orderBy("location");

我们将非常感谢您的帮助

Firestore只能在单个字段上下单。您的查询需要在两个字段上排序:首先在
capacity
上查找具有正确容量的位置,然后在
location
上以正确的顺序返回结果。Firestore中不可能使用这种类型的查询

从:


哇,这是弗兰克·范·帕夫伦自己回答我的问题,天哪!我读了数百个关于Firebase的答案,你是最棒的!!关于Firestore,多亏了你的回答,我现在明白了!!非常感谢!!。欢迎您,Jane,欢迎您加入Stack Overflow!:-)再次感谢你帮助我!