title: Firebase queryEqual to any of multiple values
body: <p>I'm writing a chat app using a Firebase database. I need to query my data to find the messages to show to the user. I am currently using <code>queryEqual</code> to find all the posts FROM the specified user:</p>
  
  <pre><code>databaseRef.child("posts").queryOrdered(byChild: "uid").queryEqual(toValue: FirebaseManager.currentUser?.uid)
  </code></pre>
  
  <p>This returns all the posts sent from the logged in user, but doesn't return anything sent TO the logged in user. I can get the messages sent to the logged in user by changing 'uid' to 'toId' as follows:</p>
  
  <pre><code>databaseRef.child("posts").queryOrdered(byChild: "toId").queryEqual(toValue: FirebaseManager.currentUser?.uid)
  </code></pre>
  
  <p>But how can I combine the two into one query that says "give me all the posts where either 'uid' or 'toId' is equal to this value"?</p>
  
  <p>Here is my database:</p>
  
  <p><a href="https://i.stack.imgur.com/AtAi9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AtAi9.png" alt="database"></a></p>