【问题标题】:flutter: how to read geohash and geopoint from firestore颤振:如何从 Firestore 中读取 geohash 和 geopoint
【发布时间】:2021-03-15 04:30:07
【问题描述】:

以下是我在firestore中保存用户的geohashgeopoint的方式。

比如我想读取字段intro,我这样写;

FirebaseFirestore.instance.collection('...').doc(..).data()['intro']

但我不知道如何从 firestore 读取 geohashgeopointgeohash 在地图内,geopoint 是地图内的数组。如何从我的 Firestore 中检索 geohashgeopoint

【问题讨论】:

    标签: flutter google-cloud-firestore get


    【解决方案1】:

    您可以读取g 而不是返回intro 字段并将数据转换为JSON。例如:

    var location = FirebaseFirestore.instance.collection('...').doc(..).data()['g']
    location = jsonEncode(location.toJson())
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-21
      相关资源
      最近更新 更多