Looking for a solution using the Firebase JavaScript API, not the REST method like in this question. My query is a bit different, so I'm hoping for a unique solution. I'm trying to run a query similar to this:
"SELECT * FROM db.table WHERE field1 ="val1";"
With Firebase, we can achieve this with the following code:
var ref = new Firebase("https://db.firebaseio.com/table");
ref.orderByChild("field1").equalTo("val1").on("value", function(record) {
console.log(record.val())
});
When using Firebase, does each child query for field1="val1" open a new TCP connection? And is there a way to retrieve all the children that meet the condition in a single callback (i.e., trigger the callback once when all data is downloaded at the client)?