Last active
December 15, 2017 04:01
-
-
Save abinavseelan/fe2d5f8e7136ba764719b8a53b29a6ab to your computer and use it in GitHub Desktop.
Marking a user as online - Firestore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const db = firebase.firestore(); | |
| const usersRef = db.collection('users'); // Get a reference to the Users collection; | |
| // Set the specific user's online status to true | |
| usersRef | |
| .doc(userId) | |
| .set({ | |
| online: true, | |
| }, { merge: true}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment