Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

Remove method has stopped working #149

Open

Description

@dandelion-zen


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

Gives the following error

(node:7440) DeprecationWarning: collection.remove is deprecated. Use deleteOne, deleteMany, or bulkWrite instead.

Activity

  1. avichal-neweradeveloper commented on Jan 2, 2021

    @avichal-neweradeveloper

    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.

  2. shivamraina commented on Mar 27, 2022

    @shivamraina

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions