Incorrect ordering while using `singleEvent` as `true`
See original GitHub issueSince setting singleEvent
as true
returns the whole set of data in a single response as a value:Object
containing all the values
i.e {key1:val1, key2:val2,...}
(existing behavior)
rather than value:Array<Object>
i.e [{key:key1, val:val1}, {key:key2, val:val2},...]
(expected behavior),
the order becomes inconsistent while iterating through the result object.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Incorrect usage of UNION and ORDER BY? - Stack Overflow
Using parentheses fixed my problem while using Order by and limit clauses in the query. My requirement was to get the top and...
Read more >How To Fix Common Errors in Event Tracking Data Collection
It's a true false flag. I like to look at this as basically the bounce rate setting. If this is set to false...
Read more >Chapter 11 - Inventory Management Flashcards - Quizlet
True or false: The order quantity in a fixed-order quantity model is the same, regardless if demand is known or uncertain. True. Which...
Read more >Event Ordering With Apache Kafka - DEV Community
In a series of articles, we uncover our journey towards Event-Driven microservices. The Ordering Problem. Stepping out of the comfort zone of ...
Read more >8.0.0 Milestone · GitHub
Incorrect ordering while using singleEvent as true Firebase: Realtime DB iOS. #405 by Jai-Krish was closed on Feb 19, 2019.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@JillevdW Looks like this is fixed in plugin version 8.0.0 (out soon). The order in the JSON object is now as specified as in the
orderBy
clause (on Android this was already the case), and I’ve added a newchildren
property to the result object which is an array. Docs updated.@EddyVerbruggen that could be true, I’m not sure, however that would imply the query function is not the same as the function I just posted, some observations:
.observe
which observes value changes as well, but it will still return all the items in one call, even on subsequent calls).singleEvent
set to true returns all the results from the query bundled into an object.singleEvent
set to false calls the callback once for every single item returned from the query.So if what you say is correct, there is still a difference between the native behaviour and the way the interface here exposes them, perhaps that is not really relevant to anyone that hasn’t used the native library, but it is relevant here since we lose the order of elements when using
singleEvent = true
.