title: Saving an existing JSON file in Firebase using Swift?
body: <p>I have a JSON file, saved locally in my project. Now I'm curious about saving it in Firebase. I know that Firebase saves data in a NoSQL format (as a JSON). I've seen several tutorials about adding files to Firebase, (after some action, like tapping a button in an example iOS app). But is it possible to save a whole JSON file itself (not just chunks of it) in firebase, initially (not after tapping some button), and then load that file, because in my project users can't add files on their own? The app should load the data from JSON file. 
  I'm new to Firebase, so I have almost no experience using it. If you have any suggestions or know how to do this, I would appreciate your help.</p>
  
  <p><strong>EDITED</strong>
  Well, to clarify what I am asking about. I have a project which contains a text file, which contains a JSON data. I added it to my project, initially, because I had no experience using Firebase, AWS etc. I just needed to see how the app reacts to data. In the future the data will grow significantly, so obviously I'm not going to save it inside of the project.
  The problem is, I just want to save the JSON data in Firebase. And I don't know the right way to do that: by just importing the JSON or writing it from scratch (programmatically or in a console). Also, I would like to know whether it is generally a good idea or not, because this is the first time I'm using online databases, and many people say that Firebase is the best database to start from. I'm really new to all these stuff, that's why I'm asking questions like these.</p>
  
  <p><strong>EDITED_2</strong></p>
  
  <pre><code>{
  "list": {
      "restaurants": [{
                      "id": "231311234342bn123",
                      "name": "Grand Royal",
                      "suggested": true,
                      "address": {
                      "longitude": "30.31527",
                      "latitude": "59.93688",
                      "formatted": ["Nevskiy prospekt 10, Saint Petersburg",
                                    "Russian Federation"
                                    ]
                      },
                      "tags": ["fish",
                               "Italian",
                               "Friends"
                               ],
                      "category": "$$$$",
                      "description": "Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.",
                      "shortDescription": "an",
                      "collectionName": "Relaxing with friends",
                      "distance": "1324",
                      "country": "Russian Federation",
                      "Region": "North-West region",
                      "city": "Saint Petersburg"
                      },
  
                      {
                      "id": "123234344t5213",
                      "name": "N",
                      "image": "A",
                      "suggested": true,
                      "address": {
                      "longitude": "30.31821",
                      "latitude": "59.93605",
                      "formatted": ["Nevskiy prospekt 15, Saint Petersburg",
                                    "Russian Federation"
                                    ]
                      },
                      "tags": ["fish",
                               "french",
                               "family"
                               ],
                      "category": "$$$$",
                      "description": "Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. ",
                      "shortDescription": "ab",
                      "collectionName": "Evening with a family",
                      "distance": "556",
                      "country": "Russian Federation",
                      "Region": "North-West region",
                      "city": "Saint Petersburg"
                      }]}}
  </code></pre>
  
  <p>Here is a snippet of my initial JSON data (it isn't completed, for example, at this moment there is only a string for an image). The data is used throughout the whole app (in a table view, separate views etc.). For example, I use it to populate the table view, use it in a <code>mapView</code> and in other <code>UIViewController</code> subclasses. Also, I need an ability to filter it and to search through it. Currently, I'm doing that by decoding the whole JSON and adding it to an array, and then, I filter that array. But I guess, that isn't the best choice when you have a large amount of data with images. </p>
  
  <p>And one more thing, in <code>Core Data</code> it is possible to set batch requests, so it will initially fetch only some amount of data. It works fine with table views, because when you scroll them, <code>Core Data</code> automatically fetches new data to populate cells. Is it possible to do something like that with firebase, or should I read all data at once?</p>
  
  <p>I've also read that Firebase doesn't require to save array-like data, but  there are several ways to solve that issue. It is important to me, because I do need some part of the data to be in an array.</p>