javascript - firebase how to query on firebase-util -
i want filter data firebase, im using firebase-util scroll scrolling,
i have following code
var baseref = new firebase(urltofirebasedata).orderbychild("name").equalto("john_doe"); var scrollref = new firebase.util.scroll(baseref, '$priority'); // establish event listener firebase ref scrollref.on('child_added', function(record) { console.log('added child', record); });
this gives me error
error: first argument firebase.util.scroll must valid firebase ref. cannot query (e.g. have called orderbychild()).require.18.r.scroll
how can query using firebase-util, have tried putting query in different places no avail
the error message pretty explicit:
first argument firebase.util.scroll must valid firebase ref. cannot query
the reason firebase.util.scroll
needs build own query able implement scrolling on location , firebase handles 1 query per location.
if want use firebase.util.scroll
scrolling, you'll have separate data out own location can like:
var baseref = new firebase(urltofirebasedata).child("users_items").child("john_doe"); var scrollref = new firebase.util.scroll(baseref, '$priority');
Comments
Post a Comment