var GridFS = Grid(mongoose.connection.db, mongoose.mongo);
GridFS.remove({_id: mongoose.Types.ObjectId(req.params.file_id)}, function (err) {
if (!err) {
return res.send(204);
} else {
console.log("error");
}
});
using above code I can delete documents from fs.files collections. But its not romoving from fs.chunks collections. How I can delete documents from both collections fs.files and fs.chunks.