In Firebase Realtime Database, we can easily manage User presence by keeping a reference to a node and updating it as shown below:
DatabaseRef presenceRef = FirebaseDatabase.getInstance().getReference("disconnectmessage");
presenceRef.onDisconnect().setValue("I disconnected!");
If I want to do the same in Cloud Firestore, is there any way to achieve it?