3 ms·
Hey there, I'm Joey, a Firebase dev — last November, we shipped advanced querying support[0] to address this! You can now use orderByChild(), orderByKey() or or
by joeyyang 11y ago
Hey there, I'm Joey, a Firebase dev — last November, we shipped advanced querying support[0] to address this! You can now use orderByChild(), orderByKey() or orderByPriority() to build a query.
We also have limitToFirst(), limitToLast(), startAt(), endAt(), and equalTo() methods to further filter your data.
This allows you to build queries like this:
ref.orderByChild("weight").limitToLast(2).on("child_added", function(snapshot) {
console.log(snapshot.key());
});
Please check out our querying docs[1], and let us know if you have any questions!
[0] https://www.firebase.com/blog/2014-11-04-firebase-realtime-queries.html https://www.firebase.com/blog/2014-11-04-firebase-realtime-q...
[1] https://www.firebase.com/docs/web/api/query/ https://www.firebase.com/docs/web/api/query/
- imslavko 11y agoThis is great! I didn't doubt that Firebase will roll out features to paginate and sort data. I also don't doubt that Firebase will implement filtering in the future. Great work.