title: How we get message of particular user to another in Firebase
body: <p>I want to get message sent from a specific user to another. I am unable to achieve this. When I use the following code, I get the message from receiver. What I need is to get message particular <code>recieverid</code> to particular <code>senderid</code>. </p>
  
  <p>My Database Snapshot</p>
  
  <p><a href="https://i.stack.imgur.com/1FQQf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1FQQf.png" alt="enter image description here"></a></p>
  
  <p>Here is my code:</p>
  
  <pre><code>Database.database().reference().child("chats")
      .queryOrdered(byChild: "receiverid")
          .queryEqual(toValue: "xEdACTcUWeOwrdIqjxeP5t5y4Kg2")
              .observe(.childAdded, with: { snapshot in
                  let msgDict = snapshot.value as! [String: Any]
                  print(msgDict)
              })
  </code></pre>