0

screenshot of database

Here's my DB. Whenever I use GeoFire to set a location, I use:

geoFire.setLocation("Marker", myLocation);

But I haven't figured out how I can get it under a parent. I want to store the values inside of "markerLocation" where it's under a child.

I've tried changing the key in setLocation() to exactly "markerLocation" instead of "Marker" but it still makes its own tree. For the tree, I have:

mDatabase.child("User").child("userID").setValue(user1.getId());

And I've tried to squeeze in setLocation in setValue but that doesn't work.

How can I set it so that it goes under a parent/child?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
SaltySea
  • 700
  • 1
  • 7
  • 21
  • It is recommended to keep the geo-data separate from the other data. See http://stackoverflow.com/questions/38340949/how-to-save-geofire-coordinates-along-with-other-items-in-firebase-database/38341118#38341118 – Frank van Puffelen Aug 19 '16 at 02:25
  • @FrankvanPuffelen So it's just better to have the data separate (regular properties vs. geohash and keys)? – SaltySea Aug 19 '16 at 23:55

0 Answers0