|
The current GridFS spec does not support deleting a file by name. Mainly this is to avoid any confusion that might arise when there are multiple revisions of the same filename (what is the caller's intent: delete which revision? delete all revisions?).
With the current API the recommended way is to do what you are doing: use FindAsync to find all the revisions and delete them one by one. The code would be very similar to the example given for renaming all revisions of a filename:
http://mongodb.github.io/mongo-csharp-driver/2.1/reference/gridfs/deletingandrenamingfiles/#renaming-all-revisions-of-a-file
|