title: Firebase Load Data as Old as X Days
body: <p>I'm using Swift 3 and Firebase. I'm trying to load into a feed all the posts from the last X days. What's the way to do this without retrieving all my posts? </p>
  
  <p>I tried doing </p>
  
  <pre><code>ref.queryOrdered(byChild: "createdAt").queryStarting(atValue: dateInPast)
  </code></pre>
  
  <p>but it won't let me set a date parameter for .queryStarting(atValue:)</p>
  
  <p>Error message:</p>
  
  <blockquote>
    <p>Terminating app due to uncaught exception 'InvalidQueryParameter', reason: 'You can only pass nil, NSString or NSNumber to queryStartingAtValue:'</p>
  </blockquote>
  
  <p>Data Structure: </p>
  
  <pre><code>{
      "createdAt": "20161013134743",
      "imageURL": "",
      "latitude": 44.43127318210377,
      "longitude": 26.07118959027369,
      "objectId": "-KTyI60jaUUuRBj-sIRR",
      "ownerId": "TlQZr5cqSIUboBO8k3bjz3q6oj63",
      "postText": "Bravo sefu' la Moose!",
      "replies": 4,
      "reportCount": 0,
      "score": 5,
      "updatedAt": "20161013134743"
  }
  </code></pre>