Skip to content

Instantly share code, notes, and snippets.

@sketchthat
Created January 31, 2019 22:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sketchthat/f6b983dbb5bb44e09ddf7d6d55f02d60 to your computer and use it in GitHub Desktop.
Save sketchthat/f6b983dbb5bb44e09ddf7d6d55f02d60 to your computer and use it in GitHub Desktop.
const snapshots: DataSnapshot = await firebase.database().ref('/users')
.once('value');
snapshots.forEach(async snapshot => {
const userId = snapshot.key;
await firebase.database().ref(`/users/${userId}`).update({
lastProcessed: firebase.database.ServerValue.TIMESTAMP,
});
return false;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment