Make the MongoDB docs better! We value your opinion. Share your feedback for a chance to win $100.
Click here >
Docs Menu
Docs Home
/ /

MongoDB\GridFS\Bucket::drop()

MongoDB\GridFS\Bucket::drop()

Descarta los archivos y las colecciones de fragmentos asociadas a este bucket de GridFS.

function drop(): void

MongoDB\Driver\Exception\RuntimeException para otros errores a nivel de extensión (por ejemplo, errores de conexión).

<?php
$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();

Volver

downloadToStreamByName()

En esta página