问题
I am working with firebase real time database. Every time I push the data into the firebase using push method it auto generates a key like this "-L1GgaMStpwEV4N3sQad" to my best knowledge it's generated based on time also.
So my question is there any way to sort the key asce or in desc?.
I have attached image of firebase auto generated.
Thanks in advance.
回答1:
I new to firebase but here's my observation : The unique keys that are generated are already sorted in Lexicographical order. Have a closer look at your objects: -L1GgaM is common for all keys (except last which ends with 'N')
Also, remember that capital letters have lower ASCII value than their counterpart.
来源:https://stackoverflow.com/questions/49276009/how-to-sort-firebase-auto-generated-key