title: How to update an array on firebase using the onDisconnectUpdateChildValues
body: <p>I want to remove the user from an array of users once they disconnect (real time firebase).</p>
  <p>For example: John crashed, so remove johns node and reorder the indices. Please check image.</p>
  <p><a href="https://i.stack.imgur.com/R4sQC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/R4sQC.png" alt="enter image description here" /></a></p>
  <pre><code>let connectedRef = Database.database().reference(withPath: &quot;.info/connected&quot;)
      
      connectedRef.observe(.value, with: { snapshot in
          
          guard let connected = snapshot.value as? Bool, connected else {
              completion(false)
              return
          }
          
          self.database.child(&quot;\(groupChatId)_F/users&quot;).onDisconnectUpdateChildValues([ ??? ]){ (error, ref) in
              if let error = error {
                  print(&quot;\(error)&quot;)
              }
              completion(true)
          }
      })
  </code></pre>
  <p>I am not entirely sure if it's even possible to do such a thing. If my intuition is true then please provide suggestions on how a problem can be overcome.</p>