title: How to add a user to a firebase numbered array
body: <p>I am new to firebase and trying to add a user to a chat group on login. My function currently appends the user to 'members' by using childbyautoid but this adds a firebase generated ID key and key titled uid.</p>
  
  <p>What I want to do is generate the next number in the sequence as the key, and the user id as the value.</p>
  
  <p>My function in Swift:</p>
  
  <pre><code>let key = self.databaseRef.child("groups").child("-LEf3_zagKHB6qQEbTL7").child("members").childByAutoId().key
  let newuser = ["uid": uid]
  let childUpdates = ["/members/\(key)": newuser]
  self.databaseRef.child("groups").child("-LEf3_zagKHB6qQEbTL7").updateChildValues(childUpdates)
  </code></pre>
  
  <p>When I try to add a fourth
   member to the group, this is what I get in Firebase for the group "LEf3_zagKHB6qQEbTL7"...</p>
  
  <pre><code>{
    "description" : "The Tribe",
    "members" : {
      "0" : "5pw4MkVxKob8nXiHojTl61tQQ822",
      "1" : "FeP6H8H0PyVjMDcqwH3zbY0xAxg2",
      "2" : "ZtcfskmMydQmGIarYyKiuO6cKbh1",
      "-BdfJitm1T_fu1ssXcUY" : {
        "uid" : "dSiUpZfdRpXxE7WQL01T5lOUkfF2"
      }
    },
    "title" : "popupzendo"
  }
  </code></pre>
  
  <p>What I am expecting to see is this...</p>
  
  <pre><code>{
    "description" : "The Tribe",
    "members" : {
      "0" : "5pw4MkVxKob8nXiHojTl61tQQ822",
      "1" : "FeP6H8H0PyVjMDcqwH3zbY0xAxg2",
      "2" : "ZtcfskmMydQmGIarYyKiuO6cKbh1",
      "3" : "dSiUpZfdRpXxE7WQL01T5lOUkfF2"
      }
    },
    "title" : "popupzendo"
  }
  </code></pre>