How to get document id from firestore database
问题 I'm trying to retrieve a document id by calling doc.getId() but I can't call it from this code db.collection("Pegawai").addSnapshotListener(new EventListener<QuerySnapshot>() { @Override public void onEvent(@Nullable QuerySnapshot queryDocumentSnapshots, @Nullable FirebaseFirestoreException e) { if(e != null) { Log.d(TAG, e.toString()); } if (queryDocumentSnapshots != null) { for (DocumentChange doc: queryDocumentSnapshots.getDocumentChanges()) { if (doc.getType() == DocumentChange.Type.ADDED