skip to Main Content

I just realized that when I add some data into Realtime Database of Firebase and it’s will be sorted by letter from a -> z. And in my case, I don’t want that feature, so have any ways to disable that features ?

I don’t know how to disable it. Please help me.

2

Answers


  1. You cannot modify the way the Realtime Database (RTDB) nodes are sorted by default.

    If you want, when you fetch data from the RTDB, to get the data in a different order you’ll need to use one of the order-by methods (which may request the addition of sub-nodes dedicated to sorting).

    (You don’t give enough details in your question to give a more detailed answer)

    Login or Signup to reply.
  2. Instead of this:

    firebase.database().ref('yourNode').push({
        // your data
    });
    

    Make use of:

    firebase.database().ref('yourNode').child('customKey').set({
        // your data
    });
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search