Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove method has stopped working #149

Open
arnav-zek opened this issue Aug 13, 2020 · 2 comments
Open

Remove method has stopped working #149

arnav-zek opened this issue Aug 13, 2020 · 2 comments

Comments

@arnav-zek
Copy link



gfs.remove({filename: filename},(err, gridStore)=>{})

Gives the following error

(node:7440) DeprecationWarning: collection.remove is deprecated. Use deleteOne, deleteMany, or bulkWrite instead.
@avichal-neweradeveloper
Copy link

avichal-neweradeveloper commented Jan 2, 2021

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.

@shivamraina
Copy link

If it will help someone, I deleted using this

const bucket = new mongodb.GridFSBucket(conn.db, { bucketName: 'uploads' });
bucket.delete(ObjectId("60edece5e06275bf0463aaf3"));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants