Retrieving Document Id from Firestore Collection (Android)

后端 未结 3 686
攒了一身酷
攒了一身酷 2021-01-25 08:04

I\'m trying to extract the auto-generated Id under a document so I can use it elsewhere.

Here is the full code:

mStartChatButton.setOnClickListener(new V         


        
3条回答
  •  庸人自扰
    2021-01-25 08:18

    In Documentation writed that

    However, sometimes there is no meaningful ID for this document and it's easier to let Cloud Firestore automatically generate an ID for you. You can do this by calling add().

    So you can follow @R. Wright answer.

提交回复
热议问题