【问题标题】:Is it possible to add some filters when using GeoFirestore for Android?使用 Android 版 GeoFirestore 时是否可以添加一些过滤器?
【发布时间】:2019-01-23 16:31:09
【问题描述】:

我想知道在运行像这样的 GeoQuery 时是否可以添加一些额外的过滤器(除了半径之外):

GeoQuery geoQuery = geoFire.queryAtLocation(new GeoLocation(lat, lon), rad);

例如,假设我有一个收藏,其中存储了一些聚会邀请。在每份邀请文件中,我都有地理位置信息,告诉您聚会的地点和时间。

所以我想创建一个 GeoQuery 来检索附近的所有派对邀请,只要它们不是已经庆祝过的派对的旧邀请。

有可能实现这样的目标吗?提前致谢。

GeoFirestore for Android — Realtime location queries with Firebase

【问题讨论】:

    标签: android google-cloud-firestore geofirestore


    【解决方案1】:

    上次我检查他们说他们不支持复合查询,但您可以尝试使用布尔值来检查邀请是否旧的或已看到。

       if hasSeen == false { 
                //show invites
       }
    

    这样的东西很不错

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-03-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-31
      相关资源
      最近更新 更多