OverviewFelgo Plugins Support › Firebase orderByChild result is not ordered due to javascript object conversion

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #20269


    Hi there,

    When I query Firebase database by using db.getValue(…) or db.getUserValue(…) functions with orderByChild parameter the returned value looks like it is not sorted. Schema is like below:

    + addresses

    –  -LN0JJpV0r1dZbraSYrH

    –     name: “abc”

    db.getUserValue("addresses", { orderByChild: "name"}, function(success, key, value) { ... }


    Problem is due to the fact that “value” passed to the callback function is already a javascript object and when javascript converts data to object its sorting is redesigned arbitrarily by javascript engine. So, Firebase returns the data in required order, however, Javascript loses the returned order by mixing things up.

    • Is there a way to get the data with its correct order without making changes in the database schema with current implementation of Felgo Firebase plugin?
    • Is there a way to incorporate “child_added” callback style where callback function is called per each key returned from the query? Currently the whole query is returned as an object in a single callback function call.






    Felgo Team
Viewing 2 posts - 1 through 2 (of 2 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
create apps
create games
cross platform
native performance
3rd party services
game network
level editor
easiest to learn
biggest time saving
best support