title: How do I import my JSON array into Firebase as a FirebaseArray?
body: <p>I have a large JSON file which contains an array. I am using Firebase for my app's backend and I want to use FirebaseArray to store the data.</p>
  
  <p>It is simple to create a FirebaseArray from my Angular app and add data to it, but the nature of my app is that I have fetched data which I need to first import into Firebase somehow.</p>
  
  <p>On the Firebase website the only option for importing is from a JSON. When I import my JSON file, the result is an object with numerical keys, which I realize is like an array, but has a major issue.</p>
  
  <pre><code>{
    "posts": {
      "0": {
        "id": "iyo0iw",
        "title": "pro patria mori"
      },
      "1": {
        "id": "k120iw",
        "title": "an english title"
      },
      "2": {
        "id": "p6124w",
        "title": "enim pablo espa"
      }
    }
  }
  </code></pre>
  
  <p>Users are able to change the position of items, and the position of an item is also how items are uniquely identified. With multiple users this means the following problem can occur.</p>
  
  <ul>
  <li>Sarah: Change post[0] title to "Hello everyone"</li>
  <li>Trevor: Swap post[1] position with post[2]</li>
  <li>Sarah: Change post[1] title to "This is post at index 1 right?"</li>
  </ul>
  
  <p>If the following actions happen in a short space of time, Firebase doesn't know for sure what Sarah saw as post[1] when they changed the title, and can't know for sure which post object to update.</p>
  
  <p>What I want is a way to import my JSON file and have the arrays become <a href="https://www.firebase.com/docs/web/libraries/angular/api.html#angularfire-firebasearray" rel="nofollow noreferrer">FirebaseArrays</a>, not objects with numerical keys, which are like arrays and share the issue described above.</p>