JSON import file size limit?

1,055 views
Skip to first unread message

Bret Askeland

unread,
Feb 23, 2016, 2:45:15 AM2/23/16
to Firebase Google Group
I'm trying to import an 89mb valid json collection and it always times out after a few minutes and says Error loading json file.

Is there a size limit or a way I can upload this in chunks?

Sample of my file:

[{"range":"B&B Target Center","city":"San Juan","state":"PA","address":"369 Ave. San Claudio","zipcode":"00926","phone":"","website":""},
{"range":"Bret Range","city":"San Juan","state":"IA","address":"369 Ave. San Claudio","zipcode":"00926","phone":"","website":"www.google.com"},
{"range":"C Target Center","city":"San Juan","state":"PA","address":"369 Ave. San Claudio","zipcode":"00926","phone":"","website":""},
{"range":"A Target Center","city":"San Juan","state":"PA","address":"369 Ave. San Claudio","zipcode":"00926","phone":"515-720-9899","website":""}]


James Tamplin

unread,
Feb 23, 2016, 3:17:13 AM2/23/16
to Firebase Google Group
Hi Bret -

You might want to try our firebase-import library. It's helpful for importing large data sets into Firebase


Best,

James


--
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/23f3ec25-e7a4-4fb9-9f92-69f0e295b9f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Jacob Wenger

unread,
Feb 23, 2016, 9:08:42 AM2/23/16
to fireba...@googlegroups.com
Hey Bret,

Firebase (and realtime databases in general) is not really designed for arrays. You will need to make sure the data is in an "object" form. So format your data as:

{
  "item1": {"range":"B&B Target Center","city":"San Juan","state":"PA","address":"369 Ave. San Claudio","zipcode":"00926","phone":"","website":""},
  "item2": {"range":"Bret Range","city":"San Juan","state":"IA","address":"369 Ave. San Claudio","zipcode":"00926","phone":"","website":"www.google.com"},
  "item3": {"range":"C Target Center","city":"San Juan","state":"PA","address":"369 Ave. San Claudio","zipcode":"00926","phone":"","website":""},
  "item4" {"range":"A Target Center","city":"San Juan","state":"PA","address":"369 Ave. San Claudio","zipcode":"00926","phone":"515-720-9899","website":""}
}

instead of 

[
  {"range":"B&B Target Center","city":"San Juan","state":"PA","address":"369 Ave. San Claudio","zipcode":"00926","phone":"","website":""},
  {"range":"Bret Range","city":"San Juan","state":"IA","address":"369 Ave. San Claudio","zipcode":"00926","phone":"","website":"www.google.com"},
  {"range":"C Target Center","city":"San Juan","state":"PA","address":"369 Ave. San Claudio","zipcode":"00926","phone":"","website":""},
  {"range":"A Target Center","city":"San Juan","state":"PA","address":"369 Ave. San Claudio","zipcode":"00926","phone":"515-720-9899","website":""}
]

Cheers,
Jacob

Kato Richardson

unread,
Feb 23, 2016, 10:07:17 AM2/23/16
to Firebase Google Group
You can read about arrays and Firebase here.

Bret Askeland

unread,
Feb 23, 2016, 10:23:34 AM2/23/16
to Firebase Google Group
When I try to take away the [ ] around the json it says not valid json.  When i add the extra curly braces around the end it also says not valid json.

Bret Askeland

unread,
Feb 23, 2016, 10:30:06 AM2/23/16
to Firebase Google Group
I was only sending a collection of json using the [ ] not a true array.

My small sample imports just fine I think i will try the importer that James mentions above
Reply all
Reply to author
Forward
0 new messages