-KCY-TO_cdNKNK4_ctRm
firstName: "Billy"lastName: "Bobber"
-KCZ0Skmn-k_ur673V-m
firstName: "Jimmy"lastName: "Jones"
-KCZ1H65vKsdyeNxA2zU
firstName: "Bo"lastName: "Jackson"
Order by child is the function you want. Query on the readers path. Readers is equivalent to dinosaur in the dinosaur example here: https://www.firebase.com/docs/web/api/query/orderbychild.html
Try the Dino database out
--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/12250fe9-50c0-44be-a488-ab3db5233329%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I would expect your readers path to emit child_added events in the order: bobber, jackson, Jones. What order are you getting/expecting?
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/4dd2dae7-88da-4333-8ccf-52fab6f1665e%40googlegroups.com.
Ahhh cool. I get the issue. So when you do a value event you get the whole reader subtree. It's serialised as JSON object, so there is no ordering, unlike a JSON array. It's a dictionary. It doesn't make sense to order a value event source.
You want child added added events, which return individual elements under the path queried, and then those can be ordered.
So value events are for whole subtrees (including leaf value objects), child added/changed/removed/updated are useful for when you path represents a collection. I am not familiar with the plugin your using but hopefully you can see how that fits in with how your using it.
Child_added will continued to be called every time the list is updated in real-time with the new element in question. A value event would be raised also every update but exposing the whole list each update rather than just the new element added.
Not sure how that gets into the plugin but that's what is happening in the SDK.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/ce37c183-40f0-4f74-aaff-28b9f22bdc54%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/7eef7453-160d-4d15-abcd-2de2783e02c4%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/CADhN%2B91bGw-yHv6Dp%3DPrOi-Khn-sR2UTA8eo1jZZq-oDz5mtwg%40mail.gmail.com.