how to sort firebase auto generated key?

一曲冷凌霜 提交于 2020-06-29 04:06:26

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!