title: How to update multiple types of nodes in Firebase with one call (Swift)
body: <p>I have a conversation node and inside are straightforward subnodes like displayMessage, conversationName, imageUrl etc, but there's also a messages node which holds additional subnodes describing all the messages sent inside the conversation w/ data like senderID, text, and timestamp. When the send message button is pressed, I'm trying to update the messages node with an additional message subnode and also the straightforward subnodes like displayMessage and lastMessageTime. However, the code I have completely replaces all nodes inside "messages" with just the new message node. </p>
  
  <pre><code> fileprivate func sendMessage(uid: String, convoId: String) {
  
  
      let ref = Database.database().reference().child("conversations").child(convoId)
  
      let messageTime = NSDate().timeIntervalSince1970
      let messageInfo : [String:Any] = ["text":containerView.chatTextView.text, "senderId":uid, "timestamp": messageTime]
      let randomMessageId = NSUUID().uuidString
      let messageDict = [randomMessageId:messageInfo]
  
      let values = ["displayMessage":containerView.chatTextView.text, "lastMessageTime": messageTime, "messages":messageDict] as [String : Any]
  
      ref.updateChildValues(values) { (error, ref) in
  
          if error != nil {
              print (error as Any)
              return
          }
  
          self.containerView.clearChatTextField()
  
                  }
  
  }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/xzZpH.png" alt="Database Structure"></p>