I am sorry. I previously make the same question but it was considered duplicate to this answer . I really don't understand the answer there and I don't understand why that question will answer my problem. it seems very different to me. I need to get image object but the answer there is to create a stream. could someone please help me to relate the answer from there to my problem ? I am new in cloud function. please
=======================================================================
If I use Cloud Functions for Firebase Cloud Storage triggers. I can get the image object like this
exports.compressImage = functions.region("asia-east2").storage.object().onFinalize(async (object) => {
// I can get the `object` easily in here
})
but now I want do something using firestore trigger, and I want to get an object from my bucket in my firestore trigger
exports.dbEventsOnCreate = functions..firestore.document(path).onCreate(async (snapshot,context) => {
// I want to get an image `object` with a specific path from firebase storage bucket in here
})
and here is the path of my image in firebase storage
gs://xxx.appspot.com/eventPoster/{uid}/{imageID}
so how to get image object from bucket in the path like that inside my cloud function firestore trigger ?