Querying Firebase with Swift 3.0
<p>I am trying to get all the entries where <code>createdAt</code> is equal to <code>Today</code>, but it returns nothing.</p>

<p>What am I doing wrong here? And, what is the proper way to query data the way I am trying to do?</p>

<p>JSON:</p>

<pre><code>    {
      "thoughts" : {
        "-KWGdcdZD8QJSLx6rSy8" : {
          "createdAt" : "Tomorrow",
          "thought" : "meno",
          "user" : "ET9tYfHqThNTsLG4bZGIbuLGauu2"
        },
        "-KWGeGivZl0dH7Ca4kN3" : {
          "createdAt" : "Today",
          "thought" : "meno",
          "user" : "ET9tYfHqThNTsLG4bZGIbuLGauu2"
        },
        "-KWGeIvWHBga0VQazmEH" : {
          "createdAt" : "Yesterday",
          "thought" : "meno",
          "user" : "ET9tYfHqThNTsLG4bZGIbuLGauu2"
        }
      }
    }
</code></pre>

<p>Swift:</p>

<pre><code>    let db = FIRDatabase.database().reference().child("thoughts")
    let ref = db.queryEqual(toValue: "Today", childKey: "createdAt")

    ref.observe(.value, with:{ (snapshot: FIRDataSnapshot) in
        for snap in snapshot.children {
            print((snap as! FIRDataSnapshot).key)
        }
    })
</code></pre>