let newProduct = new ProductModel(); for (let i in req.files) { if (req.files[i][0].fieldname == 'image1') { cloudinary.uploader.upload(req.files.image1[0].path, { folder: fd, public_id: 'p1' }) .then(pic1 => { newProduct.photo.push(pic1.url); newProduct.updateOne({photo: newProduct.photo}) .then(() => res.redirect('back')) .catch(err => console.log(err)) }) .catch(err => console.log(err)) } else if (req.files[i][0].fieldname == 'image2') { cloudinary.uploader.upload(req.files.image2[0].path, { folder: fd, public_id: 'p2' }) .then(pic2 => { newProduct.photo.push(pic2.url); }) .catch(err => console.log(err)) } }Tengo el ProductModel que tiene un atributo de matriz de fotos. Quiero agregar pic.url de cloudinary. Pero fuera del bucle for, newProduct.photo = []. ¿Cómo puedo guardar el valor fuera del entonces?