Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongo-php-library
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sinan
mongo-php-library
Commits
4955333a
Commit
4955333a
authored
Oct 28, 2016
by
Jeremy Mikola
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PHPLIB-221: API documentation for MongoDB\GridFS\Bucket
parent
b33e5a5a
Hide whitespace changes
Inline
Side-by-side
Showing
37 changed files
with
1070 additions
and
0 deletions
+1070
-0
apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml
...rgs-MongoDBDatabase-method-selectGridFSBucket-option.yaml
+48
-0
apiargs-MongoDBDatabase-method-selectGridFSBucket-param.yaml
...args-MongoDBDatabase-method-selectGridFSBucket-param.yaml
+6
-0
apiargs-MongoDBGridFSBucket-method-construct-option.yaml
.../apiargs-MongoDBGridFSBucket-method-construct-option.yaml
+48
-0
apiargs-MongoDBGridFSBucket-method-construct-param.yaml
...s/apiargs-MongoDBGridFSBucket-method-construct-param.yaml
+18
-0
apiargs-MongoDBGridFSBucket-method-delete-param.yaml
...udes/apiargs-MongoDBGridFSBucket-method-delete-param.yaml
+10
-0
apiargs-MongoDBGridFSBucket-method-downloadToStream-param.yaml
...gs-MongoDBGridFSBucket-method-downloadToStream-param.yaml
+20
-0
apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-option.yaml
...oDBGridFSBucket-method-downloadToStreamByName-option.yaml
+22
-0
apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-param.yaml
...goDBGridFSBucket-method-downloadToStreamByName-param.yaml
+26
-0
apiargs-MongoDBGridFSBucket-method-getFileDocumentForStream-param.yaml
...DBGridFSBucket-method-getFileDocumentForStream-param.yaml
+10
-0
apiargs-MongoDBGridFSBucket-method-getFileIdForStream-param.yaml
...-MongoDBGridFSBucket-method-getFileIdForStream-param.yaml
+10
-0
apiargs-MongoDBGridFSBucket-method-openDownloadStream-param.yaml
...-MongoDBGridFSBucket-method-openDownloadStream-param.yaml
+10
-0
apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-option.yaml
...BGridFSBucket-method-openDownloadStreamByName-option.yaml
+22
-0
apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-param.yaml
...DBGridFSBucket-method-openDownloadStreamByName-param.yaml
+16
-0
apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml
...s-MongoDBGridFSBucket-method-openUploadStream-option.yaml
+32
-0
apiargs-MongoDBGridFSBucket-method-openUploadStream-param.yaml
...gs-MongoDBGridFSBucket-method-openUploadStream-param.yaml
+16
-0
apiargs-MongoDBGridFSBucket-method-rename-param.yaml
...udes/apiargs-MongoDBGridFSBucket-method-rename-param.yaml
+20
-0
apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml
...s-MongoDBGridFSBucket-method-uploadFromStream-option.yaml
+32
-0
apiargs-MongoDBGridFSBucket-method-uploadFromStream-param.yaml
...gs-MongoDBGridFSBucket-method-uploadFromStream-param.yaml
+26
-0
reference.txt
docs/reference.txt
+1
-0
MongoDBDatabase.txt
docs/reference/class/MongoDBDatabase.txt
+1
-0
MongoDBGridFSBucket.txt
docs/reference/class/MongoDBGridFSBucket.txt
+51
-0
MongoDBDatabase-selectGridFSBucket.txt
docs/reference/method/MongoDBDatabase-selectGridFSBucket.txt
+74
-0
MongoDBGridFSBucket-delete.txt
docs/reference/method/MongoDBGridFSBucket-delete.txt
+34
-0
MongoDBGridFSBucket-downloadToStream.txt
...reference/method/MongoDBGridFSBucket-downloadToStream.txt
+36
-0
MongoDBGridFSBucket-downloadToStreamByName.txt
...nce/method/MongoDBGridFSBucket-downloadToStreamByName.txt
+40
-0
MongoDBGridFSBucket-drop.txt
docs/reference/method/MongoDBGridFSBucket-drop.txt
+24
-0
MongoDBGridFSBucket-find.txt
docs/reference/method/MongoDBGridFSBucket-find.txt
+40
-0
MongoDBGridFSBucket-getBucketName.txt
docs/reference/method/MongoDBGridFSBucket-getBucketName.txt
+28
-0
MongoDBGridFSBucket-getDatabaseName.txt
.../reference/method/MongoDBGridFSBucket-getDatabaseName.txt
+28
-0
MongoDBGridFSBucket-getFileDocumentForStream.txt
...e/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
+37
-0
MongoDBGridFSBucket-getFileIdForStream.txt
...ference/method/MongoDBGridFSBucket-getFileIdForStream.txt
+38
-0
MongoDBGridFSBucket-openDownloadStream.txt
...ference/method/MongoDBGridFSBucket-openDownloadStream.txt
+39
-0
MongoDBGridFSBucket-openDownloadStreamByName.txt
...e/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
+43
-0
MongoDBGridFSBucket-openUploadStream.txt
...reference/method/MongoDBGridFSBucket-openUploadStream.txt
+47
-0
MongoDBGridFSBucket-rename.txt
docs/reference/method/MongoDBGridFSBucket-rename.txt
+28
-0
MongoDBGridFSBucket-uploadFromStream.txt
...reference/method/MongoDBGridFSBucket-uploadFromStream.txt
+44
-0
MongoDBGridFSBucket__construct.txt
docs/reference/method/MongoDBGridFSBucket__construct.txt
+45
-0
No files found.
docs/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml
0 → 100644
View file @
4955333a
arg_name
:
option
name
:
bucketName
type
:
string
description
:
|
The bucket name, which will be used as a prefix for the files and chunks
collections. Defaults to ``"fs"``.
interface
:
phpmethod
operation
:
MongoDB\\Database::selectGridFSBucket
optional
:
true
position
:
1
---
arg_name
:
option
name
:
chunkSizeBytes
type
:
integer
description
:
|
The chunk size in bytes. Defaults to ``261120`` (i.e. 255 KiB).
interface
:
phpmethod
operation
:
MongoDB\\Database::selectGridFSBucket
optional
:
true
position
:
2
---
source
:
file
:
apiargs-common-option.yaml
ref
:
readConcern
operation
:
MongoDB\\Database::selectGridFSBucket
position
:
3
replacement
:
resource
:
"
bucket"
parent
:
"
database"
---
source
:
file
:
apiargs-common-option.yaml
ref
:
readPreference
operation
:
MongoDB\\Database::selectGridFSBucket
position
:
4
replacement
:
resource
:
"
bucket"
parent
:
"
database"
---
source
:
file
:
apiargs-common-option.yaml
ref
:
writeConcern
operation
:
MongoDB\\Database::selectGridFSBucket
position
:
5
replacement
:
resource
:
"
bucket"
parent
:
"
database"
...
docs/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-param.yaml
0 → 100644
View file @
4955333a
source
:
file
:
apiargs-common-param.yaml
ref
:
$options
operation
:
MongoDB\\Database::selectGridFSBucket
position
:
1
...
docs/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml
0 → 100644
View file @
4955333a
arg_name
:
option
name
:
bucketName
type
:
string
description
:
|
The bucket name, which will be used as a prefix for the files and chunks
collections. Defaults to ``"fs"``.
interface
:
phpmethod
operation
:
MongoDB\\GridFS\\Bucket::__construct
optional
:
true
position
:
1
---
arg_name
:
option
name
:
chunkSizeBytes
type
:
integer
description
:
|
The chunk size in bytes. Defaults to ``261120`` (i.e. 255 KiB).
interface
:
phpmethod
operation
:
MongoDB\\GridFS\\Bucket::__construct
optional
:
true
position
:
2
---
source
:
file
:
apiargs-common-option.yaml
ref
:
readConcern
operation
:
MongoDB\\GridFS\\Bucket::__construct
position
:
3
replacement
:
resource
:
"
bucket"
parent
:
"
database"
---
source
:
file
:
apiargs-common-option.yaml
ref
:
readPreference
operation
:
MongoDB\\GridFS\\Bucket::__construct
position
:
4
replacement
:
resource
:
"
bucket"
parent
:
"
database"
---
source
:
file
:
apiargs-common-option.yaml
ref
:
writeConcern
operation
:
MongoDB\\GridFS\\Bucket::__construct
position
:
5
replacement
:
resource
:
"
bucket"
parent
:
"
database"
...
docs/includes/apiargs-MongoDBGridFSBucket-method-construct-param.yaml
0 → 100644
View file @
4955333a
source
:
file
:
apiargs-common-param.yaml
ref
:
$manager
operation
:
MongoDB\\GridFS\\Bucket::__construct
position
:
1
---
source
:
file
:
apiargs-common-param.yaml
ref
:
$databaseName
operation
:
MongoDB\\GridFS\\Bucket::__construct
position
:
2
---
source
:
file
:
apiargs-common-param.yaml
ref
:
$options
operation
:
MongoDB\\GridFS\\Bucket::__construct
position
:
3
...
docs/includes/apiargs-MongoDBGridFSBucket-method-delete-param.yaml
0 → 100644
View file @
4955333a
arg_name
:
param
name
:
$id
type
:
mixed
description
:
|
The ``_id`` of the file to delete.
interface
:
phpmethod
operation
:
MongoDB\\GridFS\\Bucket::delete
optional
:
false
position
:
1
...
docs/includes/apiargs-MongoDBGridFSBucket-method-downloadToStream-param.yaml
0 → 100644
View file @
4955333a
arg_name
:
param
name
:
$id
type
:
mixed
description
:
|
The ``_id`` of the file to download.
interface
:
phpmethod
operation
:
MongoDB\\GridFS\\Bucket::downloadToStream
optional
:
false
position
:
1
---
arg_name
:
param
name
:
$destination
type
:
resource
description
:
|
Writable stream where the GridFS file's contents will be written.
interface
:
phpmethod
operation
:
MongoDB\\GridFS\\Bucket::downloadToStream
optional
:
false
position
:
2
...
docs/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-option.yaml
0 → 100644
View file @
4955333a
arg_name
:
option
name
:
revision
type
:
integer
description
:
|
The revision of the file to retrieve. Files with the name ``filename`` will be
differentiated by their ``uploadDate`` field.
Revision numbers are defined as follows:
- 0 = the original stored file
- 1 = the first revision
- 2 = the second revision
- etc...
- -2 = the second most recent revision
- -1 = the most recent revision
Defaults to -1 (i.e. the most recent revision).
interface
:
phpmethod
operation
:
MongoDB\\GridFS\\Bucket::downloadToStreamByName
optional
:
true
position
:
1
...
docs/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-param.yaml
0 → 100644
View file @
4955333a
arg_name
:
param
name
:
$filename
type
:
string
description
:
|
The ``filename`` of the file to download.
interface
:
phpmethod
operation
:
MongoDB\\GridFS\\Bucket::downloadToStreamByName
optional
:
false
position
:
1
---
arg_name
:
param
name
:
$destination
type
:
resource
description
:
|
Writable stream where the GridFS file's contents will be written.
interface
:
phpmethod
operation
:
MongoDB\\GridFS\\Bucket::downloadToStreamByName
optional
:
false
position
:
2
---
source
:
file
:
apiargs-common-param.yaml
ref
:
$options
operation
:
MongoDB\\GridFS\\Bucket::downloadToStreamByName
position
:
3
...
docs/includes/apiargs-MongoDBGridFSBucket-method-getFileDocumentForStream-param.yaml
0 → 100644
View file @
4955333a
arg_name
:
param
name
:
$stream
type
:
resource
description
:
|
The GridFS stream resource.
interface
:
phpmethod
operation
:
MongoDB\\GridFS\\Bucket::getFileDocumentForStream
optional
:
false
position
:
1
...
docs/includes/apiargs-MongoDBGridFSBucket-method-getFileIdForStream-param.yaml
0 → 100644
View file @
4955333a
arg_name
:
param
name
:
$stream
type
:
resource
description
:
|
The GridFS stream resource.
interface
:
phpmethod
operation
:
MongoDB\\GridFS\\Bucket::getFileIdForStream
optional
:
false
position
:
1
...
docs/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStream-param.yaml
0 → 100644
View file @
4955333a
arg_name
:
param
name
:
$id
type
:
mixed
description
:
|
The ``_id`` of the file to download.
interface
:
phpmethod
operation
:
MongoDB\\GridFS\\Bucket::openDownloadStream
optional
:
false
position
:
1
...
docs/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-option.yaml
0 → 100644
View file @
4955333a
arg_name
:
option
name
:
revision
type
:
integer
description
:
|
The revision of the file to retrieve. Files with the name ``filename`` will be
differentiated by their ``uploadDate`` field.
Revision numbers are defined as follows:
- 0 = the original stored file
- 1 = the first revision
- 2 = the second revision
- etc...
- -2 = the second most recent revision
- -1 = the most recent revision
Defaults to -1 (i.e. the most recent revision).
interface
:
phpmethod
operation
:
MongoDB\\GridFS\\Bucket::openDownloadStreamByName
optional
:
true
position
:
1
...
docs/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-param.yaml
0 → 100644
View file @
4955333a
arg_name
:
param
name
:
$filename
type
:
string
description
:
|
The ``filename`` of the file to download.
interface
:
phpmethod
operation
:
MongoDB\\GridFS\\Bucket::openDownloadStreamByName
optional
:
false
position
:
1
---
source
:
file
:
apiargs-common-param.yaml
ref
:
$options
operation
:
MongoDB\\GridFS\\Bucket::openDownloadStreamByName
position
:
2
...
docs/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml
0 → 100644
View file @
4955333a
arg_name
:
option
name
:
_id
type
:
mixed
description
:
|
Value to use as the file document identifier. Defaults to a new
:php:`MongoDB\\BSON\\ObjectID <class.mongodb-bson-objectid>` object.
interface
:
phpmethod
operation
:
MongoDB\\GridFS\\Bucket::openUploadStream
optional
:
true
position
:
1
---
arg_name
:
option
name
:
chunkSizeBytes
type
:
integer
description
:
|
The chunk size in bytes. Defaults to the bucket's ``chunkSizeBytes`` option.
interface
:
phpmethod
operation
:
MongoDB\\GridFS\\Bucket::openUploadStream
optional
:
true
position
:
2
---
arg_name
:
option
name
:
metadata
type
:
array|object
description
:
|
User data for the ``metadata`` field of the file document. If not specified,
the ``metadata`` field will not be set on the file document.
interface
:
phpmethod
operation
:
MongoDB\\GridFS\\Bucket::openUploadStream
optional
:
true
position
:
3
...
docs/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-param.yaml
0 → 100644
View file @
4955333a
arg_name
:
param
name
:
$filename
type
:
string
description
:
|
The ``filename`` of the file to create.
interface
:
phpmethod
operation
:
MongoDB\\GridFS\\Bucket::openUploadStream
optional
:
false
position
:
1
---
source
:
file
:
apiargs-common-param.yaml
ref
:
$options
operation
:
MongoDB\\GridFS\\Bucket::openUploadStream
position
:
2
...
docs/includes/apiargs-MongoDBGridFSBucket-method-rename-param.yaml
0 → 100644
View file @
4955333a
arg_name
:
param
name
:
$id
type
:
mixed
description
:
|
The ``_id`` of the file to rename.
interface
:
phpmethod
operation
:
MongoDB\\GridFS\\Bucket::rename
optional
:
false
position
:
1
---
arg_name
:
param
name
:
$newFilename
type
:
string
description
:
|
The new ``filename`` value.
interface
:
phpmethod
operation
:
MongoDB\\GridFS\\Bucket::rename
optional
:
false
position
:
2
...
docs/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml
0 → 100644
View file @
4955333a
arg_name
:
option
name
:
_id
type
:
mixed
description
:
|
Value to use as the file document identifier. Defaults to a new
:php:`MongoDB\\BSON\\ObjectID <class.mongodb-bson-objectid>` object.
interface
:
phpmethod
operation
:
MongoDB\\GridFS\\Bucket::uploadFromStream
optional
:
true
position
:
1
---
arg_name
:
option
name
:
chunkSizeBytes
type
:
integer
description
:
|
The chunk size in bytes. Defaults to the bucket's ``chunkSizeBytes`` option.
interface
:
phpmethod
operation
:
MongoDB\\GridFS\\Bucket::uploadFromStream
optional
:
true
position
:
2
---
arg_name
:
option
name
:
metadata
type
:
array|object
description
:
|
User data for the ``metadata`` field of the file document. If not specified,
the ``metadata`` field will not be set on the file document.
interface
:
phpmethod
operation
:
MongoDB\\GridFS\\Bucket::uploadFromStream
optional
:
true
position
:
3
...
docs/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-param.yaml
0 → 100644
View file @
4955333a
arg_name
:
param
name
:
$filename
type
:
string
description
:
|
The ``filename`` of the file to create.
interface
:
phpmethod
operation
:
MongoDB\\GridFS\\Bucket::uploadFromStream
optional
:
false
position
:
1
---
arg_name
:
param
name
:
$source
type
:
resource
description
:
|
Readable stream where the file's contents will be read.
interface
:
phpmethod
operation
:
MongoDB\\GridFS\\Bucket::uploadFromStream
optional
:
false
position
:
2
---
source
:
file
:
apiargs-common-param.yaml
ref
:
$options
operation
:
MongoDB\\GridFS\\Bucket::uploadFromStream
position
:
3
...
docs/reference.txt
View file @
4955333a
...
@@ -11,3 +11,4 @@ Reference
...
@@ -11,3 +11,4 @@ Reference
/reference/class/MongoDBClient
/reference/class/MongoDBClient
/reference/class/MongoDBDatabase
/reference/class/MongoDBDatabase
/reference/class/MongoDBCollection
/reference/class/MongoDBCollection
/reference/class/MongoDBGridFSBucket
docs/reference/class/MongoDBDatabase.txt
View file @
4955333a
...
@@ -54,5 +54,6 @@ Methods
...
@@ -54,5 +54,6 @@ Methods
/reference/method/MongoDBDatabase-getManager
/reference/method/MongoDBDatabase-getManager
/reference/method/MongoDBDatabase-listCollections
/reference/method/MongoDBDatabase-listCollections
/reference/method/MongoDBDatabase-selectCollection
/reference/method/MongoDBDatabase-selectCollection
/reference/method/MongoDBDatabase-selectGridFSBucket
/reference/method/MongoDBDatabase-withOptions
/reference/method/MongoDBDatabase-withOptions
docs/reference/class/MongoDBGridFSBucket.txt
0 → 100644
View file @
4955333a
============================
MongoDB\\GridFS\Bucket Class
============================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. phpclass:: MongoDB\\GridFS\\Bucket
:manual:`GridFS </core/gridfs/>` is a specification for storing and
retrieving files in MongoDB. GridFS uses two collections to store files. One
collection stores the file chunks (e.g. ``fs.chunks``), and the other stores
file metadata (e.g. ``fs.files``). The :phpclass:`MongoDB\\GridFS\\Bucket`
class provides an interface around these collections for working with the
files as PHP :php:`Streams <stream>`.
You can construct a GridFS bucket using the PHP extension's
:php:`MongoDB\\Driver\\Manager <class.mongodb-driver-manager>` class, or
select a bucket from the |php-library|'s :phpclass:`MongoDB\\Database` class
via the :phpmethod:`selectGridFSBucket()
<MongoDB\\Database::selectGridFSBucket>` method.
Methods
-------
.. toctree::
:titlesonly:
/reference/method/MongoDBGridFSBucket__construct
/reference/method/MongoDBGridFSBucket-delete
/reference/method/MongoDBGridFSBucket-downloadToStream
/reference/method/MongoDBGridFSBucket-downloadToStreamByName
/reference/method/MongoDBGridFSBucket-drop
/reference/method/MongoDBGridFSBucket-find
/reference/method/MongoDBGridFSBucket-getBucketName
/reference/method/MongoDBGridFSBucket-getDatabaseName
/reference/method/MongoDBGridFSBucket-getFileDocumentForStream
/reference/method/MongoDBGridFSBucket-getFileIdForStream
/reference/method/MongoDBGridFSBucket-openDownloadStream
/reference/method/MongoDBGridFSBucket-openDownloadStreamByName
/reference/method/MongoDBGridFSBucket-openUploadStream
/reference/method/MongoDBGridFSBucket-rename
/reference/method/MongoDBGridFSBucket-uploadFromStream
docs/reference/method/MongoDBDatabase-selectGridFSBucket.txt
0 → 100644
View file @
4955333a
=======================================
MongoDB\\Database::selectGridFSBucket()
=======================================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. phpmethod:: MongoDB\\Database::selectGridFSBucket()
Selects a GridFS bucket within the database.
.. code-block:: php
function selectGridFSBucket(array $options = []): MongoDB\GridFS\Bucket
:phpmethod:`MongoDB\\Database::selectGridFSBucket()` has the following
parameters:
.. include:: /includes/apiargs/MongoDBDatabase-method-selectGridFSBucket-param.rst
The ``$options`` parameter supports the following options:
.. include:: /includes/apiargs/MongoDBDatabase-method-selectGridFSBucket-option.rst
:returns:
A :phpclass:`MongoDB\\GridFS\\Bucket` object.
Behavior
--------
The selected bucket inherits options such as read preference and write concern
from the :phpclass:`Database <MongoDB\\Database>` object. Options may be
overridden via the ``$options`` parameter.
Example
-------
The following example selects the default ``fs.files`` bucket in the ``demo``
database:
.. code-block:: php
<?php
$db = (new MongoDB\Client)->demo;
$bucket = $db->selectGridFSBucket();
The following example selects the custom ``images.files`` bucket in the ``demo``
database with a custom read preference:
.. code-block:: php
<?php
$db = (new MongoDB\Client)->demo;
$imagesBucket = $db->selectGridFSBucket([
'bucketName' => 'images',
'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY),
]);
.. seealso::
- :phpmethod:`MongoDB\\GridFS\\Bucket::__construct()`
docs/reference/method/MongoDBGridFSBucket-delete.txt
0 → 100644
View file @
4955333a
=================================
MongoDB\\GridFS\\Bucket::delete()
=================================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. phpmethod:: MongoDB\\GridFS\\Bucket::delete()
Delete a file and its chunks from the GridFS bucket.
.. code-block:: php
function delete($id): void
:phpmethod:`MongoDB\\GridFS\\Bucket::delete()` has the following parameters:
.. include:: /includes/apiargs/MongoDBGridFSBucket-method-delete-param.rst
Behavior
--------
If the files collection document is not found, this method will still attempt to
delete orphaned chunks.
.. todo: add examples
docs/reference/method/MongoDBGridFSBucket-downloadToStream.txt
0 → 100644
View file @
4955333a
===========================================
MongoDB\\GridFS\\Bucket::downloadToStream()
===========================================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. phpmethod:: MongoDB\\GridFS\\Bucket::downloadToStream()
Selects a GridFS file by its ``_id`` and copies its contents to a writable
stream.
.. code-block:: php
function downloadToStream($id, $destination): void
:phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStream()` has the following
parameters:
.. include:: /includes/apiargs/MongoDBGridFSBucket-method-downloadToStream-param.rst
.. todo: add examples
.. seealso::
- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStreamByName()`
- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStream()`
- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStreamByName()`
docs/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
0 → 100644
View file @
4955333a
===========================================
MongoDB\\GridFS\\Bucket::downloadToStream()
===========================================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. phpmethod:: MongoDB\\GridFS\\Bucket::downloadToStreamByName()
Selects a GridFS file by its ``filename`` and copies its contents to a
writable stream.
.. code-block:: php
function downloadToStreamByName($filename, $destination, array $options = []): void
:phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStreamByName()` has the
following parameters:
.. include:: /includes/apiargs/MongoDBGridFSBucket-method-downloadToStreamByName-param.rst
The ``$options`` parameter supports the following options:
.. include:: /includes/apiargs/MongoDBGridFSBucket-method-downloadToStreamByName-option.rst
.. todo: add examples
.. seealso::
- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStream()`
- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStream()`
- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStreamByName()`
docs/reference/method/MongoDBGridFSBucket-drop.txt
0 → 100644
View file @
4955333a
===============================
MongoDB\\GridFS\\Bucket::drop()
===============================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. phpmethod:: MongoDB\\GridFS\\Bucket::drop()
Drops the files and chunks collections associated with this GridFS bucket.
.. code-block:: php
function drop(): void
.. todo: add examples
docs/reference/method/MongoDBGridFSBucket-find.txt
0 → 100644
View file @
4955333a
===============================
MongoDB\\GridFS\\Bucket::find()
===============================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. phpmethod:: MongoDB\\GridFS\\Bucket::find()
Finds documents from the GridFS bucket's files collection matching the query.
.. code-block:: php
function find($filter = [], array $options = []): MongoDB\Driver\Cursor
:phpmethod:`MongoDB\\GridFS\\Bucket::find()` has the following parameters:
.. include:: /includes/apiargs/MongoDBCollection-method-find-param.rst
The ``$options`` parameter supports the following options:
.. include:: /includes/apiargs/MongoDBCollection-method-find-option.rst
:returns:
A :php:`MongoDB\\Driver\\Cursor <class.mongodb-driver-cursor>` object.
.. todo: add examples
.. seealso::
- :phpmethod:`MongoDB\\Collection::find()`
docs/reference/method/MongoDBGridFSBucket-getBucketName.txt
0 → 100644
View file @
4955333a
===========================================
MongoDB\\GridFS\\Bucket::downloadToStream()
===========================================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. phpmethod:: MongoDB\\GridFS\\Bucket::getBucketName()
Returns the name of this bucket.
.. code-block:: php
function getBucketName(): string
:returns:
The name of this bucket as a string.
.. todo: add examples
docs/reference/method/MongoDBGridFSBucket-getDatabaseName.txt
0 → 100644
View file @
4955333a
==========================================
MongoDB\\GridFS\\Bucket::getDatabaseName()
==========================================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. phpmethod:: MongoDB\\GridFS\\Bucket::getDatabaseName()
Returns the name of the database containing this bucket.
.. code-block:: php
function getDatabaseName(): string
:returns:
The name of the database containing this bucket as a string.
.. todo: add examples
docs/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
0 → 100644
View file @
4955333a
===================================================
MongoDB\\GridFS\\Bucket::getFileDocumentForStream()
===================================================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. phpmethod:: MongoDB\\GridFS\\Bucket::getFileDocumentForStream()
Gets the file document of the GridFS file associated with a stream.
.. code-block:: php
function getFileDocumentForStream($stream): object
:phpmethod:`MongoDB\\GridFS\\Bucket::getFileDocumentForStream()` has the
following parameters:
.. include:: /includes/apiargs/MongoDBGridFSBucket-method-getFileDocumentForStream-param.rst
:returns:
The metadata document associated with the GridFS stream.
.. todo: add examples
.. seealso::
- :phpmethod:`MongoDB\\GridFS\\Bucket::getFileIdForStream()`
docs/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
0 → 100644
View file @
4955333a
=============================================
MongoDB\\GridFS\\Bucket::getFileIdForStream()
=============================================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. phpmethod:: MongoDB\\GridFS\\Bucket::getFileIdForStream()
Gets the file document's ID of the GridFS file associated with a stream.
.. code-block:: php
function getFileIdForStream($stream): mixed
:phpmethod:`MongoDB\\GridFS\\Bucket::getFileIdForStream()` has the following
parameters:
.. include:: /includes/apiargs/MongoDBGridFSBucket-method-getFileIdForStream-param.rst
:returns:
The ``_id`` field of the metadata document associated with the GridFS
stream.
.. todo: add examples
.. seealso::
- :phpmethod:`MongoDB\\GridFS\\Bucket::getFileDocumentForStream()`
docs/reference/method/MongoDBGridFSBucket-openDownloadStream.txt
0 → 100644
View file @
4955333a
=============================================
MongoDB\\GridFS\\Bucket::openDownloadStream()
=============================================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. phpmethod:: MongoDB\\GridFS\\Bucket::openDownloadStream()
Selects a GridFS file by its ``_id`` and opens it as a readable stream.
.. code-block:: php
function openDownloadStream($id): resource
:phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStream()` has the following
parameters:
.. include:: /includes/apiargs/MongoDBGridFSBucket-method-openDownloadStream-param.rst
:returns:
A readable stream resource.
.. todo: add examples
.. seealso::
- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStream()`
- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStreamByName()`
- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStreamByName()`
docs/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
0 → 100644
View file @
4955333a
===================================================
MongoDB\\GridFS\\Bucket::openDownloadStreamByName()
===================================================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. phpmethod:: MongoDB\\GridFS\\Bucket::openDownloadStreamByName()
Selects a GridFS file by its ``filename`` and opens it as a readable stream.
.. code-block:: php
function openDownloadStreamByName($filename, array $options = []): resource
:phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStreamByName()` has the
following parameters:
.. include:: /includes/apiargs/MongoDBGridFSBucket-method-openDownloadStreamByName-param.rst
The ``$options`` parameter supports the following options:
.. include:: /includes/apiargs/MongoDBGridFSBucket-method-openDownloadStreamByName-option.rst
:returns:
A readable stream resource.
.. todo: add examples
.. seealso::
- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStream()`
- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStreamByName()`
- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStream()`
docs/reference/method/MongoDBGridFSBucket-openUploadStream.txt
0 → 100644
View file @
4955333a
===========================================
MongoDB\\GridFS\\Bucket::openUploadStream()
===========================================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. phpmethod:: MongoDB\\GridFS\\Bucket::openUploadStream()
Opens a writable stream for a new GridFS file.
.. code-block:: php
function openUploadStream($filename, array $options = []): resource
:phpmethod:`MongoDB\\GridFS\\Bucket::openUploadStream()` has the following
parameters:
.. include:: /includes/apiargs/MongoDBGridFSBucket-method-openUploadStream-param.rst
The ``$options`` parameter supports the following options:
.. include:: /includes/apiargs/MongoDBGridFSBucket-method-openUploadStream-option.rst
:returns:
A writable stream resource.
Behavior
--------
Chunk documents will be created as data is written to the writable stream. The
metadata document will be created when the writable stream is closed.
.. todo: add examples
.. seealso::
- :phpmethod:`MongoDB\\GridFS\\Bucket::uploadFromStream()`
docs/reference/method/MongoDBGridFSBucket-rename.txt
0 → 100644
View file @
4955333a
=================================
MongoDB\\GridFS\\Bucket::rename()
=================================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. phpmethod:: MongoDB\\GridFS\\Bucket::rename()
Selects a GridFS file by its ``_id`` and alters its ``filename``.
.. code-block:: php
function rename($id, $newFilename): void
:phpmethod:`MongoDB\\GridFS\\Bucket::rename()` has the following parameters:
.. include:: /includes/apiargs/MongoDBGridFSBucket-method-rename-param.rst
.. todo: add examples
docs/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
0 → 100644
View file @
4955333a
===========================================
MongoDB\\GridFS\\Bucket::uploadFromStream()
===========================================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. phpmethod:: MongoDB\\GridFS\\Bucket::uploadFromStream()
Creates a new GridFS file and copies the contents of a readable stream to it.
.. code-block:: php
function uploadFromStream($filename, $source, array $options = []): mixed
:phpmethod:`MongoDB\\GridFS\\Bucket::uploadFromStream()` has the following
parameters:
.. include:: /includes/apiargs/MongoDBGridFSBucket-method-uploadFromStream-param.rst
The ``$options`` parameter supports the following options:
.. include:: /includes/apiargs/MongoDBGridFSBucket-method-uploadFromStream-option.rst
:returns:
The ``_id`` field of the metadata document associated with the newly
created GridFS file. If the ``_id`` option is not specified, a new
:php:`MongoDB\\BSON\\ObjectID <class.mongodb-bson-objectid>` object will
be used by default.
.. todo: add examples
.. seealso::
- :phpmethod:`MongoDB\\GridFS\\Bucket::openUploadStream()`
docs/reference/method/MongoDBGridFSBucket__construct.txt
0 → 100644
View file @
4955333a
======================================
MongoDB\\GridFS\\Bucket::__construct()
======================================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. phpmethod:: MongoDB\\GridFS\\Bucket::__construct()
Constructs a new :phpclass:`Bucket <MongoDB\\GridFS\\Bucket>` instance.
.. code-block:: php
function __construct(MongoDB\Driver\Manager $manager, $databaseName, $collectionName, array $options = [])
:phpmethod:`MongoDB\\GridFS\\Bucket::__construct()` has the following
parameters:
.. include:: /includes/apiargs/MongoDBGridFSBucket-method-construct-param.rst
The ``$options`` parameter supports the following options:
.. include:: /includes/apiargs/MongoDBGridFSBucket-method-construct-option.rst
Behavior
--------
If you construct a Bucket explicitly, the Bucket inherits any options
from the :php:`MongoDB\\Driver\\Manager <class.mongodb-driver-manager>` object.
If you select the Bucket from a :phpclass:`Database <MongoDB\\Database>` object,
the Bucket inherits its options from that object.
.. todo: add an example
.. seealso::
- :phpmethod:`MongoDB\\Database::selectGridFSBucket()`
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment