How can I order the documents in Firestore?

◇◆丶佛笑我妖孽 提交于 2021-02-16 14:19:33

问题


How can I order the documents in Firestore? It looks like Firestore lists documents in alphabetic order by the ID I let Firestore automatically create. But I don't want that. I just want to see my newly added document added as the last document in the collection. How do I do that? Should I create my own alphabetic ID's?

Example of my collection in Firestore:

Example of my collection in Firestore


回答1:


Firestore is meant to scale massively. At that scale, it doesn't matter what order the documents appear in the console, because the console is useless for viewing massive numbers of documents within a collection.

If you still need an ordering in the console, you will have to come up with document IDs of your own.



来源:https://stackoverflow.com/questions/50447426/how-can-i-order-the-documents-in-firestore

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