grahamearley / FirestoreGoogleAppsScript

A Google Apps Script library for accessing Google Cloud Firestore.

Home Page:http://grahamearley.website/blog/2017/10/18/firestore-in-google-apps-script.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

getDocument automatically returns error if document does not exist

markmtran opened this issue · comments

const doc = firestore.getDocument(finalDateStr + '/' + data.itemName)

I want to check if a document exists before executing some code, but I am unable to because getDocument seems to throw an error rather than returning NULL or undefined.

Is there some way to check if a document exists?

Ah, I see that this question has already been asked. Thank you anyway, but if there are any updates do let me know!