Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

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

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

    Furkan

    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.

    Best

    Furkan

     

     

    #20275

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

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded