You are viewing an offline version of MongoDB documentation. Some page features might be unavailable. To view the latest version of the page or use interactive features, visit the live page.
MongoDB\GridFS\Bucket::drop()
Definition
Errors/Exceptions
MongoDB\Driver\Exception\RuntimeException for other errors at the extension level (e.g. connection errors).
Examples
$database = (new MongoDB\Client)->test; $bucket = $database->selectGridFSBucket(); $stream = fopen('php://temp', 'w+b'); fwrite($stream, "foobar"); rewind($stream); $bucket->uploadFromStream('filename', $stream); $bucket->drop();