Do wildcards exist for Firebase Fuctions on Storage?

Viewed 481

I've been using successfully Firebase Functions to perform operations on files I've been uploading to Firebase Storage.

What I currently want to do is access the folder into which I'm shoving data by using wildcards, with the same method of implementation as how it works for the Realtime Database + Firestore. However, whenever I try to access these parameters, they exclusively return null.

Is this not possible?

Here's an example of my code:

  exports.generateThumbnail = functions.storage.object('user-photos/{userId}/{publicOrPrivate}').onChange(event => {
    const privateOrPublic = event.params.publicOrPrivate;
    const isPrivate = (event.params.publicOrPrivate == "private");
    const userId = event.params.userId;

    console.log("user id and publicOrPrivate are", userId, privateOrPublic);
    //"user id and publicOrPrivate are undefined undefined"
    }

Thanks!

1 Answers

There is currently no wildcard support for Cloud Storage triggers. You have to check the path of the file that changed to figure out if you want to do anything with it.

Related