gpt4 book ai didi

node.js - 在 Cloud Functions for Firebase 中获取存储元数据

转载 作者:太空宇宙 更新时间:2023-11-03 22:10:12 25 4
gpt4 key购买 nike

是否可以在 Cloud Functions for Firebase 中获取自定义存储元数据?例如在 android 代码中:

 StorageMetadata metadata = new StorageMetadata.Builder().setContentType("image/jpg")
.setCustomMetadata("latitude",String.valueOf(image.latitude))
.setCustomMetadata("longitude",String.valueOf(image.longitude))
.setCustomMetadata("deviceID",image.deviceID)
.setCustomMetadata("userID",image.userID)
.setCustomMetadata("deviceFilePath",image.filename)
.setCustomMetadata("timestamp",String.valueOf(image.timestamp))
.setCustomMetadata("caption",image.caption)
.setCustomMetadata("location",image.location)
.setCustomMetadata("imageID",key)
.build();

我想检索云函数中的自定义元数据值

最佳答案

使用这个。

}).then(() => {
return file.getMetadata();
}).then((meta) => {
console.log(meta[0]);
value1 = meta[0]["metadata"]["key1"];
value2 = meta[0]["metadata"]["key2"];

关于node.js - 在 Cloud Functions for Firebase 中获取存储元数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44559283/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com