I am having a problem removing a kid string from an array of other aid strings in firebase. When a user creates a group chat, they include sharers. Those sharers are added to an array of strings and then added to firebase when made. Now when a user clicks the leave group chat button, I can't figure out a way to remove the current user's user id from that array, in which I have already checked if their uid is in the array. I have tried everything I can guys, first I tried ref.child("Group Chats").child(groupKey).child("sharers").child(myriad).removeValue, and that did not work, I also tried creating a new array without the current users id, removing the old array and adding the new one to firebase, all did not work, now I turn to some fellow coders. How can I remove the current users did from an array of uids in firebase.
let action = UIAlertAction(title: "Leave Group Chat", style: .default, handler: {( alert : UIAlertAction) -> Void in
let ref = FIRDatabase.database().reference()
if let keyp = self.groupChats[indexPath.row].key {
ref.child("Group Chats").child(keyp).child("sharers").child(uip).removeValue()
}
self.groupChat.removeAll()
self.pull()
self.pullFromSharers()
self.tableViewManage.reloadData()
})
Thank you!