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->getGridFSBucket();
$stream = fopen('php://temp', 'w+b');fwrite($stream, "foobar");rewind($stream);
$bucket->uploadFromStream('filename', $stream);
$bucket->drop();