I have a node for users with key 1 to 1400 but it\'s not in order. Hot to view this in order in the console. I had a similar experience with another node. But it later got o
Unfortunately, you cannot change the order of the nodes in the Firebase Database Console. By default, all the nodes are ordered by key. One thing to remember is that Firebase keys are Strings
. And when strings are order, are ordered lexicographically
.
So for numbers, this is the normal order:
But for strings, this is the normal order:
There is no operator in Firebase and as far as i know nor in most other databases that allow you to change this behavior. Instead, you will have to modify the data to get the behavior you want. So, store values that are in the order you need them when sorted lexicographically. For numbers you can accomplish that by padding them with zeroes: