title: How to read child or filter firebase data by its key value in swift ios
body: <p>I'm new to both swift and firebase , I'm trying to get all the item and price printed using this code below , I want to be able to print ..</p>
  
  <p>output : </p>
  
  <ul>
  <li>Red Chair 100</li>
  <li>Sofa Bed  120 </li>
  </ul>
  
  <p><a href="https://i.stack.imgur.com/f8FnG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/f8FnG.png" alt="enter image description here"></a></p>
  
  <pre><code>  var ref =  Firebase(url: "https://jeanniefirstapp.firebaseio.com")
  
  var item1     =  ["name": "Alan Turning", "item" : "Red Chair", "price": "100"]
  var item2     =  ["name": "Grace Hopper", "item": "Sofa Bed"  , "price": "120"]
  var item3     =  ["name": "James Cook"  , "item": "White Desk", "price": "250"]
  var item4     =  ["name": "James Cook"  , "item": "Mattress Cal King", "price": "100"]
  
  override func viewDidLoad() {
      super.viewDidLoad()
      var usersRef = ref.childByAppendingPath("users")
  
      var users = ["item1": item1, "item2": item2, "item3" : item3 , "item4" : item4 ]
  
      usersRef.setValue(users)
  
  
  }
  ref.queryOrderedByChild("price").observeEventType(.Value, withBlock: { snapshot in
      if let price = snapshot.value["price"] as? Int {
          println("\(snapshot.key) price at \(price) Dollars ")
          println(snapshot.key)
      }
  })
  </code></pre>