Code Monkey home page Code Monkey logo

Comments (5)

DuncanACampbell avatar DuncanACampbell commented on September 28, 2024 1

Hi guys. We solved the problem. I hope this helps in some way.

The short answer is to normalise the location data so that it is at the base of the data hierarchy

In my example, the location object (created by Geofire) is located under the mondayRun object. However, you need all the location objects at the base of the tree so that the GeoFire circleQuery can access all of them.

Structure your data like this - with each location having a unique key that matches the element it relates to in the data structure. In the example, below you can see that our first location has a key of "team_-KbG2mHmbaQZzUDdNekv" which matches the key of the team entity which it relates to.

screen shot 2017-02-02 at 11 46 08

Then perform the GeoFire query to observe for matching locations. As each location returns, you can then use Firebase to get the info about the entity (in out case, "team_-KbG2mHmbaQZzUDdNekv").

Let me know if any of that doesn't make sense.

@martpadmat @paujur

from geofire-objc.

DuncanACampbell avatar DuncanACampbell commented on September 28, 2024

If I change the first line of the code to:

GeoFire *geoFire = [[GeoFire alloc] initWithFirebaseRef:[_ref child:@"events/mondayrun"]];

it returns my object, but I need to get all the different run objects directly under "events".

from geofire-objc.

jwngr avatar jwngr commented on September 28, 2024

How are you adding data to your GeoFire index? Your data structure in the Firebase Realtime Database looks incorrect. Make sure you are using the latest version of the GeoFire library. Also, please share the code you used to add the data to your GeoFire index.

from geofire-objc.

paujur avatar paujur commented on September 28, 2024

I'm having the exact same issue, and my data structure looks exactly the same...

from geofire-objc.

martpadmat avatar martpadmat commented on September 28, 2024

I am also looking for the answer. I am unable to retrieve the data with GeoFire search query.

from geofire-objc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.