In my case, upload images to Firebase storage and store the download url in realtime database. After fetch the url images display in ascending order that means which one I upload in first that one show in first on my website. But I want to display the latest uploaded image in first on my website then I search lot of websites, youTube videos ...
Finally I got the answer : Firebase doesn't allow returning by descending order.
But I am not ready to give up.
After a night I got the solutions,
I add new field like timeStamp and change timeStamp to negative number
then upload both url and negative timeStamp
then fetch the data like 👇 from firebase :
then the images or videos display in descending order of negative timeStamp.
Top comments (0)