为什么我没有获得上下文和图像响应,即使我将图像和上下文从nodejs存储到cloudinary
const 结果=等待cloudinary.api.resources();
// console.log('Cloudinary API result:', result);
// Extract relevant information from the result for images
const images = result.resources
.filter(resource => resource.type === 'upload')
.map(resource => {
// Log the resource object
console.log('Resource***********************************************:', resource);
// Return the desired structure for the mapped object
return {
publicId: resource.public_id,
imageUrl: resource.url,
imagetitle: resource.context
};
});in the resource resource object i not getting the context even though i stored image along with the context
有一个有用的方法可以通过上下文获取资源。您可以在这里找到一个示例: https://cloudinary.com/documentation/admin_api#get_resources_by_context