Guest User

Untitled

a guest
Jul 17th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. var flag= admin.firestore().collection('video').doc(thumbnailName);
  2. var getDoc = flag.get()
  3. .then(doc => {
  4. if (doc.exists) {
  5. console.log('exit process');// data found in firestore exit frm here
  6. process.exit();
  7. return null;// doesnt work here
  8. }
  9. else {
  10. console.log('create data in firestore');// do some work here
  11. }
  12. })
  13. .catch(err => {
  14. console.log('Error getting document', err);
  15. });
Add Comment
Please, Sign In to add comment