In a Firebase function that is passed a document reference as input, how can I check if that reference is for a document or a collection?
Ex:
if(data.ref instanceof FIRESTORE_COLLECTION_REFERENCE) {
//do something...
} else if (data.ref instanceof FIRESTORE_DOCUMENT_REFERENCE) {
//do something else...
}
What is the correct call to that data type if this is an allowable means to check? If not allowed, how can I check this?