GeoFire query on User location

后端 未结 3 1412
灰色年华
灰色年华 2020-12-09 13:57

I\'m quite new to work with Firebase and its location library, GeoFire. Currently I\'m facing some problem when structuring my data.

At the moment my db is something

3条回答
  •  感动是毒
    2020-12-09 14:43

    For GeoFire you must keep a segment in the tree that contains just the geolocation and then you have another segment in the tree that contains the other information about the items.

    user_locations
      uid1:
        g: xxxx
        l:
          0: xxx
          1: xxx
      uid2:
        g: xxxx
        l:
          0: xxx
          1: xxx
    user_profiles:
      uid1:
        name: "giacavicchioli"
      uid2:
        name: "Frank van Puffelen"
    

    Also see: Query firebase data linked to GeoFire

提交回复
热议问题