Skip to content

Instantly share code, notes, and snippets.

@abinavseelan
Last active December 15, 2017 04:01
Show Gist options
  • Select an option

  • Save abinavseelan/fe2d5f8e7136ba764719b8a53b29a6ab to your computer and use it in GitHub Desktop.

Select an option

Save abinavseelan/fe2d5f8e7136ba764719b8a53b29a6ab to your computer and use it in GitHub Desktop.
Marking a user as online - Firestore
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