googlearchive / firebase-util

An experimental toolset for Firebase
http://firebase.github.io/firebase-util
MIT License
276 stars 58 forks source link

orderByValue() on NormalizedCollection does not sort dataset #60

Open michaeldim opened 9 years ago

michaeldim commented 9 years ago

When applying the orderByValue() query on the main ref of a NormalizedCollection, the data does not sort by value. http://plnkr.co/edit/Zy1vax?p=preview

AaronJPA commented 9 years ago

I guess the constructor takes Firebase References as parameters, not Firebase Queries. Although it does not throw an error, it simply ignores the Query part. I suppose it uses .toString() to get only urls of the references.

You can use orderByValue() in the normalized reference, but I think you will have the records ordered by the client side instead of by the Firebase server.

This would also probably apply to the issue #61

michaeldim commented 9 years ago

As per @AaronJPA response to #61, querying the normalised reference works fine.

katowulf commented 9 years ago

Let's leave this opened. May be a bug here.

bogdantmm92 commented 9 years ago

I also encountered this bug. I'm using firebase-util with reactfire. From what I've seen, rectfire onChildAdded doesn't receive 'prevChildKey' parameter.