title: Storing data from firebase child key value pairs as an array
body: <p>How do I store key value pairs from firebase into an array? I've tried writing a code to send some data to firebase from a local array and noticed they are stored in such form: </p>
  
  <p><a href="https://i.stack.imgur.com/A747q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/A747q.png" alt="enter image description here"></a></p>
  
  <p>notice how the 'medals' child are stored. </p>
  
  <p>I'm trying to take a snapshot of the array from the 'medals' object and return it as an array in swift. </p>
  
  <pre><code>let databaseRef = FIRDatabase.database().reference()
          databaseRef.child("users").child(userID!).observeSingleEventOfType(.Value, withBlock: { (snapshot) in
              // Get user medals
              self.identities3 = snapshot.value!["medals"] as! [String]
  
          })
  </code></pre>
  
  <p>I know this is very crude, but would it work? </p>
  
  <p>Thanks! Still pretty new to firebase and learning :) </p>