Add timestamp in Firestore documents

前端 未结 10 1050
旧巷少年郎
旧巷少年郎 2020-12-29 03:29

I\'m newbie to Firestore. Firestore docs says...

Important: Unlike \"push IDs\" in the Firebase Realtime Database, Cloud Firestore au

10条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-29 04:12

    The documentation isn't suggesting the names of any of your fields. The part you're quoting is just saying two things:

    1. The automatically generated document IDs for Firestore don't have a natural time-based ordering like they did in Realtime Database.
    2. If you want time-based ordering, store a timestamp in the document, and use that to order your queries. (You can call it whatever you want.)

提交回复
热议问题