简体   繁体   中英

how to sort firebase auto generated key?

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM