Home > mongoose-gridfs-extra > deleteById
deleteById deletes the specified file stored in the mongodb bucket by id. If id is string or number, new ObjectId(id) will be called to convert it to an ObjectId
Signature:
declare function deleteById(bucket: mongo.GridFSBucket, id: mongo.ObjectId | string | number): Promise<void>;
| Parameter | Type | Description |
|---|---|---|
| bucket | mongo.GridFSBucket | a mongodb gridFS bucket |
| id | mongo.ObjectId | string | number | id of file to delete |
Returns:
Promise<void>