GeoJSON in firebase

778 views
Skip to first unread message

Mahmoud Mosalman

unread,
Aug 2, 2015, 1:54:34 PM8/2/15
to Firebase Google Group
It seems that Firebase doesn't like arrays: [1,2,3] and in geojson data, we have to use arrays (at least for features and coordinates). I want to use firebase REST api, but because of this I cant use query parameters. Any Idea?

Jacob Wenger

unread,
Aug 3, 2015, 12:22:16 PM8/3/15
to fireba...@googlegroups.com
Hey Mahmoud,

You can store arrays in Firebase, but they just won't show up as arrays. An array like [1, 2, 3] will show up as:

{
  '0': 1,
  '1': 2,
  '2': 3
}

So you'll just have to account for the fact that your data will be in that format. There are lots of reasons why arrays aren't great for realtime databases like Firebase, many of which are discusses in our docs.

If you are looking to do geospatial queries using Firebase, you should check out GeoFire. We have JavaScript, iOS, and Java versions of the library, all of which play nicely with each other.

Jacob

On Sun, Aug 2, 2015 at 8:03 AM, Mahmoud Mosalman <m.mos...@gmail.com> wrote:
It seems that Firebase doesn't like arrays: [1,2,3] and in geojson data, we have to use arrays (at least for features and coordinates). I want to use firebase REST api, but because of this I cant use query parameters. Any Idea?

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/52a63b4c-06d3-4b0e-8f16-f80d85eefffb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages