Definition
Parameters
$filename: string- The
filenameof the files to delete.
Errors/Exceptions
MongoDB\GridFS\Exception\FileNotFoundException if no file was found for the selection criteria.
MongoDB\Driver\Exception\RuntimeException for other errors at the extension level (e.g. connection errors).
Examples
$bucket = (new MongoDB\Client)->test->getGridFSBucket();
$stream = fopen('php://temp', 'w+b');fwrite($stream, "foobar");rewind($stream);
$bucket->uploadFromStream('filename', $stream);
$bucket->deleteByName('filename');