title: How to filter Firebase data in Swift?
body: <p>Basically, I have a structure called, topics which contains <code>Title</code>, <code>Description</code> and a <code>Published</code> flag (see screenshot below for clarification ).</p>
  
  <p><a href="https://i.stack.imgur.com/fOuLo.png" rel="noreferrer"><img src="https://i.stack.imgur.com/fOuLo.png" alt="Topics object in Firebase Database"></a></p>
  
  <p>In the application, I want to filter the data and only show the topics that have <code>published = true</code>.</p>
  
  <p>This is what I'm trying to do: </p>
  
  <pre><code>self.ref = FIRDatabase.database().referenceFromURL(FIREBASE_URL).child("topics")
          self.ref?.queryEqualToValue("published")
          self.ref?.observeEventType(.Value, withBlock: { (snapshot) in
              //...Handle Snapshot here
          })
  </code></pre>
  
  <p>But this is not working. How should I approach this? Thanks in advance for the help.</p>