存储中的Firebase功能是否存在通配符?

MQL*_*QLN 3 node.js firebase google-cloud-functions firebase-storage

我一直在使用成功的Firebase功能对我上传到Firebase存储的文件执行操作.

我目前想要做的是使用通配符访问我正在推送数据的文件夹,其实现方法与实时数据库+ Firestore的工作方式相同.但是,每当我尝试访问这些参数时,它们都会返回null.

这不可能吗?

这是我的代码示例:

  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"
    }
Run Code Online (Sandbox Code Playgroud)

谢谢!

Dou*_*son 5

目前没有对云存储触发器的通配符支持.您必须检查更改的文件的路径,以确定是否要对其执行任何操作.