knadh/localStorageDB — Issue #7: Query Question
Author: danroose
Created: 2012-01-04 18:29:49+00:00
State: open

Hi knadh,

I am trying to implement your localStorageDB and have created a database. When I run the following query:

db.query("senators", function(row) { // the callback function is applied to every row in the table
if(row.chamber == "upper" && row.geoid10 == geo_id) { // if it returns true, the row is selected
return true;
} else {
return false;
}
});

How do I retrieve the results? I can watch the query loop and it returns true on one of the records but I don't understand where the results are stored in order to display them on my page?

Should I create an array and add each record to that array each time it returns true? Or do you have a function I need to call that will display results for all rows returned the way you mention in your README File?