gridfs-stream
gridfs-stream copied to clipboard
Remove method has stopped working
gfs.remove({filename: filename},(err, gridStore)=>{})
Gives the following error
(node:7440) DeprecationWarning: collection.remove is deprecated. Use deleteOne, deleteMany, or bulkWrite instead.
They have not updated it according to mongoose and no other method for deleting such as deleteOne, deleteMany are not available. They must update it soon.
If it will help someone, I deleted using this
const bucket = new mongodb.GridFSBucket(conn.db, { bucketName: 'uploads' });
bucket.delete(ObjectId("60edece5e06275bf0463aaf3"));