title: How to query specific data from Firebase using Cloud functions
body: <p>This is my firebase data</p>
  
  <pre><code>users
   -L2yfvAU0cihwcJHqIv9
       City: "wah cantt"
       Email: "sharjeel2014@namal.edu.pk"
       Firstname: "sharjeel"
       Lastname: "malik"
       Latitude: "74.27559833333333"
       Longtitude: "31.509099999999997"
       Phone: "03035602137"
       Username: "sharjeel089"
  </code></pre>
  
  <p>This is my current cloud function</p>
  
  <pre><code>exports.retreivefromdatabase = functions.https.onRequest((req,res) =&gt; {
  var db = admin.database();
  var ref = db.ref();
  
  ref.on("value", function(snapshot){
  res.send(snapshot.val());
  });
  });
  </code></pre>
  
  <p>This function retrieves all data from firebase database. I just want to retrieve user data in the form of key value pairs like this on the basis of username.</p>
  
  <pre><code> {"City": "wah 
  cantt","Email":"sharjeel2014@namal.edu.pk","Firstname":"sharjeel"........}
  </code></pre>
  
  <p>How to do that?</p>