Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var flag= admin.firestore().collection('video').doc(thumbnailName);
- var getDoc = flag.get()
- .then(doc => {
- if (doc.exists) {
- console.log('exit process');// data found in firestore exit frm here
- process.exit();
- return null;// doesnt work here
- }
- else {
- console.log('create data in firestore');// do some work here
- }
- })
- .catch(err => {
- console.log('Error getting document', err);
- });
Add Comment
Please, Sign In to add comment