remove image from destination node js mongodb code example
Example: delete single image in node js mongodb
// Delete single image
const deleteImage = (req, res) => {
Imageup.deleteOne({ _id: req.params.id })
.then(() => {
res.status(200).json({
message: "Image deleted successfully!",
});
})
.catch((error) => {
res.status(400).json({
error: error,
});
});
};