Hacker News new | ask | show | jobs
by joeyyang 4047 days 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-q...

[1] https://www.firebase.com/docs/web/api/query/

1 comments

This 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.